]>
Commit | Line | Data |
---|---|---|
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 | <!-- |
5 | Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) | |
6 | Karl Berry <karl@freefriends.org> | |
7 | Olaf Bachmann <obachman@mathematik.uni-kl.de> | |
8 | and many others. | |
9 | Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de> | |
10 | Send bugs and suggestions to <texi2html@mathematik.uni-kl.de> | |
11 | ||
12 | --> | |
13 | <HEAD> | |
14 | <TITLE>Bash Reference Manual: </TITLE> | |
15 | ||
16 | <META NAME="description" CONTENT="Bash Reference Manual: "> | |
17 | <META NAME="keywords" CONTENT="Bash Reference Manual: "> | |
18 | <META NAME="resource-type" CONTENT="document"> | |
19 | <META NAME="distribution" CONTENT="global"> | |
20 | <META NAME="Generator" CONTENT="texi2html 1.64"> | |
21 | ||
22 | </HEAD> | |
23 | ||
24 | <BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"> | |
25 | ||
26 | <A NAME="SEC_Top"></A> | |
27 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
28 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
29 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
30 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#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 | ||
35 | This text is a brief description of the features that are present in | |
0001803f | 36 | the Bash shell (version 4.1, 23 December 2009). |
17345e5a JA |
37 | </P><P> |
38 | ||
0001803f | 39 | This is Edition 4.1, last updated 23 December 2009, |
17345e5a | 40 | of <CITE>The GNU Bash Reference Manual</CITE>, |
0001803f | 41 | for <CODE>Bash</CODE>, Version 4.1. |
17345e5a JA |
42 | </P><P> |
43 | ||
44 | Bash contains features that appear in other popular shells, and some | |
45 | features that only appear in Bash. Some of the shells that Bash has | |
46 | borrowed concepts from are the Bourne Shell (<TT>`sh'</TT>), the Korn Shell | |
47 | (<TT>`ksh'</TT>), and the C-shell (<TT>`csh'</TT> and its successor, | |
48 | <TT>`tcsh'</TT>). The following menu breaks the features up into | |
49 | categories based upon which one of these other shells inspired the | |
50 | feature. | |
51 | </P><P> | |
52 | ||
53 | This manual is meant as a brief introduction to features found in | |
54 | Bash. The Bash manual page should be used as the definitive | |
55 | reference on shell behavior. | |
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> </TD><TD ALIGN="left" VALIGN="TOP">An introduction to the shell.</TD></TR> | |
60 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC4">2. Definitions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Some definitions used in the rest of this | |
61 | manual.</TD></TR> | |
62 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC5">3. Basic Shell Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The shell "building blocks".</TD></TR> | |
63 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC58">4. Shell Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands that are a part of the shell.</TD></TR> | |
64 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC65">5. Shell Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables used or set by Bash.</TD></TR> | |
65 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC68">6. Bash Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Features found only in Bash.</TD></TR> | |
66 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC91">7. Job Control</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What job control is and how Bash allows you | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Chapter describing the command line | |
69 | editing features.</TD></TR> | |
70 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC119">9. Using History Interactively</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Command History Expansion</TD></TR> | |
71 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC126">10. Installing Bash</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to build and install Bash on your system.</TD></TR> | |
72 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC135">A. Reporting Bugs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to report bugs in Bash.</TD></TR> | |
73 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A terse list of the differences | |
74 | between Bash and historical | |
75 | versions of /bin/sh.</TD></TR> | |
76 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC138">C. GNU Free Documentation License</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Copying and sharing this documentation.</TD></TR> | |
77 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC140">D. Indexes</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Various indexes for this manual.</TD></TR> | |
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"> < </A>]</TD> | |
85 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> > </A>]</TD> | |
86 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
87 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
88 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD> | |
89 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
90 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
91 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
92 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">A short description of Bash.</TD></TR> | |
99 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC3">1.2 What is a shell?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A brief introduction to shells.</TD></TR> | |
100 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
108 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> > </A>]</TD> | |
109 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
110 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD> | |
111 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD> | |
112 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
113 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
114 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
115 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
116 | </TR></TABLE> | |
117 | <H2> 1.1 What is Bash? </H2> | |
118 | <!--docid::SEC2::--> | |
119 | <P> | |
120 | ||
121 | Bash is the shell, or command language interpreter, | |
122 | for the GNU operating system. | |
123 | The name is an acronym for the <SAMP>`Bourne-Again SHell'</SAMP>, | |
124 | a pun on Stephen Bourne, the author of the direct ancestor of | |
125 | the current Unix shell <CODE>sh</CODE>, | |
126 | which appeared in the Seventh Edition Bell Labs Research version | |
127 | of Unix. | |
128 | </P><P> | |
129 | ||
130 | Bash is largely compatible with <CODE>sh</CODE> and incorporates useful | |
131 | features from the Korn shell <CODE>ksh</CODE> and the C shell <CODE>csh</CODE>. | |
132 | It is intended to be a conformant implementation of the IEEE | |
133 | POSIX Shell and Tools portion of the IEEE POSIX | |
134 | specification (IEEE Standard 1003.1). | |
135 | It offers functional improvements over <CODE>sh</CODE> for both interactive and | |
136 | programming use. | |
137 | </P><P> | |
138 | ||
139 | While the GNU operating system provides other shells, including | |
140 | a version of <CODE>csh</CODE>, Bash is the default shell. | |
141 | Like other GNU software, Bash is quite portable. It currently runs | |
142 | on nearly every version of Unix and a few other operating systems - | |
143 | independently-supported ports exist for MS-DOS, OS/2, | |
144 | and Windows platforms. | |
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"> < </A>]</TD> | |
152 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> > </A>]</TD> | |
153 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
154 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD> | |
155 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD> | |
156 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
157 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
158 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
159 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
160 | </TR></TABLE> | |
161 | <H2> 1.2 What is a shell? </H2> | |
162 | <!--docid::SEC3::--> | |
163 | <P> | |
164 | ||
165 | At its base, a shell is simply a macro processor that executes | |
166 | commands. The term macro processor means functionality where text | |
167 | and symbols are expanded to create larger expressions. | |
168 | </P><P> | |
169 | ||
170 | A Unix shell is both a command interpreter and a programming | |
171 | language. As a command interpreter, the shell provides the user | |
172 | interface to the rich set of GNU utilities. The programming | |
173 | language features allow these utilities to be combined. | |
174 | Files containing commands can be created, and become | |
175 | commands themselves. These new commands have the same status as | |
176 | system commands in directories such as <TT>`/bin'</TT>, allowing users | |
177 | or groups to establish custom environments to automate their common | |
178 | tasks. | |
179 | </P><P> | |
180 | ||
181 | Shells may be used interactively or non-interactively. In | |
182 | interactive mode, they accept input typed from the keyboard. | |
183 | When executing non-interactively, shells execute commands read | |
184 | from a file. | |
185 | </P><P> | |
186 | ||
187 | A shell allows execution of GNU commands, both synchronously and | |
188 | asynchronously. | |
189 | The shell waits for synchronous commands to complete before accepting | |
190 | more input; asynchronous commands continue to execute in parallel | |
191 | with the shell while it reads and executes additional commands. | |
192 | The <EM>redirection</EM> constructs permit | |
193 | fine-grained control of the input and output of those commands. | |
194 | Moreover, the shell allows control over the contents of commands' | |
195 | environments. | |
196 | </P><P> | |
197 | ||
198 | Shells also provide a small set of built-in | |
199 | commands (<EM>builtins</EM>) implementing functionality impossible | |
200 | or inconvenient to obtain via separate utilities. | |
201 | For example, <CODE>cd</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, and | |
202 | <CODE>exec</CODE>) cannot be implemented outside of the shell because | |
203 | they directly manipulate the shell itself. | |
204 | The <CODE>history</CODE>, <CODE>getopts</CODE>, <CODE>kill</CODE>, or <CODE>pwd</CODE> | |
205 | builtins, among others, could be implemented in separate utilities, | |
206 | but they are more convenient to use as builtin commands. | |
207 | All of the shell builtins are described in | |
208 | subsequent sections. | |
209 | </P><P> | |
210 | ||
211 | While executing commands is essential, most of the power (and | |
212 | complexity) of shells is due to their embedded programming | |
213 | languages. Like any high-level language, the shell provides | |
214 | variables, flow control constructs, quoting, and functions. | |
215 | </P><P> | |
216 | ||
217 | Shells offer features geared specifically for | |
218 | interactive use rather than to augment the programming language. | |
219 | These interactive features include job control, command line | |
220 | editing, command history and aliases. Each of these features is | |
221 | described in this manual. | |
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"> < </A>]</TD> | |
229 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> > </A>]</TD> | |
230 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> | |
231 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
232 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> >> </A>]</TD> | |
233 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
234 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
235 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
236 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
237 | </TR></TABLE> | |
238 | <H1> 2. Definitions </H1> | |
239 | <!--docid::SEC4::--> | |
240 | These 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> | |
247 | A family of open system standards based on Unix. Bash | |
248 | is primarily concerned with the Shell and Utilities portion of the | |
249 | POSIX 1003.1 standard. | |
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> | |
258 | A command that is implemented internally by the shell itself, rather | |
259 | than by an executable program somewhere in the file system. | |
260 | <P> | |
261 | ||
262 | <DT><CODE>control operator</CODE> | |
263 | <DD><A NAME="IDX3"></A> | |
264 | A <CODE>token</CODE> that performs a control function. It is a <CODE>newline</CODE> | |
265 | or one of the following: | |
266 | <SAMP>`||'</SAMP>, <SAMP>`&&'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`;;'</SAMP>, | |
267 | <SAMP>`|'</SAMP>, <SAMP>`|&'</SAMP>, <SAMP>`('</SAMP>, or <SAMP>`)'</SAMP>. | |
268 | <P> | |
269 | ||
270 | <DT><CODE>exit status</CODE> | |
271 | <DD><A NAME="IDX4"></A> | |
272 | The value returned by a command to its caller. The value is restricted | |
273 | to eight bits, so the maximum value is 255. | |
274 | <P> | |
275 | ||
276 | <DT><CODE>field</CODE> | |
277 | <DD><A NAME="IDX5"></A> | |
278 | A unit of text that is the result of one of the shell expansions. After | |
279 | expansion, when executing a command, the resulting fields are used as | |
280 | the command name and arguments. | |
281 | <P> | |
282 | ||
283 | <DT><CODE>filename</CODE> | |
284 | <DD><A NAME="IDX6"></A> | |
285 | A string of characters used to identify a file. | |
286 | <P> | |
287 | ||
288 | <DT><CODE>job</CODE> | |
289 | <DD><A NAME="IDX7"></A> | |
290 | A set of processes comprising a pipeline, and any processes descended | |
291 | from it, that are all in the same process group. | |
292 | <P> | |
293 | ||
294 | <DT><CODE>job control</CODE> | |
295 | <DD><A NAME="IDX8"></A> | |
296 | A mechanism by which users can selectively stop (suspend) and restart | |
297 | (resume) execution of processes. | |
298 | <P> | |
299 | ||
300 | <DT><CODE>metacharacter</CODE> | |
301 | <DD><A NAME="IDX9"></A> | |
302 | A character that, when unquoted, separates words. A metacharacter is | |
303 | a <CODE>blank</CODE> or one of the following characters: | |
304 | <SAMP>`|'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`('</SAMP>, <SAMP>`)'</SAMP>, <SAMP>`<'</SAMP>, or | |
305 | <SAMP>`>'</SAMP>. | |
306 | <P> | |
307 | ||
308 | <DT><CODE>name</CODE> | |
309 | <DD><A NAME="IDX10"></A> | |
310 | <A NAME="IDX11"></A> | |
311 | A <CODE>word</CODE> consisting solely of letters, numbers, and underscores, | |
312 | and beginning with a letter or underscore. <CODE>Name</CODE>s are used as | |
313 | shell variable and function names. | |
314 | Also referred to as an <CODE>identifier</CODE>. | |
315 | <P> | |
316 | ||
317 | <DT><CODE>operator</CODE> | |
318 | <DD><A NAME="IDX12"></A> | |
319 | A <CODE>control operator</CODE> or a <CODE>redirection operator</CODE>. | |
320 | See section <A HREF="bashref.html#SEC39">3.6 Redirections</A>, for a list of redirection operators. | |
321 | Operators contain at least one unquoted <CODE>metacharacter</CODE>. | |
322 | <P> | |
323 | ||
324 | <DT><CODE>process group</CODE> | |
325 | <DD><A NAME="IDX13"></A> | |
326 | A collection of related processes each having the same process | |
327 | group ID. | |
328 | <P> | |
329 | ||
330 | <DT><CODE>process group ID</CODE> | |
331 | <DD><A NAME="IDX14"></A> | |
332 | A unique identifier that represents a <CODE>process group</CODE> | |
333 | during its lifetime. | |
334 | <P> | |
335 | ||
336 | <DT><CODE>reserved word</CODE> | |
337 | <DD><A NAME="IDX15"></A> | |
338 | A <CODE>word</CODE> that has a special meaning to the shell. Most reserved | |
339 | words introduce shell flow control constructs, such as <CODE>for</CODE> and | |
340 | <CODE>while</CODE>. | |
341 | <P> | |
342 | ||
343 | <DT><CODE>return status</CODE> | |
344 | <DD><A NAME="IDX16"></A> | |
345 | A synonym for <CODE>exit status</CODE>. | |
346 | <P> | |
347 | ||
348 | <DT><CODE>signal</CODE> | |
349 | <DD><A NAME="IDX17"></A> | |
350 | A mechanism by which a process may be notified by the kernel | |
351 | of an event occurring in the system. | |
352 | <P> | |
353 | ||
354 | <DT><CODE>special builtin</CODE> | |
355 | <DD><A NAME="IDX18"></A> | |
356 | A shell builtin command that has been classified as special by the | |
357 | POSIX standard. | |
358 | <P> | |
359 | ||
360 | <DT><CODE>token</CODE> | |
361 | <DD><A NAME="IDX19"></A> | |
362 | A sequence of characters considered a single unit by the shell. | |
363 | It is either a <CODE>word</CODE> or an <CODE>operator</CODE>. | |
364 | <P> | |
365 | ||
366 | <DT><CODE>word</CODE> | |
367 | <DD><A NAME="IDX20"></A> | |
368 | A sequence of characters treated as a unit by the shell. | |
369 | Words may not include unquoted <CODE>metacharacters</CODE>. | |
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"> < </A>]</TD> | |
378 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> > </A>]</TD> | |
379 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD> | |
380 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
381 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD> | |
382 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
383 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
384 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
385 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
386 | </TR></TABLE> | |
387 | <H1> 3. Basic Shell Features </H1> | |
388 | <!--docid::SEC5::--> | |
389 | <P> | |
390 | ||
391 | Bash is an acronym for <SAMP>`Bourne-Again SHell'</SAMP>. | |
392 | The Bourne shell is | |
393 | the traditional Unix shell originally written by Stephen Bourne. | |
394 | All of the Bourne shell builtin commands are available in Bash, | |
395 | The rules for evaluation and quoting are taken from the POSIX | |
396 | specification for the `standard' Unix shell. | |
397 | </P><P> | |
398 | ||
399 | This chapter briefly summarizes the shell's `building blocks': | |
400 | commands, control structures, shell functions, shell <I>parameters</I>, | |
401 | shell expansions, | |
402 | <I>redirections</I>, which are a way to direct input and output from | |
403 | and to named files, and how the shell executes commands. | |
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> </TD><TD ALIGN="left" VALIGN="TOP">What your input means to the shell.</TD></TR> | |
408 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC15">3.2 Shell Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The types of commands you can use.</TD></TR> | |
409 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Grouping commands by name.</TD></TR> | |
410 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the shell stores values.</TD></TR> | |
411 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC28">3.5 Shell Expansions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands parameters and the various | |
412 | expansions available.</TD></TR> | |
413 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC39">3.6 Redirections</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A way to control where input and output go.</TD></TR> | |
414 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC50">3.7 Executing Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What happens when you run a command.</TD></TR> | |
415 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC57">3.8 Shell Scripts</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Executing files of shell commands.</TD></TR> | |
416 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
424 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> > </A>]</TD> | |
425 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> | |
426 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
427 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD> | |
428 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
429 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
430 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
431 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">The basic operation of the shell.</TD></TR> | |
437 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC8">3.1.2 Quoting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to remove the special meaning from characters.</TD></TR> | |
438 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC14">3.1.3 Comments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify comments.</TD></TR> | |
439 | </TABLE></BLOCKQUOTE> | |
440 | <P> | |
441 | ||
442 | When the shell reads input, it proceeds through a | |
443 | sequence of operations. If the input indicates the beginning of a | |
444 | comment, the shell ignores the comment symbol (<SAMP>`#'</SAMP>), and the rest | |
445 | of that line. | |
446 | ||
447 | Otherwise, roughly speaking, the shell reads its input and | |
448 | divides the input into words and operators, employing the quoting rules | |
449 | to select which meanings to assign various words and characters. | |
450 | </P><P> | |
451 | ||
452 | The shell then parses these tokens into commands and other constructs, | |
453 | removes the special meaning of certain words or characters, expands | |
454 | others, redirects input and output as needed, executes the specified | |
455 | command, waits for the command's exit status, and makes that exit status | |
456 | available for further inspection or processing. | |
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"> < </A>]</TD> | |
464 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> > </A>]</TD> | |
465 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> | |
466 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD> | |
467 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD> | |
468 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
469 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
470 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
471 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
472 | </TR></TABLE> | |
473 | <H3> 3.1.1 Shell Operation </H3> | |
474 | <!--docid::SEC7::--> | |
475 | <P> | |
476 | ||
477 | The following is a brief description of the shell's operation when it | |
478 | reads and executes a command. Basically, the shell does the | |
479 | following: | |
480 | </P><P> | |
481 | ||
482 | <OL> | |
483 | <LI> | |
484 | Reads its input from a file (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), from a string | |
485 | supplied as an argument to the <SAMP>`-c'</SAMP> invocation option | |
486 | (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>), or from the user's terminal. | |
487 | <P> | |
488 | ||
489 | <LI> | |
490 | Breaks the input into words and operators, obeying the quoting rules | |
491 | described in <A HREF="bashref.html#SEC8">3.1.2 Quoting</A>. These tokens are separated by | |
492 | <CODE>metacharacters</CODE>. Alias expansion is performed by this step | |
493 | (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>). | |
494 | <P> | |
495 | ||
496 | <LI> | |
497 | Parses 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> | |
502 | Performs the various shell expansions (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>), breaking | |
503 | the expanded tokens into lists of filenames (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>) | |
504 | and commands and arguments. | |
505 | <P> | |
506 | ||
507 | <LI> | |
508 | Performs any necessary redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) and removes | |
509 | the redirection operators and their operands from the argument list. | |
510 | <P> | |
511 | ||
512 | <LI> | |
513 | Executes the command (see section <A HREF="bashref.html#SEC50">3.7 Executing Commands</A>). | |
514 | <P> | |
515 | ||
516 | <LI> | |
517 | Optionally waits for the command to complete and collects its exit | |
518 | status (see section <A HREF="bashref.html#SEC55">3.7.5 Exit Status</A>). | |
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"> < </A>]</TD> | |
529 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> > </A>]</TD> | |
530 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD> | |
531 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD> | |
532 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> | |
533 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
534 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
535 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
536 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </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> </TD><TD ALIGN="left" VALIGN="TOP">How to inhibit all interpretation of a sequence | |
544 | of characters.</TD></TR> | |
545 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to suppress most of the interpretation of a | |
546 | sequence of characters.</TD></TR> | |
547 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to expand ANSI-C sequences in quoted strings.</TD></TR> | |
548 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to translate strings into different languages.</TD></TR> | |
549 | </TABLE></BLOCKQUOTE> | |
550 | <P> | |
551 | ||
552 | Quoting is used to remove the special meaning of certain | |
553 | characters or words to the shell. Quoting can be used to | |
554 | disable special treatment for special characters, to prevent | |
555 | reserved words from being recognized as such, and to prevent | |
556 | parameter expansion. | |
557 | </P><P> | |
558 | ||
559 | Each of the shell metacharacters (see section <A HREF="bashref.html#SEC4">2. Definitions</A>) | |
560 | has special meaning to the shell and must be quoted if it is to | |
561 | represent itself. | |
562 | When the command history expansion facilities are being used | |
563 | (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>), the | |
564 | <VAR>history expansion</VAR> character, usually <SAMP>`!'</SAMP>, must be quoted | |
565 | to prevent history expansion. See section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>, for | |
566 | more details concerning history expansion. | |
567 | </P><P> | |
568 | ||
569 | There 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"> < </A>]</TD> | |
578 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> > </A>]</TD> | |
579 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD> | |
580 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> | |
581 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> | |
582 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
583 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
584 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
585 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
586 | </TR></TABLE> | |
587 | <H4> 3.1.2.1 Escape Character </H4> | |
588 | <!--docid::SEC9::--> | |
589 | A non-quoted backslash <SAMP>`\'</SAMP> is the Bash escape character. | |
590 | It preserves the literal value of the next character that follows, | |
591 | with the exception of <CODE>newline</CODE>. If a <CODE>\newline</CODE> pair | |
592 | appears, and the backslash itself is not quoted, the <CODE>\newline</CODE> | |
593 | is treated as a line continuation (that is, it is removed from | |
594 | the input stream and effectively ignored). | |
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"> < </A>]</TD> | |
602 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> > </A>]</TD> | |
603 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> << </A>]</TD> | |
604 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> | |
605 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> | |
606 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
607 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
608 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
609 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
610 | </TR></TABLE> | |
611 | <H4> 3.1.2.2 Single Quotes </H4> | |
612 | <!--docid::SEC10::--> | |
613 | <P> | |
614 | ||
615 | Enclosing characters in single quotes (<SAMP>`''</SAMP>) preserves the literal value | |
616 | of each character within the quotes. A single quote may not occur | |
617 | between single quotes, even when preceded by a backslash. | |
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"> < </A>]</TD> | |
625 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> > </A>]</TD> | |
626 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> << </A>]</TD> | |
627 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> | |
628 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> | |
629 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
630 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
631 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
632 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
633 | </TR></TABLE> | |
634 | <H4> 3.1.2.3 Double Quotes </H4> | |
635 | <!--docid::SEC11::--> | |
636 | <P> | |
637 | ||
638 | Enclosing characters in double quotes (<SAMP>`"'</SAMP>) preserves the literal value | |
639 | of all characters within the quotes, with the exception of | |
640 | <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`\'</SAMP>, | |
641 | and, when history expansion is enabled, <SAMP>`!'</SAMP>. | |
642 | The characters <SAMP>`$'</SAMP> and <SAMP>``'</SAMP> | |
643 | retain their special meaning within double quotes (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>). | |
644 | The backslash retains its special meaning only when followed by one of | |
645 | the following characters: | |
646 | <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`"'</SAMP>, <SAMP>`\'</SAMP>, or <CODE>newline</CODE>. | |
647 | Within double quotes, backslashes that are followed by one of these | |
648 | characters are removed. Backslashes preceding characters without a | |
649 | special meaning are left unmodified. | |
650 | A double quote may be quoted within double quotes by preceding it with | |
651 | a backslash. | |
652 | If enabled, history expansion will be performed unless an <SAMP>`!'</SAMP> | |
653 | appearing in double quotes is escaped using a backslash. | |
654 | The backslash preceding the <SAMP>`!'</SAMP> is not removed. | |
655 | </P><P> | |
656 | ||
657 | The special parameters <SAMP>`*'</SAMP> and <SAMP>`@'</SAMP> have special meaning | |
658 | when in double quotes (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
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"> < </A>]</TD> | |
666 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> > </A>]</TD> | |
667 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> << </A>]</TD> | |
668 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> | |
669 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> | |
670 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
671 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
672 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
673 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
674 | </TR></TABLE> | |
675 | <H4> 3.1.2.4 ANSI-C Quoting </H4> | |
676 | <!--docid::SEC12::--> | |
677 | <P> | |
678 | ||
679 | Words of the form <CODE>$'<VAR>string</VAR>'</CODE> are treated specially. The | |
680 | word expands to <VAR>string</VAR>, with backslash-escaped characters replaced | |
681 | as specified by the ANSI C standard. Backslash escape sequences, if | |
682 | present, are decoded as follows: | |
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 | ||
720 | The expanded result is single-quoted, as if the dollar sign had not | |
721 | been 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"> < </A>]</TD> | |
729 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> > </A>]</TD> | |
730 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD> | |
731 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> | |
732 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> | |
733 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
734 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
735 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
736 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
737 | </TR></TABLE> | |
738 | <H4> 3.1.2.5 Locale-Specific Translation </H4> | |
739 | <!--docid::SEC13::--> | |
740 | <P> | |
741 | ||
742 | A double-quoted string preceded by a dollar sign (<SAMP>`$'</SAMP>) will cause | |
743 | the string to be translated according to the current locale. | |
744 | If the current locale is <CODE>C</CODE> or <CODE>POSIX</CODE>, the dollar sign | |
745 | is ignored. | |
746 | If the string is translated and replaced, the replacement is | |
747 | double-quoted. | |
748 | </P><P> | |
749 | ||
750 | <A NAME="IDX21"></A> | |
751 | <A NAME="IDX22"></A> | |
752 | <A NAME="IDX23"></A> | |
753 | Some systems use the message catalog selected by the <CODE>LC_MESSAGES</CODE> | |
754 | shell variable. Others create the name of the message catalog from the | |
755 | value of the <CODE>TEXTDOMAIN</CODE> shell variable, possibly adding a | |
756 | suffix of <SAMP>`.mo'</SAMP>. If you use the <CODE>TEXTDOMAIN</CODE> variable, you | |
757 | may need to set the <CODE>TEXTDOMAINDIR</CODE> variable to the location of | |
758 | the message catalog files. Still others use both variables in this | |
759 | fashion: | |
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"> < </A>]</TD> | |
768 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> > </A>]</TD> | |
769 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> | |
770 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD> | |
771 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD> | |
772 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
773 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
774 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
775 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
776 | </TR></TABLE> | |
777 | <H3> 3.1.3 Comments </H3> | |
778 | <!--docid::SEC14::--> | |
779 | <P> | |
780 | ||
781 | In a non-interactive shell, or an interactive shell in which the | |
782 | <CODE>interactive_comments</CODE> option to the <CODE>shopt</CODE> | |
783 | builtin is enabled (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), | |
784 | a word beginning with <SAMP>`#'</SAMP> | |
785 | causes that word and all remaining characters on that line to | |
786 | be ignored. An interactive shell without the <CODE>interactive_comments</CODE> | |
787 | option enabled does not allow comments. The <CODE>interactive_comments</CODE> | |
788 | option is on by default in interactive shells. | |
789 | See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for a description of what makes | |
790 | a 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"> < </A>]</TD> | |
798 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> > </A>]</TD> | |
799 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD> | |
800 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
801 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
802 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
803 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
804 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
805 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
806 | </TR></TABLE> | |
807 | <H2> 3.2 Shell Commands </H2> | |
808 | <!--docid::SEC15::--> | |
809 | <P> | |
810 | ||
811 | A simple shell command such as <CODE>echo a b c</CODE> consists of the command | |
812 | itself followed by arguments, separated by spaces. | |
813 | </P><P> | |
814 | ||
815 | More complex shell commands are composed of simple commands arranged together | |
816 | in a variety of ways: in a pipeline in which the output of one command | |
817 | becomes the input of a second, in a loop or conditional construct, or in | |
818 | some 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> </TD><TD ALIGN="left" VALIGN="TOP">The most common type of command.</TD></TR> | |
823 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Connecting the input and output of several | |
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> </TD><TD ALIGN="left" VALIGN="TOP">How to execute commands sequentially.</TD></TR> | |
826 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for control flow.</TD></TR> | |
827 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Two-way communication between commands.</TD></TR> | |
828 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
836 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> > </A>]</TD> | |
837 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD> | |
838 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
839 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
840 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
841 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
842 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
843 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
844 | </TR></TABLE> | |
845 | <H3> 3.2.1 Simple Commands </H3> | |
846 | <!--docid::SEC16::--> | |
847 | <P> | |
848 | ||
849 | A simple command is the kind of command encountered most often. | |
850 | It's just a sequence of words separated by <CODE>blank</CODE>s, terminated | |
851 | by one of the shell's control operators (see section <A HREF="bashref.html#SEC4">2. Definitions</A>). The | |
852 | first word generally specifies a command to be executed, with the | |
853 | rest of the words being that command's arguments. | |
854 | </P><P> | |
855 | ||
856 | The return status (see section <A HREF="bashref.html#SEC55">3.7.5 Exit Status</A>) of a simple command is | |
857 | its exit status as provided | |
858 | by the POSIX 1003.1 <CODE>waitpid</CODE> function, or 128+<VAR>n</VAR> if | |
859 | the command was terminated by signal <VAR>n</VAR>. | |
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"> < </A>]</TD> | |
867 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> > </A>]</TD> | |
868 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> << </A>]</TD> | |
869 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
870 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
871 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
872 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
873 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
874 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
875 | </TR></TABLE> | |
876 | <H3> 3.2.2 Pipelines </H3> | |
877 | <!--docid::SEC17::--> | |
878 | <P> | |
879 | ||
880 | A <CODE>pipeline</CODE> is a sequence of simple commands separated by one of | |
881 | the control operators <SAMP>`|'</SAMP> or <SAMP>`|&'</SAMP>. | |
882 | </P><P> | |
883 | ||
884 | <A NAME="IDX24"></A> | |
885 | <A NAME="IDX25"></A> | |
886 | <A NAME="IDX26"></A> | |
887 | The format for a pipeline is | |
888 | <TABLE><tr><td> </td><td class=example><pre>[<CODE>time</CODE> [<CODE>-p</CODE>]] [<CODE>!</CODE>] <VAR>command1</VAR> [ [<CODE>|</CODE> or <CODE>|&</CODE>] <VAR>command2</VAR> <small>...</small>] | |
889 | </pre></td></tr></table></P><P> | |
890 | ||
891 | The output of each command in the pipeline is connected via a pipe | |
892 | to the input of the next command. | |
893 | That is, each command reads the previous command's output. This | |
894 | connection is performed before any redirections specified by the | |
895 | command. | |
896 | </P><P> | |
897 | ||
898 | If <SAMP>`|&'</SAMP> is used, the standard error of <VAR>command1</VAR> is connected to | |
899 | <VAR>command2</VAR>'s standard input through the pipe; it is shorthand for | |
900 | <CODE>2>&1 |</CODE>. This implicit redirection of the standard error is | |
901 | performed after any redirections specified by the command. | |
902 | </P><P> | |
903 | ||
904 | The reserved word <CODE>time</CODE> causes timing statistics | |
905 | to be printed for the pipeline once it finishes. | |
906 | The statistics currently consist of elapsed (wall-clock) time and | |
907 | user and system time consumed by the command's execution. | |
908 | The <SAMP>`-p'</SAMP> option changes the output format to that specified | |
909 | by POSIX. | |
910 | The <CODE>TIMEFORMAT</CODE> variable may be set to a format string that | |
911 | specifies how the timing information should be displayed. | |
912 | See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of the available formats. | |
913 | The use of <CODE>time</CODE> as a reserved word permits the timing of | |
914 | shell builtins, shell functions, and pipelines. An external | |
915 | <CODE>time</CODE> command cannot time these easily. | |
916 | </P><P> | |
917 | ||
918 | If the pipeline is not executed asynchronously (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the | |
919 | shell waits for all commands in the pipeline to complete. | |
920 | </P><P> | |
921 | ||
922 | Each command in a pipeline is executed in its own subshell | |
923 | (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>). The exit | |
924 | status of a pipeline is the exit status of the last command in the | |
925 | pipeline, unless the <CODE>pipefail</CODE> option is enabled | |
926 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
927 | If <CODE>pipefail</CODE> is enabled, the pipeline's return status is the | |
928 | value of the last (rightmost) command to exit with a non-zero status, | |
929 | or zero if all commands exit successfully. | |
930 | If the reserved word <SAMP>`!'</SAMP> precedes the pipeline, the | |
931 | exit status is the logical negation of the exit status as described | |
932 | above. | |
933 | The shell waits for all commands in the pipeline to terminate before | |
934 | returning 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"> < </A>]</TD> | |
942 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> > </A>]</TD> | |
943 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> << </A>]</TD> | |
944 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
945 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
946 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
947 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
948 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
949 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
950 | </TR></TABLE> | |
951 | <H3> 3.2.3 Lists of Commands </H3> | |
952 | <!--docid::SEC18::--> | |
953 | <P> | |
954 | ||
955 | A <CODE>list</CODE> is a sequence of one or more pipelines separated by one | |
956 | of the operators <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`&&'</SAMP>, or <SAMP>`||'</SAMP>, | |
957 | and optionally terminated by one of <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, or a | |
958 | <CODE>newline</CODE>. | |
959 | </P><P> | |
960 | ||
961 | Of these list operators, <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP> | |
962 | have equal precedence, followed by <SAMP>`;'</SAMP> and <SAMP>`&'</SAMP>, | |
963 | which have equal precedence. | |
964 | </P><P> | |
965 | ||
966 | A sequence of one or more newlines may appear in a <CODE>list</CODE> | |
967 | to delimit commands, equivalent to a semicolon. | |
968 | </P><P> | |
969 | ||
970 | If a command is terminated by the control operator <SAMP>`&'</SAMP>, | |
971 | the shell executes the command asynchronously in a subshell. | |
972 | This is known as executing the command in the <VAR>background</VAR>. | |
973 | The shell does not wait for the command to finish, and the return | |
974 | status is 0 (true). | |
975 | When job control is not active (see section <A HREF="bashref.html#SEC91">7. Job Control</A>), | |
976 | the standard input for asynchronous commands, in the absence of any | |
977 | explicit redirections, is redirected from <CODE>/dev/null</CODE>. | |
978 | </P><P> | |
979 | ||
980 | Commands separated by a <SAMP>`;'</SAMP> are executed sequentially; the shell | |
981 | waits for each command to terminate in turn. The return status is the | |
982 | exit status of the last command executed. | |
983 | </P><P> | |
984 | ||
985 | AND and OR lists are sequences of one or more pipelines | |
986 | separated by the control operators <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP>, | |
987 | respectively. AND and OR lists are executed with left | |
988 | associativity. | |
989 | </P><P> | |
990 | ||
991 | An AND list has the form | |
992 | <TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> && <VAR>command2</VAR> | |
993 | </pre></td></tr></table></P><P> | |
994 | ||
995 | <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR> | |
996 | returns an exit status of zero. | |
997 | </P><P> | |
998 | ||
999 | An OR list has the form | |
1000 | <TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> || <VAR>command2</VAR> | |
1001 | </pre></td></tr></table></P><P> | |
1002 | ||
1003 | <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR> | |
1004 | returns a non-zero exit status. | |
1005 | </P><P> | |
1006 | ||
1007 | The return status of | |
1008 | AND and OR lists is the exit status of the last command | |
1009 | executed 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"> < </A>]</TD> | |
1017 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> > </A>]</TD> | |
1018 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> | |
1019 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
1020 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> | |
1021 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1022 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1023 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1024 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for iterative action.</TD></TR> | |
1032 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for conditional execution.</TD></TR> | |
1033 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Ways to group commands.</TD></TR> | |
1034 | </TABLE></BLOCKQUOTE> | |
1035 | <P> | |
1036 | ||
1037 | Compound commands are the shell programming constructs. | |
1038 | Each construct begins with a reserved word or control operator and is | |
1039 | terminated by a corresponding reserved word or operator. | |
1040 | Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with a compound command | |
1041 | apply to all commands within that compound command unless explicitly overridden. | |
1042 | </P><P> | |
1043 | ||
1044 | Bash provides looping constructs, conditional commands, and mechanisms | |
1045 | to 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"> < </A>]</TD> | |
1053 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> > </A>]</TD> | |
1054 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> | |
1055 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD> | |
1056 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> | |
1057 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1058 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1059 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1060 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1061 | </TR></TABLE> | |
1062 | <H4> 3.2.4.1 Looping Constructs </H4> | |
1063 | <!--docid::SEC20::--> | |
1064 | <P> | |
1065 | ||
1066 | Bash supports the following looping constructs. | |
1067 | </P><P> | |
1068 | ||
1069 | Note that wherever a <SAMP>`;'</SAMP> appears in the description of a | |
1070 | command's syntax, it may be replaced with one or more newlines. | |
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> | |
1078 | The syntax of the <CODE>until</CODE> command is: | |
1079 | <TABLE><tr><td> </td><td class=example><pre>until <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done | |
1080 | </pre></td></tr></table>Execute <VAR>consequent-commands</VAR> as long as | |
1081 | <VAR>test-commands</VAR> has an exit status which is not zero. | |
1082 | The return status is the exit status of the last command executed | |
1083 | in <VAR>consequent-commands</VAR>, or zero if none was executed. | |
1084 | <P> | |
1085 | ||
1086 | <DT><CODE>while</CODE> | |
1087 | <DD><A NAME="IDX30"></A> | |
1088 | The syntax of the <CODE>while</CODE> command is: | |
1089 | <TABLE><tr><td> </td><td class=example><pre>while <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done | |
1090 | </pre></td></tr></table><P> | |
1091 | ||
1092 | Execute <VAR>consequent-commands</VAR> as long as | |
1093 | <VAR>test-commands</VAR> has an exit status of zero. | |
1094 | The return status is the exit status of the last command executed | |
1095 | in <VAR>consequent-commands</VAR>, or zero if none was executed. | |
1096 | </P><P> | |
1097 | ||
1098 | <DT><CODE>for</CODE> | |
1099 | <DD><A NAME="IDX31"></A> | |
1100 | The syntax of the <CODE>for</CODE> command is: | |
1101 | <P> | |
1102 | ||
0001803f | 1103 | <TABLE><tr><td> </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 |
1105 | in the resultant list, with <VAR>name</VAR> bound to the current member. | |
1106 | If <SAMP>`in <VAR>words</VAR>'</SAMP> is not present, the <CODE>for</CODE> command | |
1107 | executes the <VAR>commands</VAR> once for each positional parameter that is | |
1108 | set, as if <SAMP>`in "$@"'</SAMP> had been specified | |
1109 | (see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>). | |
1110 | The return status is the exit status of the last command that executes. | |
1111 | If there are no items in the expansion of <VAR>words</VAR>, no commands are | |
1112 | executed, and the return status is zero. | |
1113 | </P><P> | |
1114 | ||
1115 | An alternate form of the <CODE>for</CODE> command is also supported: | |
1116 | </P><P> | |
1117 | ||
1118 | <TABLE><tr><td> </td><td class=example><pre>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> )) ; do <VAR>commands</VAR> ; done | |
1119 | </pre></td></tr></table>First, the arithmetic expression <VAR>expr1</VAR> is evaluated according | |
1120 | to the rules described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
1121 | The arithmetic expression <VAR>expr2</VAR> is then evaluated repeatedly | |
1122 | until it evaluates to zero. | |
1123 | Each time <VAR>expr2</VAR> evaluates to a non-zero value, <VAR>commands</VAR> are | |
1124 | executed and the arithmetic expression <VAR>expr3</VAR> is evaluated. | |
1125 | If any expression is omitted, it behaves as if it evaluates to 1. | |
1126 | The return value is the exit status of the last command in <VAR>list</VAR> | |
1127 | that is executed, or false if any of the expressions is invalid. | |
1128 | </P><P> | |
1129 | ||
1130 | </DL> | |
1131 | <P> | |
1132 | ||
1133 | The <CODE>break</CODE> and <CODE>continue</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) | |
1134 | may be used to control loop execution. | |
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"> < </A>]</TD> | |
1142 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> > </A>]</TD> | |
1143 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> << </A>]</TD> | |
1144 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD> | |
1145 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> | |
1146 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1147 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1148 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1149 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> | |
1162 | The syntax of the <CODE>if</CODE> command is: | |
1163 | <P> | |
1164 | ||
1165 | <TABLE><tr><td> </td><td class=example><pre>if <VAR>test-commands</VAR>; then | |
1166 | <VAR>consequent-commands</VAR>; | |
1167 | [elif <VAR>more-test-commands</VAR>; then | |
1168 | <VAR>more-consequents</VAR>;] | |
1169 | [else <VAR>alternate-consequents</VAR>;] | |
1170 | fi | |
1171 | </pre></td></tr></table></P><P> | |
1172 | ||
1173 | The <VAR>test-commands</VAR> list is executed, and if its return status is zero, | |
1174 | the <VAR>consequent-commands</VAR> list is executed. | |
1175 | If <VAR>test-commands</VAR> returns a non-zero status, each <CODE>elif</CODE> list | |
1176 | is executed in turn, and if its exit status is zero, | |
1177 | the corresponding <VAR>more-consequents</VAR> is executed and the | |
1178 | command completes. | |
1179 | If <SAMP>`else <VAR>alternate-consequents</VAR>'</SAMP> is present, and | |
1180 | the final command in the final <CODE>if</CODE> or <CODE>elif</CODE> clause | |
1181 | has a non-zero exit status, then <VAR>alternate-consequents</VAR> is executed. | |
1182 | The return status is the exit status of the last command executed, or | |
1183 | zero if no condition tested true. | |
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> | |
1190 | The syntax of the <CODE>case</CODE> command is: | |
1191 | <P> | |
1192 | ||
1193 | <TABLE><tr><td> </td><td class=example><pre><CODE>case <VAR>word</VAR> in [ [(] <VAR>pattern</VAR> [| <VAR>pattern</VAR>]<small>...</small>) <VAR>command-list</VAR> ;;]<small>...</small> esac</CODE> | |
1194 | </pre></td></tr></table></P><P> | |
1195 | ||
1196 | <CODE>case</CODE> will selectively execute the <VAR>command-list</VAR> corresponding to | |
1197 | the first <VAR>pattern</VAR> that matches <VAR>word</VAR>. | |
1198 | If the shell option <CODE>nocasematch</CODE> | |
1199 | (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) | |
1200 | is enabled, the match is performed without regard to the case | |
1201 | of alphabetic characters. | |
1202 | The <SAMP>`|'</SAMP> is used to separate multiple patterns, and the <SAMP>`)'</SAMP> | |
1203 | operator terminates a pattern list. | |
1204 | A list of patterns and an associated command-list is known | |
1205 | as a <VAR>clause</VAR>. | |
1206 | </P><P> | |
1207 | ||
0001803f | 1208 | Each clause must be terminated with <SAMP>`;;'</SAMP>, <SAMP>`;&'</SAMP>, or <SAMP>`;;&'</SAMP>. |
17345e5a JA |
1209 | The <VAR>word</VAR> undergoes tilde expansion, parameter expansion, command |
1210 | substitution, arithmetic expansion, and quote removal before matching is | |
1211 | attempted. Each <VAR>pattern</VAR> undergoes tilde expansion, parameter | |
1212 | expansion, command substitution, and arithmetic expansion. | |
1213 | </P><P> | |
1214 | ||
1215 | There may be an arbitrary number of <CODE>case</CODE> clauses, each terminated | |
1216 | by a <SAMP>`;;'</SAMP>, <SAMP>`;&'</SAMP>, or <SAMP>`;;&'</SAMP>. | |
1217 | The first pattern that matches determines the | |
1218 | command-list that is executed. | |
1219 | </P><P> | |
1220 | ||
1221 | Here is an example using <CODE>case</CODE> in a script that could be used to | |
1222 | describe one interesting feature of an animal: | |
1223 | </P><P> | |
1224 | ||
1225 | <TABLE><tr><td> </td><td class=example><pre>echo -n "Enter the name of an animal: " | |
1226 | read ANIMAL | |
1227 | echo -n "The $ANIMAL has " | |
1228 | case $ANIMAL in | |
1229 | horse | dog | cat) echo -n "four";; | |
1230 | man | kangaroo ) echo -n "two";; | |
1231 | *) echo -n "an unknown number of";; | |
1232 | esac | |
1233 | echo " legs." | |
1234 | </pre></td></tr></table></P><P> | |
1235 | ||
1236 | </P><P> | |
1237 | ||
1238 | If the <SAMP>`;;'</SAMP> operator is used, no subsequent matches are attempted after | |
1239 | the first pattern match. | |
1240 | Using <SAMP>`;&'</SAMP> in place of <SAMP>`;;'</SAMP> causes execution to continue with | |
1241 | the <VAR>command-list</VAR> associated with the next clause, if any. | |
1242 | Using <SAMP>`;;&'</SAMP> in place of <SAMP>`;;'</SAMP> causes the shell to test the patterns | |
1243 | in the next clause, if any, and execute any associated <VAR>command-list</VAR> | |
1244 | on a successful match. | |
1245 | </P><P> | |
1246 | ||
1247 | The return status is zero if no <VAR>pattern</VAR> is matched. Otherwise, the | |
1248 | return status is the exit status of the <VAR>command-list</VAR> executed. | |
1249 | </P><P> | |
1250 | ||
1251 | <DT><CODE>select</CODE> | |
1252 | <DD><A NAME="IDX40"></A> | |
1253 | <P> | |
1254 | ||
1255 | The <CODE>select</CODE> construct allows the easy generation of menus. | |
1256 | It has almost the same syntax as the <CODE>for</CODE> command: | |
1257 | </P><P> | |
1258 | ||
1259 | <TABLE><tr><td> </td><td class=example><pre>select <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done | |
1260 | </pre></td></tr></table></P><P> | |
1261 | ||
1262 | The list of words following <CODE>in</CODE> is expanded, generating a list | |
1263 | of items. The set of expanded words is printed on the standard | |
1264 | error output stream, each preceded by a number. If the | |
1265 | <SAMP>`in <VAR>words</VAR>'</SAMP> is omitted, the positional parameters are printed, | |
1266 | as if <SAMP>`in "$@"'</SAMP> had been specified. | |
1267 | The <CODE>PS3</CODE> prompt is then displayed and a line is read from the | |
1268 | standard input. | |
1269 | If the line consists of a number corresponding to one of the displayed | |
1270 | words, then the value of <VAR>name</VAR> is set to that word. | |
1271 | If the line is empty, the words and prompt are displayed again. | |
1272 | If <CODE>EOF</CODE> is read, the <CODE>select</CODE> command completes. | |
1273 | Any other value read causes <VAR>name</VAR> to be set to null. | |
1274 | The line read is saved in the variable <CODE>REPLY</CODE>. | |
1275 | </P><P> | |
1276 | ||
1277 | The <VAR>commands</VAR> are executed after each selection until a | |
1278 | <CODE>break</CODE> command is executed, at which | |
1279 | point the <CODE>select</CODE> command completes. | |
1280 | </P><P> | |
1281 | ||
1282 | Here is an example that allows the user to pick a filename from the | |
1283 | current directory, and displays the name and index of the file | |
1284 | selected. | |
1285 | </P><P> | |
1286 | ||
1287 | <TABLE><tr><td> </td><td class=example><pre>select fname in *; | |
1288 | do | |
1289 | echo you picked $fname \($REPLY\) | |
1290 | break; | |
1291 | done | |
1292 | </pre></td></tr></table></P><P> | |
1293 | ||
1294 | <DT><CODE>((<small>...</small>))</CODE> | |
1295 | <DD><TABLE><tr><td> </td><td class=example><pre>(( <VAR>expression</VAR> )) | |
1296 | </pre></td></tr></table><P> | |
1297 | ||
1298 | The arithmetic <VAR>expression</VAR> is evaluated according to the rules | |
1299 | described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
1300 | If the value of the expression is non-zero, the return status is 0; | |
1301 | otherwise the return status is 1. This is exactly equivalent to | |
1302 | <TABLE><tr><td> </td><td class=example><pre>let "<VAR>expression</VAR>" | |
1303 | </pre></td></tr></table>See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a full description of the <CODE>let</CODE> builtin. | |
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> </td><td class=example><pre>[[ <VAR>expression</VAR> ]] | |
1310 | </pre></td></tr></table><P> | |
1311 | ||
1312 | Return a status of 0 or 1 depending on the evaluation of | |
1313 | the conditional expression <VAR>expression</VAR>. | |
1314 | Expressions are composed of the primaries described below in | |
1315 | <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>. | |
1316 | Word splitting and filename expansion are not performed on the words | |
1317 | between the <SAMP>`[['</SAMP> and <SAMP>`]]'</SAMP>; tilde expansion, parameter and | |
1318 | variable expansion, arithmetic expansion, command substitution, process | |
1319 | substitution, and quote removal are performed. | |
1320 | Conditional operators such as <SAMP>`-f'</SAMP> must be unquoted to be recognized | |
1321 | as primaries. | |
1322 | </P><P> | |
1323 | ||
0001803f CR |
1324 | When used with <SAMP>`[['</SAMP>, The <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP> operators sort |
1325 | lexicographically using the current locale. | |
1326 | </P><P> | |
1327 | ||
17345e5a JA |
1328 | When the <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP> operators are used, the string to the |
1329 | right of the operator is considered a pattern and matched according | |
1330 | to the rules described below in <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>. | |
1331 | If the shell option <CODE>nocasematch</CODE> | |
1332 | (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) | |
1333 | is enabled, the match is performed without regard to the case | |
1334 | of alphabetic characters. | |
1335 | The return value is 0 if the string matches (<SAMP>`=='</SAMP>) or does not | |
1336 | match (<SAMP>`!='</SAMP>)the pattern, and 1 otherwise. | |
1337 | Any part of the pattern may be quoted to force it to be matched as a | |
1338 | string. | |
1339 | </P><P> | |
1340 | ||
1341 | An additional binary operator, <SAMP>`=~'</SAMP>, is available, with the same | |
1342 | precedence as <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP>. | |
1343 | When it is used, the string to the right of the operator is considered | |
1344 | an extended regular expression and matched accordingly (as in <I>regex</I>3)). | |
1345 | The return value is 0 if the string matches | |
1346 | the pattern, and 1 otherwise. | |
1347 | If the regular expression is syntactically incorrect, the conditional | |
1348 | expression's return value is 2. | |
1349 | If the shell option <CODE>nocasematch</CODE> | |
1350 | (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) | |
1351 | is enabled, the match is performed without regard to the case | |
1352 | of alphabetic characters. | |
1353 | Any part of the pattern may be quoted to force it to be matched as a | |
1354 | string. | |
1355 | Substrings matched by parenthesized subexpressions within the regular | |
1356 | expression are saved in the array variable <CODE>BASH_REMATCH</CODE>. | |
1357 | The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string | |
1358 | matching the entire regular expression. | |
1359 | The element of <CODE>BASH_REMATCH</CODE> with index <VAR>n</VAR> is the portion of the | |
1360 | string matching the <VAR>n</VAR>th parenthesized subexpression. | |
1361 | </P><P> | |
1362 | ||
1363 | Expressions may be combined using the following operators, listed | |
1364 | in 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>. | |
1370 | This 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> && <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> | |
1384 | The <CODE>&&</CODE> and <CODE>||</CODE> operators do not evaluate <VAR>expression2</VAR> if the | |
1385 | value of <VAR>expression1</VAR> is sufficient to determine the return | |
1386 | value of the entire conditional expression. | |
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"> < </A>]</TD> | |
1397 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> > </A>]</TD> | |
1398 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> | |
1399 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD> | |
1400 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> | |
1401 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1402 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1403 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1404 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1405 | </TR></TABLE> | |
1406 | <H4> 3.2.4.3 Grouping Commands </H4> | |
1407 | <!--docid::SEC22::--> | |
1408 | <P> | |
1409 | ||
1410 | Bash provides two ways to group a list of commands to be executed | |
1411 | as a unit. When commands are grouped, redirections may be applied | |
1412 | to the entire command list. For example, the output of all the | |
1413 | commands in the list may be redirected to a single stream. | |
1414 | </P><P> | |
1415 | ||
1416 | <DL COMPACT> | |
1417 | <DT><CODE>()</CODE> | |
1418 | <DD><TABLE><tr><td> </td><td class=example><pre>( <VAR>list</VAR> ) | |
1419 | </pre></td></tr></table><P> | |
1420 | ||
1421 | Placing a list of commands between parentheses causes a subshell | |
1422 | environment to be created (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>), and each | |
1423 | of the commands in <VAR>list</VAR> to be executed in that subshell. Since the | |
1424 | <VAR>list</VAR> is executed in a subshell, variable assignments do not remain in | |
1425 | effect after the subshell completes. | |
1426 | </P><P> | |
1427 | ||
1428 | <DT><CODE>{}</CODE> | |
1429 | <DD><A NAME="IDX43"></A> | |
1430 | <A NAME="IDX44"></A> | |
1431 | <TABLE><tr><td> </td><td class=example><pre>{ <VAR>list</VAR>; } | |
1432 | </pre></td></tr></table><P> | |
1433 | ||
1434 | Placing a list of commands between curly braces causes the list to | |
1435 | be executed in the current shell context. No subshell is created. | |
1436 | The semicolon (or newline) following <VAR>list</VAR> is required. | |
1437 | </DL> | |
1438 | <P> | |
1439 | ||
1440 | In addition to the creation of a subshell, there is a subtle difference | |
1441 | between these two constructs due to historical reasons. The braces | |
1442 | are <CODE>reserved words</CODE>, so they must be separated from the <VAR>list</VAR> | |
1443 | by <CODE>blank</CODE>s or other shell metacharacters. | |
1444 | The parentheses are <CODE>operators</CODE>, and are | |
1445 | recognized as separate tokens by the shell even if they are not separated | |
1446 | from the <VAR>list</VAR> by whitespace. | |
1447 | </P><P> | |
1448 | ||
1449 | The 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"> < </A>]</TD> | |
1458 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> > </A>]</TD> | |
1459 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD> | |
1460 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
1461 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
1462 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1463 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1464 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1465 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1466 | </TR></TABLE> | |
1467 | <H3> 3.2.5 Coprocesses </H3> | |
1468 | <!--docid::SEC23::--> | |
1469 | <P> | |
1470 | ||
1471 | A <CODE>coprocess</CODE> is a shell command preceded by the <CODE>coproc</CODE> | |
1472 | reserved word. | |
1473 | A coprocess is executed asynchronously in a subshell, as if the command | |
1474 | had been terminated with the <SAMP>`&'</SAMP> control operator, with a two-way pipe | |
1475 | established between the executing shell and the coprocess. | |
1476 | </P><P> | |
1477 | ||
1478 | The format for a coprocess is: | |
1479 | <TABLE><tr><td> </td><td class=example><pre><CODE>coproc</CODE> [<VAR>NAME</VAR>] <VAR>command</VAR> [<VAR>redirections</VAR>] | |
1480 | </pre></td></tr></table></P><P> | |
1481 | ||
1482 | This creates a coprocess named <VAR>NAME</VAR>. | |
1483 | If <VAR>NAME</VAR> is not supplied, the default name is <VAR>COPROC</VAR>. | |
1484 | <VAR>NAME</VAR> must not be supplied if <VAR>command</VAR> is a simple | |
1485 | command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>); otherwise, it is interpreted as | |
1486 | the first word of the simple command. | |
1487 | </P><P> | |
1488 | ||
1489 | When the coproc is executed, the shell creates an array variable | |
1490 | (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>) | |
1491 | named <VAR>NAME</VAR> in the context of the executing shell. | |
1492 | The standard output of <VAR>command</VAR> | |
1493 | is connected via a pipe to a file descriptor in the executing shell, | |
1494 | and that file descriptor is assigned to <VAR>NAME</VAR>[0]. | |
1495 | The standard input of <VAR>command</VAR> | |
1496 | is connected via a pipe to a file descriptor in the executing shell, | |
1497 | and that file descriptor is assigned to <VAR>NAME</VAR>[1]. | |
1498 | This pipe is established before any redirections specified by the | |
1499 | command (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
1500 | The file descriptors can be utilized as arguments to shell commands | |
1501 | and redirections using standard word expansions. | |
1502 | </P><P> | |
1503 | ||
1504 | The process id of the shell spawned to execute the coprocess is | |
1505 | available as the value of the variable <VAR>NAME</VAR>_PID. | |
1506 | The <CODE>wait</CODE> | |
1507 | builtin command may be used to wait for the coprocess to terminate. | |
1508 | </P><P> | |
1509 | ||
1510 | The 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"> < </A>]</TD> | |
1518 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> > </A>]</TD> | |
1519 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> << </A>]</TD> | |
1520 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
1521 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD> | |
1522 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1523 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1524 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1525 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1526 | </TR></TABLE> | |
1527 | <H2> 3.3 Shell Functions </H2> | |
1528 | <!--docid::SEC24::--> | |
1529 | <P> | |
1530 | ||
1531 | Shell functions are a way to group commands for later execution | |
1532 | using a single name for the group. They are executed just like | |
1533 | a "regular" command. | |
1534 | When the name of a shell function is used as a simple command name, | |
1535 | the list of commands associated with that function name is executed. | |
1536 | Shell functions are executed in the current | |
1537 | shell context; no new process is created to interpret them. | |
1538 | </P><P> | |
1539 | ||
1540 | Functions are declared using this syntax: | |
1541 | <A NAME="IDX45"></A> | |
1542 | <TABLE><tr><td> </td><td class=example><pre>[ <CODE>function</CODE> ] <VAR>name</VAR> () <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ] | |
1543 | </pre></td></tr></table></P><P> | |
1544 | ||
1545 | This defines a shell function named <VAR>name</VAR>. The reserved | |
1546 | word <CODE>function</CODE> is optional. | |
1547 | If the <CODE>function</CODE> reserved | |
1548 | word is supplied, the parentheses are optional. | |
1549 | The <VAR>body</VAR> of the function is the compound command | |
1550 | <VAR>compound-command</VAR> (see section <A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>). | |
1551 | That command is usually a <VAR>list</VAR> enclosed between { and }, but | |
1552 | may be any compound command listed above. | |
1553 | <VAR>compound-command</VAR> is executed whenever <VAR>name</VAR> is specified as the | |
1554 | name of a command. | |
1555 | Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with the shell function | |
1556 | are performed when the function is executed. | |
1557 | </P><P> | |
1558 | ||
1559 | A function definition may be deleted using the <SAMP>`-f'</SAMP> option to the | |
1560 | <CODE>unset</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
1561 | </P><P> | |
1562 | ||
1563 | The exit status of a function definition is zero unless a syntax error | |
1564 | occurs or a readonly function with the same name already exists. | |
1565 | When executed, the exit status of a function is the exit status of the | |
1566 | last command executed in the body. | |
1567 | </P><P> | |
1568 | ||
1569 | Note that for historical reasons, in the most common usage the curly braces | |
1570 | that surround the body of the function must be separated from the body by | |
1571 | <CODE>blank</CODE>s or newlines. | |
1572 | This is because the braces are reserved words and are only recognized | |
1573 | as such when they are separated from the command list | |
1574 | by whitespace or another shell metacharacter. | |
1575 | Also, when using the braces, the <VAR>list</VAR> must be terminated by a semicolon, | |
1576 | a <SAMP>`&'</SAMP>, or a newline. | |
1577 | </P><P> | |
1578 | ||
1579 | When a function is executed, the arguments to the | |
1580 | function become the positional parameters | |
1581 | during its execution (see section <A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A>). | |
1582 | The special parameter <SAMP>`#'</SAMP> that expands to the number of | |
1583 | positional parameters is updated to reflect the change. | |
1584 | Special parameter <CODE>0</CODE> is unchanged. | |
1585 | The first element of the <CODE>FUNCNAME</CODE> variable is set to the | |
1586 | name of the function while the function is executing. | |
0001803f CR |
1587 | </P><P> |
1588 | ||
17345e5a JA |
1589 | All other aspects of the shell execution |
1590 | environment are identical between a function and its caller | |
0001803f CR |
1591 | with these exceptions: |
1592 | the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps | |
17345e5a JA |
1593 | are not inherited unless the function has been given the |
1594 | <CODE>trace</CODE> attribute using the <CODE>declare</CODE> builtin or | |
1595 | the <CODE>-o functrace</CODE> option has been enabled with | |
1596 | the <CODE>set</CODE> builtin, | |
0001803f CR |
1597 | (in which case all functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps), |
1598 | and the <CODE>ERR</CODE> trap is not inherited unless the <CODE>-o errtrace</CODE> | |
1599 | shell option has been enabled. | |
17345e5a JA |
1600 | See 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 | ||
1604 | If the builtin command <CODE>return</CODE> | |
1605 | is executed in a function, the function completes and | |
1606 | execution resumes with the next command after the function | |
1607 | call. | |
1608 | Any command associated with the <CODE>RETURN</CODE> trap is executed | |
1609 | before execution resumes. | |
1610 | When a function completes, the values of the | |
1611 | positional parameters and the special parameter <SAMP>`#'</SAMP> | |
1612 | are restored to the values they had prior to the function's | |
1613 | execution. If a numeric argument is given to <CODE>return</CODE>, | |
1614 | that is the function's return status; otherwise the function's | |
1615 | return status is the exit status of the last command executed | |
1616 | before the <CODE>return</CODE>. | |
1617 | </P><P> | |
1618 | ||
1619 | Variables local to the function may be declared with the | |
1620 | <CODE>local</CODE> builtin. These variables are visible only to | |
1621 | the function and the commands it invokes. | |
1622 | </P><P> | |
1623 | ||
1624 | Function names and definitions may be listed with the | |
1625 | <SAMP>`-f'</SAMP> option to the <CODE>declare</CODE> or <CODE>typeset</CODE> | |
1626 | builtin commands (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
1627 | The <SAMP>`-F'</SAMP> option to <CODE>declare</CODE> or <CODE>typeset</CODE> | |
1628 | will list the function names only | |
1629 | (and optionally the source file and line number, if the <CODE>extdebug</CODE> | |
1630 | shell option is enabled). | |
1631 | Functions may be exported so that subshells | |
1632 | automatically have them defined with the | |
1633 | <SAMP>`-f'</SAMP> option to the <CODE>export</CODE> builtin | |
1634 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
1635 | Note that shell functions and variables with the same name may result | |
1636 | in multiple identically-named entries in the environment passed to the | |
1637 | shell's children. | |
1638 | Care should be taken in cases where this may cause a problem. | |
1639 | </P><P> | |
1640 | ||
1641 | Functions may be recursive. No limit is placed on the number of | |
1642 | recursive 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"> < </A>]</TD> | |
1650 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> > </A>]</TD> | |
1651 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> << </A>]</TD> | |
1652 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
1653 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> >> </A>]</TD> | |
1654 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1655 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1656 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1657 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">The shell's command-line arguments.</TD></TR> | |
1665 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Parameters denoted by special characters.</TD></TR> | |
1666 | </TABLE></BLOCKQUOTE> | |
1667 | <P> | |
1668 | ||
1669 | A <VAR>parameter</VAR> is an entity that stores values. | |
1670 | It can be a <CODE>name</CODE>, a number, or one of the special characters | |
1671 | listed below. | |
1672 | A <VAR>variable</VAR> is a parameter denoted by a <CODE>name</CODE>. | |
1673 | A variable has a <VAR>value</VAR> and zero or more <VAR>attributes</VAR>. | |
1674 | Attributes are assigned using the <CODE>declare</CODE> builtin command | |
1675 | (see the description of the <CODE>declare</CODE> builtin in <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
1676 | </P><P> | |
1677 | ||
1678 | A parameter is set if it has been assigned a value. The null string is | |
1679 | a valid value. Once a variable is set, it may be unset only by using | |
1680 | the <CODE>unset</CODE> builtin command. | |
1681 | </P><P> | |
1682 | ||
1683 | A variable may be assigned to by a statement of the form | |
1684 | <TABLE><tr><td> </td><td class=example><pre><VAR>name</VAR>=[<VAR>value</VAR>] | |
1685 | </pre></td></tr></table>If <VAR>value</VAR> | |
1686 | is not given, the variable is assigned the null string. All | |
1687 | <VAR>value</VAR>s undergo tilde expansion, parameter and variable expansion, | |
1688 | command substitution, arithmetic expansion, and quote | |
1689 | removal (detailed below). If the variable has its <CODE>integer</CODE> | |
1690 | attribute set, then <VAR>value</VAR> | |
1691 | is evaluated as an arithmetic expression even if the <CODE>$((<small>...</small>))</CODE> | |
1692 | expansion is not used (see section <A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A>). | |
1693 | Word splitting is not performed, with the exception | |
1694 | of <CODE>"$@"</CODE> as explained below. | |
1695 | Filename expansion is not performed. | |
1696 | Assignment statements may also appear as arguments to the | |
1697 | <CODE>alias</CODE>, | |
1698 | <CODE>declare</CODE>, <CODE>typeset</CODE>, <CODE>export</CODE>, <CODE>readonly</CODE>, | |
1699 | and <CODE>local</CODE> builtin commands. | |
1700 | </P><P> | |
1701 | ||
1702 | In the context where an assignment statement is assigning a value | |
1703 | to a shell variable or array index (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the <SAMP>`+='</SAMP> | |
1704 | operator can be used to | |
1705 | append to or add to the variable's previous value. | |
1706 | When <SAMP>`+='</SAMP> is applied to a variable for which the integer attribute | |
1707 | has been set, <VAR>value</VAR> is evaluated as an arithmetic expression and | |
1708 | added to the variable's current value, which is also evaluated. | |
1709 | When <SAMP>`+='</SAMP> is applied to an array variable using compound assignment | |
1710 | (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the | |
1711 | variable's value is not unset (as it is when using <SAMP>`='</SAMP>), and new | |
1712 | values are appended to the array beginning at one greater than the array's | |
1713 | maximum index (for indexed arrays), or added as additional key-value pairs | |
1714 | in an associative array. | |
1715 | When applied to a string-valued variable, <VAR>value</VAR> is expanded and | |
1716 | appended to the variable's value. | |
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"> < </A>]</TD> | |
1724 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> > </A>]</TD> | |
1725 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> << </A>]</TD> | |
1726 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD> | |
1727 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> >> </A>]</TD> | |
1728 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1729 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1730 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1731 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1732 | </TR></TABLE> | |
1733 | <H3> 3.4.1 Positional Parameters </H3> | |
1734 | <!--docid::SEC26::--> | |
1735 | <P> | |
1736 | ||
1737 | A <VAR>positional parameter</VAR> is a parameter denoted by one or more | |
1738 | digits, other than the single digit <CODE>0</CODE>. Positional parameters are | |
1739 | assigned from the shell's arguments when it is invoked, | |
1740 | and may be reassigned using the <CODE>set</CODE> builtin command. | |
1741 | Positional parameter <CODE>N</CODE> may be referenced as <CODE>${N}</CODE>, or | |
1742 | as <CODE>$N</CODE> when <CODE>N</CODE> consists of a single digit. | |
1743 | Positional parameters may not be assigned to with assignment statements. | |
1744 | The <CODE>set</CODE> and <CODE>shift</CODE> builtins are used to set and | |
1745 | unset them (see section <A HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>). | |
1746 | The positional parameters are | |
1747 | temporarily replaced when a shell function is executed | |
1748 | (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>). | |
1749 | </P><P> | |
1750 | ||
1751 | When a positional parameter consisting of more than a single | |
1752 | digit 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"> < </A>]</TD> | |
1760 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> > </A>]</TD> | |
1761 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> << </A>]</TD> | |
1762 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD> | |
1763 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> >> </A>]</TD> | |
1764 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1765 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1766 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1767 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1768 | </TR></TABLE> | |
1769 | <H3> 3.4.2 Special Parameters </H3> | |
1770 | <!--docid::SEC27::--> | |
1771 | <P> | |
1772 | ||
1773 | The shell treats several parameters specially. These parameters may | |
1774 | only 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> | |
1782 | Expands to the positional parameters, starting from one. When the | |
1783 | expansion occurs within double quotes, it expands to a single word | |
1784 | with the value of each parameter separated by the first character | |
1785 | of the <CODE>IFS</CODE> | |
1786 | special variable. That is, <CODE>"$*"</CODE> is equivalent | |
1787 | to <CODE>"$1<VAR>c</VAR>$2<VAR>c</VAR><small>...</small>"</CODE>, where <VAR>c</VAR> | |
1788 | is the first character of the value of the <CODE>IFS</CODE> | |
1789 | variable. | |
1790 | If <CODE>IFS</CODE> is unset, the parameters are separated by spaces. | |
1791 | If <CODE>IFS</CODE> is null, the parameters are joined without intervening | |
1792 | separators. | |
1793 | <P> | |
1794 | ||
1795 | <A NAME="IDX48"></A> | |
1796 | <DT><CODE>@</CODE> | |
1797 | <DD><A NAME="IDX49"></A> | |
1798 | Expands to the positional parameters, starting from one. When the | |
1799 | expansion occurs within double quotes, each parameter expands to a | |
1800 | separate word. That is, <CODE>"$@"</CODE> is equivalent to | |
1801 | <CODE>"$1" "$2" <small>...</small></CODE>. | |
1802 | If the double-quoted expansion occurs within a word, the expansion of | |
1803 | the first parameter is joined with the beginning part of the original | |
1804 | word, and the expansion of the last parameter is joined with the last | |
1805 | part of the original word. | |
1806 | When there are no positional parameters, <CODE>"$@"</CODE> and | |
1807 | <CODE>$@</CODE> | |
1808 | expand 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> | |
1814 | Expands 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> | |
1820 | Expands to the exit status of the most recently executed foreground | |
1821 | pipeline. | |
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 | |
1828 | invocation, by the <CODE>set</CODE> | |
1829 | builtin command, or those set by the shell itself | |
1830 | (such as the <SAMP>`-i'</SAMP> option). | |
1831 | <P> | |
1832 | ||
1833 | <A NAME="IDX56"></A> | |
1834 | <DT><CODE>$</CODE> | |
1835 | <DD><A NAME="IDX57"></A> | |
1836 | Expands to the process ID of the shell. In a <CODE>()</CODE> subshell, it | |
1837 | expands to the process ID of the invoking shell, not the subshell. | |
1838 | <P> | |
1839 | ||
1840 | <A NAME="IDX58"></A> | |
1841 | <DT><CODE>!</CODE> | |
1842 | <DD><A NAME="IDX59"></A> | |
1843 | Expands 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> | |
1850 | Expands to the name of the shell or shell script. This is set at | |
1851 | shell initialization. If Bash is invoked with a file of commands | |
1852 | (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>$0</CODE> is set to the name of that file. | |
1853 | If Bash is started with the <SAMP>`-c'</SAMP> option (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>), | |
1854 | then <CODE>$0</CODE> is set to the first argument after the string to be | |
1855 | executed, if one is present. Otherwise, it is set | |
1856 | to the filename used to invoke Bash, as given by argument zero. | |
1857 | <P> | |
1858 | ||
1859 | <A NAME="IDX62"></A> | |
1860 | <DT><CODE>_</CODE> | |
1861 | <DD><A NAME="IDX63"></A> | |
1862 | (An underscore.) | |
1863 | At shell startup, set to the absolute pathname used to invoke the | |
1864 | shell or shell script being executed as passed in the environment | |
1865 | or argument list. | |
1866 | Subsequently, expands to the last argument to the previous command, | |
1867 | after expansion. | |
1868 | Also set to the full pathname used to invoke each command executed | |
1869 | and placed in the environment exported to that command. | |
1870 | When checking mail, this parameter holds the name of the mail file. | |
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"> < </A>]</TD> | |
1879 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> > </A>]</TD> | |
1880 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD> | |
1881 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
1882 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
1883 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1884 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1885 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1886 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1887 | </TR></TABLE> | |
1888 | <H2> 3.5 Shell Expansions </H2> | |
1889 | <!--docid::SEC28::--> | |
1890 | <P> | |
1891 | ||
1892 | Expansion is performed on the command line after it has been split into | |
1893 | <CODE>token</CODE>s. There are seven kinds of expansion performed: | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of expressions within braces.</TD></TR> | |
1907 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of the ~ character.</TD></TR> | |
1908 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands variables to their values.</TD></TR> | |
1909 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Using the output of a command as an argument.</TD></TR> | |
1910 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to use arithmetic in shell expansions.</TD></TR> | |
1911 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A way to write and read to and from a | |
1912 | command.</TD></TR> | |
1913 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the results of expansion are split into separate | |
1914 | arguments.</TD></TR> | |
1915 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A shorthand for specifying filenames matching patterns.</TD></TR> | |
1916 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC38">3.5.9 Quote Removal</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How and when quote characters are removed from | |
1917 | words.</TD></TR> | |
1918 | </TABLE></BLOCKQUOTE> | |
1919 | <P> | |
1920 | ||
1921 | The order of expansions is: brace expansion, tilde expansion, | |
1922 | parameter, variable, and arithmetic expansion and | |
1923 | command substitution | |
1924 | (done in a left-to-right fashion), word splitting, and filename | |
1925 | expansion. | |
1926 | </P><P> | |
1927 | ||
1928 | On systems that can support it, there is an additional expansion | |
1929 | available: <VAR>process substitution</VAR>. This is performed at the | |
1930 | same time as parameter, variable, and arithmetic expansion and | |
1931 | command substitution. | |
1932 | </P><P> | |
1933 | ||
1934 | Only brace expansion, word splitting, and filename expansion | |
1935 | can change the number of words of the expansion; other expansions | |
1936 | expand a single word to a single word. | |
1937 | The only exceptions to this are the expansions of | |
1938 | <CODE>"$@"</CODE> (see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>) and <CODE>"${<VAR>name</VAR>[@]}"</CODE> | |
1939 | (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>). | |
1940 | </P><P> | |
1941 | ||
1942 | After all expansions, <CODE>quote removal</CODE> (see section <A HREF="bashref.html#SEC38">3.5.9 Quote Removal</A>) | |
1943 | is 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"> < </A>]</TD> | |
1951 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> > </A>]</TD> | |
1952 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD> | |
1953 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
1954 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
1955 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1956 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1957 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1958 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1959 | </TR></TABLE> | |
1960 | <H3> 3.5.1 Brace Expansion </H3> | |
1961 | <!--docid::SEC29::--> | |
1962 | <P> | |
1963 | ||
1964 | Brace expansion is a mechanism by which arbitrary strings may be generated. | |
1965 | This mechanism is similar to | |
1966 | <VAR>filename expansion</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>), | |
1967 | but the file names generated need not exist. | |
1968 | Patterns to be brace expanded take the form of an optional <VAR>preamble</VAR>, | |
1969 | followed by either a series of comma-separated strings or a seqeunce expression | |
1970 | between a pair of braces, | |
1971 | followed by an optional <VAR>postscript</VAR>. | |
1972 | The preamble is prefixed to each string contained within the braces, and | |
1973 | the postscript is then appended to each resulting string, expanding left | |
1974 | to right. | |
1975 | </P><P> | |
1976 | ||
1977 | Brace expansions may be nested. | |
1978 | The results of each expanded string are not sorted; left to right order | |
1979 | is preserved. | |
1980 | For example, | |
1981 | <TABLE><tr><td> </td><td class=example><pre>bash$ echo a{d,c,b}e | |
1982 | ade ace abe | |
1983 | </pre></td></tr></table></P><P> | |
1984 | ||
0001803f | 1985 | A sequence expression takes the form <CODE>{<VAR>x</VAR>..<VAR>y</VAR>[..<VAR>incr</VAR>]}</CODE>, |
17345e5a JA |
1986 | where <VAR>x</VAR> and <VAR>y</VAR> are either integers or single characters, |
1987 | and <VAR>incr</VAR>, an optional increment, is an integer. | |
1988 | When integers are supplied, the expression expands to each number between | |
1989 | <VAR>x</VAR> and <VAR>y</VAR>, inclusive. | |
1990 | Supplied integers may be prefixed with <SAMP>`0'</SAMP> to force each term to have the | |
1991 | same width. When either <VAR>x</VAR> or <VAR>y</VAR> begins with a zero, the shell | |
1992 | attempts to force all generated terms to contain the same number of digits, | |
1993 | zero-padding where necessary. | |
1994 | When characters are supplied, the expression expands to each character | |
1995 | lexicographically between <VAR>x</VAR> and <VAR>y</VAR>, inclusive. Note that | |
1996 | both <VAR>x</VAR> and <VAR>y</VAR> must be of the same type. | |
1997 | When the increment is supplied, it is used as the difference between | |
1998 | each term. The default increment is 1 or -1 as appropriate. | |
1999 | </P><P> | |
2000 | ||
2001 | Brace expansion is performed before any other expansions, | |
2002 | and any characters special to other expansions are preserved | |
2003 | in the result. It is strictly textual. Bash | |
2004 | does not apply any syntactic interpretation to the context of the | |
2005 | expansion or the text between the braces. | |
2006 | To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP> | |
2007 | is not considered eligible for brace expansion. | |
2008 | </P><P> | |
2009 | ||
2010 | A correctly-formed brace expansion must contain unquoted opening | |
2011 | and closing braces, and at least one unquoted comma or a valid | |
2012 | sequence expression. | |
2013 | Any incorrectly formed brace expansion is left unchanged. | |
2014 | </P><P> | |
2015 | ||
2016 | A { or <SAMP>`,'</SAMP> may be quoted with a backslash to prevent its | |
2017 | being considered part of a brace expression. | |
2018 | To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP> | |
2019 | is not considered eligible for brace expansion. | |
2020 | </P><P> | |
2021 | ||
2022 | This construct is typically used as shorthand when the common | |
2023 | prefix of the strings to be generated is longer than in the | |
2024 | above example: | |
2025 | <TABLE><tr><td> </td><td class=example><pre>mkdir /usr/local/src/bash/{old,new,dist,bugs} | |
2026 | </pre></td></tr></table>or | |
2027 | <TABLE><tr><td> </td><td class=example><pre>chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} | |
2028 | </pre></td></tr></table></P><P> | |
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"> < </A>]</TD> | |
2035 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> > </A>]</TD> | |
2036 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> << </A>]</TD> | |
2037 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2038 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2039 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2040 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2041 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2042 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2043 | </TR></TABLE> | |
2044 | <H3> 3.5.2 Tilde Expansion </H3> | |
2045 | <!--docid::SEC30::--> | |
2046 | <P> | |
2047 | ||
2048 | If a word begins with an unquoted tilde character (<SAMP>`~'</SAMP>), all of the | |
2049 | characters up to the first unquoted slash (or all characters, | |
2050 | if there is no unquoted slash) are considered a <VAR>tilde-prefix</VAR>. | |
2051 | If none of the characters in the tilde-prefix are quoted, the | |
2052 | characters in the tilde-prefix following the tilde are treated as a | |
2053 | possible <VAR>login name</VAR>. | |
2054 | If this login name is the null string, the tilde is replaced with the | |
2055 | value of the <CODE>HOME</CODE> shell variable. | |
2056 | If <CODE>HOME</CODE> is unset, the home directory of the user executing the | |
2057 | shell is substituted instead. | |
2058 | Otherwise, the tilde-prefix is replaced with the home directory | |
2059 | associated with the specified login name. | |
2060 | </P><P> | |
2061 | ||
2062 | If the tilde-prefix is <SAMP>`~+'</SAMP>, the value of | |
2063 | the shell variable <CODE>PWD</CODE> replaces the tilde-prefix. | |
2064 | If the tilde-prefix is <SAMP>`~-'</SAMP>, the value of the shell variable | |
2065 | <CODE>OLDPWD</CODE>, if it is set, is substituted. | |
2066 | </P><P> | |
2067 | ||
2068 | If the characters following the tilde in the tilde-prefix consist of a | |
2069 | number <VAR>N</VAR>, optionally prefixed by a <SAMP>`+'</SAMP> or a <SAMP>`-'</SAMP>, | |
2070 | the tilde-prefix is replaced with the | |
2071 | corresponding element from the directory stack, as it would be displayed | |
2072 | by the <CODE>dirs</CODE> builtin invoked with the characters following tilde | |
2073 | in the tilde-prefix as an argument (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>). | |
2074 | If the tilde-prefix, sans the tilde, consists of a number without a | |
2075 | leading <SAMP>`+'</SAMP> or <SAMP>`-'</SAMP>, <SAMP>`+'</SAMP> is assumed. | |
2076 | </P><P> | |
2077 | ||
2078 | If the login name is invalid, or the tilde expansion fails, the word is | |
2079 | left unchanged. | |
2080 | </P><P> | |
2081 | ||
2082 | Each variable assignment is checked for unquoted tilde-prefixes immediately | |
2083 | following a <SAMP>`:'</SAMP> or the first <SAMP>`='</SAMP>. | |
2084 | In these cases, tilde expansion is also performed. | |
2085 | Consequently, one may use file names with tildes in assignments to | |
2086 | <CODE>PATH</CODE>, <CODE>MAILPATH</CODE>, and <CODE>CDPATH</CODE>, | |
2087 | and the shell assigns the expanded value. | |
2088 | </P><P> | |
2089 | ||
2090 | The 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"> < </A>]</TD> | |
2133 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> > </A>]</TD> | |
2134 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> << </A>]</TD> | |
2135 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2136 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2137 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2138 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2139 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2140 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2141 | </TR></TABLE> | |
2142 | <H3> 3.5.3 Shell Parameter Expansion </H3> | |
2143 | <!--docid::SEC31::--> | |
2144 | <P> | |
2145 | ||
2146 | The <SAMP>`$'</SAMP> character introduces parameter expansion, | |
2147 | command substitution, or arithmetic expansion. The parameter name | |
2148 | or symbol to be expanded may be enclosed in braces, which | |
2149 | are optional but serve to protect the variable to be expanded from | |
2150 | characters immediately following it which could be | |
2151 | interpreted as part of the name. | |
2152 | </P><P> | |
2153 | ||
2154 | When braces are used, the matching ending brace is the first <SAMP>`}'</SAMP> | |
2155 | not escaped by a backslash or within a quoted string, and not within an | |
2156 | embedded arithmetic expansion, command substitution, or parameter | |
2157 | expansion. | |
2158 | </P><P> | |
2159 | ||
2160 | The basic form of parameter expansion is ${<VAR>parameter</VAR>}. | |
2161 | The value of <VAR>parameter</VAR> is substituted. The braces are required | |
2162 | when <VAR>parameter</VAR> | |
2163 | is a positional parameter with more than one digit, | |
2164 | or when <VAR>parameter</VAR> | |
2165 | is followed by a character that is not to be | |
2166 | interpreted as part of its name. | |
2167 | </P><P> | |
2168 | ||
0001803f | 2169 | If the first character of <VAR>parameter</VAR> is an exclamation point (!), |
17345e5a JA |
2170 | a level of variable indirection is introduced. |
2171 | Bash uses the value of the variable formed from the rest of | |
2172 | <VAR>parameter</VAR> as the name of the variable; this variable is then | |
2173 | expanded and that value is used in the rest of the substitution, rather | |
2174 | than the value of <VAR>parameter</VAR> itself. | |
2175 | This is known as <CODE>indirect expansion</CODE>. | |
2176 | The exceptions to this are the expansions of ${!<VAR>prefix*</VAR>} | |
2177 | and ${!<VAR>name</VAR>[@]} | |
2178 | described below. | |
2179 | The exclamation point must immediately follow the left brace in order to | |
2180 | introduce indirection. | |
2181 | </P><P> | |
2182 | ||
2183 | In each of the cases below, <VAR>word</VAR> is subject to tilde expansion, | |
2184 | parameter expansion, command substitution, and arithmetic expansion. | |
2185 | </P><P> | |
2186 | ||
2187 | When not performing substring expansion, using the form described | |
2188 | below, Bash tests for a parameter that is unset or null. | |
2189 | Omitting the colon results in a test only for a parameter that is unset. | |
2190 | Put another way, if the colon is included, | |
2191 | the operator tests for both <VAR>parameter</VAR>'s existence and that its value | |
2192 | is not null; if the colon is omitted, the operator tests only for existence. | |
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> | |
2205 | is unset or null, the expansion of <VAR>word</VAR> | |
2206 | is assigned to <VAR>parameter</VAR>. | |
2207 | The value of <VAR>parameter</VAR> is then substituted. | |
2208 | Positional parameters and special parameters may not be assigned to | |
2209 | in this way. | |
2210 | <P> | |
2211 | ||
2212 | <DT><CODE>${<VAR>parameter</VAR>:?<VAR>word</VAR>}</CODE> | |
2213 | <DD>If <VAR>parameter</VAR> | |
2214 | is null or unset, the expansion of <VAR>word</VAR> (or a message | |
2215 | to that effect if <VAR>word</VAR> | |
2216 | is not present) is written to the standard error and the shell, if it | |
2217 | is not interactive, exits. Otherwise, the value of <VAR>parameter</VAR> is | |
2218 | substituted. | |
2219 | <P> | |
2220 | ||
2221 | <DT><CODE>${<VAR>parameter</VAR>:+<VAR>word</VAR>}</CODE> | |
2222 | <DD>If <VAR>parameter</VAR> | |
2223 | is null or unset, nothing is substituted, otherwise the expansion of | |
2224 | <VAR>word</VAR> is substituted. | |
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> | |
2230 | starting at the character specified by <VAR>offset</VAR>. | |
2231 | If <VAR>length</VAR> is omitted, expands to the substring of | |
2232 | <VAR>parameter</VAR> starting at the character specified by <VAR>offset</VAR>. | |
2233 | <VAR>length</VAR> and <VAR>offset</VAR> are arithmetic expressions | |
2234 | (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
2235 | This is referred to as Substring Expansion. | |
2236 | <P> | |
2237 | ||
2238 | <VAR>length</VAR> must evaluate to a number greater than or equal to zero. | |
2239 | If <VAR>offset</VAR> evaluates to a number less than zero, the value | |
2240 | is used as an offset from the end of the value of <VAR>parameter</VAR>. | |
2241 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP>, the result is <VAR>length</VAR> positional | |
2242 | parameters beginning at <VAR>offset</VAR>. | |
2243 | If <VAR>parameter</VAR> is an indexed array name subscripted | |
2244 | by <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the result is the <VAR>length</VAR> | |
2245 | members of the array beginning with <CODE>${<VAR>parameter</VAR>[<VAR>offset</VAR>]}</CODE>. | |
2246 | A negative <VAR>offset</VAR> is taken relative to one greater than the maximum | |
2247 | index of the specified array. | |
2248 | Substring expansion applied to an associative array produces undefined | |
2249 | results. | |
2250 | </P><P> | |
2251 | ||
2252 | Note that a negative offset must be separated from the colon by at least | |
2253 | one space to avoid being confused with the <SAMP>`:-'</SAMP> expansion. | |
2254 | Substring indexing is zero-based unless the positional parameters | |
2255 | are used, in which case the indexing starts at 1 by default. | |
2256 | If <VAR>offset</VAR> is 0, and the positional parameters are used, <CODE>$@</CODE> is | |
2257 | prefixed to the list. | |
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>, | |
2263 | separated by the first character of the <CODE>IFS</CODE> special variable. | |
2264 | When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each | |
2265 | variable name expands to a separate word. | |
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>. | |
2272 | If <VAR>name</VAR> is not an array, expands to 0 if <VAR>name</VAR> is set and null | |
2273 | otherwise. | |
2274 | When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each | |
2275 | key 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 | |
2280 | substituted. | |
2281 | If <VAR>parameter</VAR> is <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, the value substituted | |
2282 | is the number of positional parameters. | |
2283 | If <VAR>parameter</VAR> is an array name subscripted by <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, | |
2284 | the value substituted is the number of elements in the array. | |
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> | |
2290 | is expanded to produce a pattern just as in filename | |
2291 | expansion (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). If the pattern matches | |
2292 | the beginning of the expanded value of <VAR>parameter</VAR>, | |
2293 | then the result of the expansion is the expanded value of <VAR>parameter</VAR> | |
2294 | with the shortest matching pattern (the <SAMP>`#'</SAMP> case) or the | |
2295 | longest matching pattern (the <SAMP>`##'</SAMP> case) deleted. | |
2296 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2297 | the pattern removal operation is applied to each positional | |
2298 | parameter in turn, and the expansion is the resultant list. | |
2299 | If <VAR>parameter</VAR> is an array variable subscripted with | |
2300 | <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2301 | the pattern removal operation is applied to each member of the | |
2302 | array in turn, and the expansion is the resultant list. | |
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 | |
2308 | filename expansion. | |
2309 | If the pattern matches a trailing portion of the expanded value of | |
2310 | <VAR>parameter</VAR>, then the result of the expansion is the value of | |
2311 | <VAR>parameter</VAR> with the shortest matching pattern (the <SAMP>`%'</SAMP> case) | |
2312 | or the longest matching pattern (the <SAMP>`%%'</SAMP> case) deleted. | |
2313 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2314 | the pattern removal operation is applied to each positional | |
2315 | parameter in turn, and the expansion is the resultant list. | |
2316 | If <VAR>parameter</VAR> | |
2317 | is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2318 | the pattern removal operation is applied to each member of the | |
2319 | array in turn, and the expansion is the resultant list. | |
2320 | <P> | |
2321 | ||
2322 | <DT><CODE>${<VAR>parameter</VAR>/<VAR>pattern</VAR>/<VAR>string</VAR>}</CODE> | |
2323 | <DD><P> | |
2324 | ||
2325 | The <VAR>pattern</VAR> is expanded to produce a pattern just as in | |
2326 | filename expansion. | |
2327 | <VAR>Parameter</VAR> is expanded and the longest match of <VAR>pattern</VAR> | |
2328 | against its value is replaced with <VAR>string</VAR>. | |
2329 | If <VAR>pattern</VAR> begins with <SAMP>`/'</SAMP>, all matches of <VAR>pattern</VAR> are | |
2330 | replaced with <VAR>string</VAR>. Normally only the first match is replaced. | |
2331 | If <VAR>pattern</VAR> begins with <SAMP>`#'</SAMP>, it must match at the beginning | |
2332 | of the expanded value of <VAR>parameter</VAR>. | |
2333 | If <VAR>pattern</VAR> begins with <SAMP>`%'</SAMP>, it must match at the end | |
2334 | of the expanded value of <VAR>parameter</VAR>. | |
2335 | If <VAR>string</VAR> is null, matches of <VAR>pattern</VAR> are deleted | |
2336 | and the <CODE>/</CODE> following <VAR>pattern</VAR> may be omitted. | |
2337 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2338 | the substitution operation is applied to each positional | |
2339 | parameter in turn, and the expansion is the resultant list. | |
2340 | If <VAR>parameter</VAR> | |
2341 | is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2342 | the substitution operation is applied to each member of the | |
2343 | array in turn, and the expansion is the resultant list. | |
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>. | |
2351 | The <VAR>pattern</VAR> is expanded to produce a pattern just as in | |
0001803f | 2352 | filename expansion. |
17345e5a JA |
2353 | The <SAMP>`^'</SAMP> operator converts lowercase letters matching <VAR>pattern</VAR> |
2354 | to uppercase; the <SAMP>`,'</SAMP> operator converts matching uppercase letters | |
2355 | to lowercase. | |
2356 | The <SAMP>`^^'</SAMP> and <SAMP>`,,'</SAMP> expansions convert each matched character in the | |
2357 | expanded value; the <SAMP>`^'</SAMP> and <SAMP>`,'</SAMP> expansions match and convert only | |
2358 | the first character in the expanded value. | |
2359 | If <VAR>pattern</VAR> is omitted, it is treated like a <SAMP>`?'</SAMP>, which matches | |
2360 | every character. | |
2361 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2362 | the case modification operation is applied to each positional | |
2363 | parameter in turn, and the expansion is the resultant list. | |
2364 | If <VAR>parameter</VAR> | |
2365 | is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2366 | the case modification operation is applied to each member of the | |
2367 | array in turn, and the expansion is the resultant list. | |
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"> < </A>]</TD> | |
2378 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> > </A>]</TD> | |
2379 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> << </A>]</TD> | |
2380 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2381 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2382 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2383 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2384 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2385 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2386 | </TR></TABLE> | |
2387 | <H3> 3.5.4 Command Substitution </H3> | |
2388 | <!--docid::SEC32::--> | |
2389 | <P> | |
2390 | ||
2391 | Command substitution allows the output of a command to replace | |
2392 | the command itself. | |
2393 | Command substitution occurs when a command is enclosed as follows: | |
2394 | <TABLE><tr><td> </td><td class=example><pre>$(<VAR>command</VAR>) | |
2395 | </pre></td></tr></table>or | |
2396 | <TABLE><tr><td> </td><td class=example><pre>`<VAR>command</VAR>` | |
2397 | </pre></td></tr></table></P><P> | |
2398 | ||
2399 | Bash performs the expansion by executing <VAR>command</VAR> and | |
2400 | replacing the command substitution with the standard output of the | |
2401 | command, with any trailing newlines deleted. | |
2402 | Embedded newlines are not deleted, but they may be removed during | |
2403 | word splitting. | |
2404 | The command substitution <CODE>$(cat <VAR>file</VAR>)</CODE> can be | |
2405 | replaced by the equivalent but faster <CODE>$(< <VAR>file</VAR>)</CODE>. | |
2406 | </P><P> | |
2407 | ||
2408 | When the old-style backquote form of substitution is used, | |
2409 | backslash retains its literal meaning except when followed by | |
2410 | <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, or <SAMP>`\'</SAMP>. | |
2411 | The first backquote not preceded by a backslash terminates the | |
2412 | command substitution. | |
2413 | When using the <CODE>$(<VAR>command</VAR>)</CODE> form, all characters between | |
2414 | the parentheses make up the command; none are treated specially. | |
2415 | </P><P> | |
2416 | ||
2417 | Command substitutions may be nested. To nest when using the backquoted | |
2418 | form, escape the inner backquotes with backslashes. | |
2419 | </P><P> | |
2420 | ||
2421 | If the substitution appears within double quotes, word splitting and | |
2422 | filename 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"> < </A>]</TD> | |
2430 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> > </A>]</TD> | |
2431 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> << </A>]</TD> | |
2432 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2433 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2434 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2435 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2436 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2437 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2438 | </TR></TABLE> | |
2439 | <H3> 3.5.5 Arithmetic Expansion </H3> | |
2440 | <!--docid::SEC33::--> | |
2441 | <P> | |
2442 | ||
2443 | Arithmetic expansion allows the evaluation of an arithmetic expression | |
2444 | and the substitution of the result. The format for arithmetic expansion is: | |
2445 | </P><P> | |
2446 | ||
2447 | <TABLE><tr><td> </td><td class=example><pre>$(( <VAR>expression</VAR> )) | |
2448 | </pre></td></tr></table></P><P> | |
2449 | ||
2450 | The expression is treated as if it were within double quotes, but | |
2451 | a double quote inside the parentheses is not treated specially. | |
2452 | All tokens in the expression undergo parameter expansion, command | |
2453 | substitution, and quote removal. | |
2454 | Arithmetic expansions may be nested. | |
2455 | </P><P> | |
2456 | ||
2457 | The evaluation is performed according to the rules listed below | |
2458 | (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
2459 | If the expression is invalid, Bash prints a message indicating | |
2460 | failure to the standard error and no substitution occurs. | |
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"> < </A>]</TD> | |
2468 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> > </A>]</TD> | |
2469 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> << </A>]</TD> | |
2470 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2471 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2472 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2473 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2474 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2475 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2476 | </TR></TABLE> | |
2477 | <H3> 3.5.6 Process Substitution </H3> | |
2478 | <!--docid::SEC34::--> | |
2479 | <P> | |
2480 | ||
2481 | Process substitution is supported on systems that support named | |
2482 | pipes (FIFOs) or the <TT>`/dev/fd'</TT> method of naming open files. | |
2483 | It takes the form of | |
2484 | <TABLE><tr><td> </td><td class=example><pre><(<VAR>list</VAR>) | |
2485 | </pre></td></tr></table>or | |
2486 | <TABLE><tr><td> </td><td class=example><pre>>(<VAR>list</VAR>) | |
2487 | </pre></td></tr></table>The process <VAR>list</VAR> is run with its input or output connected to a | |
2488 | FIFO or some file in <TT>`/dev/fd'</TT>. The name of this file is | |
2489 | passed as an argument to the current command as the result of the | |
2490 | expansion. If the <CODE>>(<VAR>list</VAR>)</CODE> form is used, writing to | |
2491 | the file will provide input for <VAR>list</VAR>. If the | |
2492 | <CODE><(<VAR>list</VAR>)</CODE> form is used, the file passed as an | |
2493 | argument should be read to obtain the output of <VAR>list</VAR>. | |
2494 | Note that no space may appear between the <CODE><</CODE> or <CODE>></CODE> | |
2495 | and the left parenthesis, otherwise the construct would be interpreted | |
2496 | as a redirection. | |
2497 | </P><P> | |
2498 | ||
2499 | When available, process substitution is performed simultaneously with | |
2500 | parameter and variable expansion, command substitution, and arithmetic | |
2501 | expansion. | |
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"> < </A>]</TD> | |
2509 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> > </A>]</TD> | |
2510 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> << </A>]</TD> | |
2511 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2512 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2513 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2514 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2515 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2516 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2517 | </TR></TABLE> | |
2518 | <H3> 3.5.7 Word Splitting </H3> | |
2519 | <!--docid::SEC35::--> | |
2520 | <P> | |
2521 | ||
2522 | The shell scans the results of parameter expansion, command substitution, | |
2523 | and arithmetic expansion that did not occur within double quotes for | |
2524 | word splitting. | |
2525 | </P><P> | |
2526 | ||
2527 | The shell treats each character of <CODE>$IFS</CODE> as a delimiter, and splits | |
2528 | the results of the other expansions into words on these characters. | |
2529 | If <CODE>IFS</CODE> is unset, or its value is exactly <CODE><space><tab><newline></CODE>, | |
2530 | the default, then sequences of | |
2531 | <CODE> <space></CODE>, <CODE><tab></CODE>, and <CODE><newline></CODE> | |
2532 | at the beginning and end of the results of the previous | |
2533 | expansions are ignored, and any sequence of <CODE>IFS</CODE> | |
2534 | characters not at the beginning or end serves to delimit words. | |
2535 | If <CODE>IFS</CODE> has a value other than the default, then sequences of | |
2536 | the whitespace characters <CODE>space</CODE> and <CODE>tab</CODE> | |
2537 | are ignored at the beginning and end of the | |
2538 | word, as long as the whitespace character is in the | |
2539 | value of <CODE>IFS</CODE> (an <CODE>IFS</CODE> whitespace character). | |
2540 | Any character in <CODE>IFS</CODE> that is not <CODE>IFS</CODE> | |
2541 | whitespace, along with any adjacent <CODE>IFS</CODE> | |
2542 | whitespace characters, delimits a field. A sequence of <CODE>IFS</CODE> | |
2543 | whitespace characters is also treated as a delimiter. | |
2544 | If the value of <CODE>IFS</CODE> is null, no word splitting occurs. | |
2545 | </P><P> | |
2546 | ||
2547 | Explicit null arguments (<CODE>""</CODE> or <CODE>"</CODE>) are retained. | |
2548 | Unquoted implicit null arguments, resulting from the expansion of | |
2549 | parameters that have no values, are removed. | |
2550 | If a parameter with no value is expanded within double quotes, a | |
2551 | null argument results and is retained. | |
2552 | </P><P> | |
2553 | ||
2554 | Note that if no expansion occurs, no splitting | |
2555 | is 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"> < </A>]</TD> | |
2563 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> > </A>]</TD> | |
2564 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> << </A>]</TD> | |
2565 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2566 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> | |
2567 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2568 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2569 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2570 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </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 | ||
2583 | After word splitting, unless the <SAMP>`-f'</SAMP> option has been set | |
2584 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), Bash scans each word for the characters | |
2585 | <SAMP>`*'</SAMP>, <SAMP>`?'</SAMP>, and <SAMP>`['</SAMP>. | |
2586 | If one of these characters appears, then the word is | |
2587 | regarded as a <VAR>pattern</VAR>, | |
2588 | and replaced with an alphabetically sorted list of | |
2589 | file names matching the pattern. If no matching file names are found, | |
2590 | and the shell option <CODE>nullglob</CODE> is disabled, the word is left | |
2591 | unchanged. | |
2592 | If the <CODE>nullglob</CODE> option is set, and no matches are found, the word | |
2593 | is removed. | |
2594 | If the <CODE>failglob</CODE> shell option is set, and no matches are found, | |
2595 | an error message is printed and the command is not executed. | |
2596 | If the shell option <CODE>nocaseglob</CODE> is enabled, the match is performed | |
2597 | without regard to the case of alphabetic characters. | |
2598 | </P><P> | |
2599 | ||
0001803f | 2600 | When a pattern is used for filename expansion, the character <SAMP>`.'</SAMP> |
17345e5a JA |
2601 | at the start of a filename or immediately following a slash |
2602 | must be matched explicitly, unless the shell option <CODE>dotglob</CODE> is set. | |
2603 | When matching a file name, the slash character must always be | |
2604 | matched explicitly. | |
2605 | In other cases, the <SAMP>`.'</SAMP> character is not treated specially. | |
2606 | </P><P> | |
2607 | ||
2608 | See the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>, | |
2609 | for a description of the <CODE>nocaseglob</CODE>, <CODE>nullglob</CODE>, | |
2610 | <CODE>failglob</CODE>, and <CODE>dotglob</CODE> options. | |
2611 | </P><P> | |
2612 | ||
2613 | The <CODE>GLOBIGNORE</CODE> | |
2614 | shell variable may be used to restrict the set of filenames matching a | |
2615 | pattern. If <CODE>GLOBIGNORE</CODE> | |
2616 | is set, each matching filename that also matches one of the patterns in | |
2617 | <CODE>GLOBIGNORE</CODE> is removed from the list of matches. The filenames | |
2618 | <TT>`.'</TT> and <TT>`..'</TT> | |
2619 | are always ignored when <CODE>GLOBIGNORE</CODE> | |
2620 | is set and not null. | |
2621 | However, setting <CODE>GLOBIGNORE</CODE> to a non-null value has the effect of | |
2622 | enabling the <CODE>dotglob</CODE> | |
2623 | shell option, so all other filenames beginning with a | |
2624 | <SAMP>`.'</SAMP> will match. | |
2625 | To get the old behavior of ignoring filenames beginning with a | |
2626 | <SAMP>`.'</SAMP>, make <SAMP>`.*'</SAMP> one of the patterns in <CODE>GLOBIGNORE</CODE>. | |
2627 | The <CODE>dotglob</CODE> option is disabled when <CODE>GLOBIGNORE</CODE> | |
2628 | is 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"> < </A>]</TD> | |
2636 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> > </A>]</TD> | |
2637 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> << </A>]</TD> | |
2638 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> Up </A>]</TD> | |
2639 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> | |
2640 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2641 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2642 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2643 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2644 | </TR></TABLE> | |
2645 | <H4> 3.5.8.1 Pattern Matching </H4> | |
2646 | <!--docid::SEC37::--> | |
2647 | <P> | |
2648 | ||
2649 | Any character that appears in a pattern, other than the special pattern | |
2650 | characters described below, matches itself. | |
2651 | The NUL character may not occur in a pattern. | |
2652 | A backslash escapes the following character; the | |
2653 | escaping backslash is discarded when matching. | |
2654 | The special pattern characters must be quoted if they are to be matched | |
2655 | literally. | |
2656 | </P><P> | |
2657 | ||
2658 | The special pattern characters have the following meanings: | |
2659 | <DL COMPACT> | |
2660 | <DT><CODE>*</CODE> | |
2661 | <DD>Matches any string, including the null string. | |
2662 | When the <CODE>globstar</CODE> shell option is enabled, and <SAMP>`*'</SAMP> is used in | |
2663 | a filename expansion context, two adjacent <SAMP>`*'</SAMP>s used as a single | |
2664 | pattern will match all files and zero or more directories and | |
2665 | subdirectories. | |
2666 | If followed by a <SAMP>`/'</SAMP>, two adjacent <SAMP>`*'</SAMP>s will match only | |
2667 | directories 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 | |
2672 | separated by a hyphen denotes a <VAR>range expression</VAR>; | |
2673 | any character that sorts between those two characters, inclusive, | |
2674 | using the current locale's collating sequence and character set, | |
2675 | is matched. If the first character following the | |
2676 | <SAMP>`['</SAMP> is a <SAMP>`!'</SAMP> or a <SAMP>`^'</SAMP> | |
2677 | then any character not enclosed is matched. A <SAMP>`-'</SAMP> | |
2678 | may be matched by including it as the first or last character | |
2679 | in the set. A <SAMP>`]'</SAMP> may be matched by including it as the first | |
2680 | character in the set. | |
2681 | The sorting order of characters in range expressions is determined by | |
2682 | the current locale and the value of the <CODE>LC_COLLATE</CODE> shell variable, | |
2683 | if set. | |
2684 | <P> | |
2685 | ||
2686 | For example, in the default C locale, <SAMP>`[a-dx-z]'</SAMP> is equivalent to | |
2687 | <SAMP>`[abcdxyz]'</SAMP>. Many locales sort characters in dictionary order, and in | |
2688 | these locales <SAMP>`[a-dx-z]'</SAMP> is typically not equivalent to <SAMP>`[abcdxyz]'</SAMP>; | |
2689 | it might be equivalent to <SAMP>`[aBbCcDdxXyYz]'</SAMP>, for example. To obtain | |
2690 | the traditional interpretation of ranges in bracket expressions, you can | |
2691 | force the use of the C locale by setting the <CODE>LC_COLLATE</CODE> or | |
2692 | <CODE>LC_ALL</CODE> environment variable to the value <SAMP>`C'</SAMP>. | |
2693 | </P><P> | |
2694 | ||
2695 | Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, <VAR>character classes</VAR> can be specified | |
2696 | using the syntax | |
2697 | <CODE>[:</CODE><VAR>class</VAR><CODE>:]</CODE>, where <VAR>class</VAR> is one of the | |
2698 | following classes defined in the POSIX standard: | |
2699 | <TABLE><tr><td> </td><td class=example><pre>alnum alpha ascii blank cntrl digit graph lower | |
2700 | print punct space upper word xdigit | |
2701 | </pre></td></tr></table>A character class matches any character belonging to that class. | |
2702 | The <CODE>word</CODE> character class matches letters, digits, and the character | |
2703 | <SAMP>`_'</SAMP>. | |
2704 | </P><P> | |
2705 | ||
2706 | Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, an <VAR>equivalence class</VAR> can be | |
2707 | specified using the syntax <CODE>[=</CODE><VAR>c</VAR><CODE>=]</CODE>, which | |
2708 | matches all characters with the same collation weight (as defined | |
2709 | by the current locale) as the character <VAR>c</VAR>. | |
2710 | </P><P> | |
2711 | ||
2712 | Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, the syntax <CODE>[.</CODE><VAR>symbol</VAR><CODE>.]</CODE> | |
2713 | matches the collating symbol <VAR>symbol</VAR>. | |
2714 | </DL> | |
2715 | <P> | |
2716 | ||
2717 | If the <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> | |
2718 | builtin, several extended pattern matching operators are recognized. | |
2719 | In the following description, a <VAR>pattern-list</VAR> is a list of one | |
2720 | or more patterns separated by a <SAMP>`|'</SAMP>. | |
2721 | Composite patterns may be formed using one or more of the following | |
2722 | sub-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"> < </A>]</TD> | |
2752 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> > </A>]</TD> | |
2753 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD> | |
2754 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2755 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2756 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2757 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2758 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2759 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2760 | </TR></TABLE> | |
2761 | <H3> 3.5.9 Quote Removal </H3> | |
2762 | <!--docid::SEC38::--> | |
2763 | <P> | |
2764 | ||
2765 | After the preceding expansions, all unquoted occurrences of the | |
2766 | characters <SAMP>`\'</SAMP>, <SAMP>`''</SAMP>, and <SAMP>`"'</SAMP> that did not | |
2767 | result from one of the above expansions are removed. | |
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"> < </A>]</TD> | |
2775 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> > </A>]</TD> | |
2776 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> << </A>]</TD> | |
2777 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
2778 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2779 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2780 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2781 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2782 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2783 | </TR></TABLE> | |
2784 | <H2> 3.6 Redirections </H2> | |
2785 | <!--docid::SEC39::--> | |
2786 | <P> | |
2787 | ||
2788 | Before a command is executed, its input and output | |
2789 | may be <VAR>redirected</VAR> | |
2790 | using a special notation interpreted by the shell. | |
2791 | Redirection may also be used to open and close files for the | |
2792 | current shell execution environment. The following redirection | |
2793 | operators may precede or appear anywhere within a | |
2794 | simple command or may follow a command. | |
2795 | Redirections are processed in the order they appear, from | |
2796 | left to right. | |
2797 | </P><P> | |
2798 | ||
0001803f CR |
2799 | Each redirection that may be preceded by a file descriptor number |
2800 | may instead be preceded by a word of the form {<VAR>varname</VAR>}. | |
2801 | In this case, for each redirection operator except | |
2802 | >&- and <&-, the shell will allocate a file descriptor greater | |
2803 | than 10 and assign it to {<VAR>varname</VAR>}. If >&- or <&- is preceded | |
2804 | by {<VAR>varname</VAR>}, the value of <VAR>varname</VAR> defines the file | |
2805 | descriptor to close. | |
2806 | </P><P> | |
2807 | ||
17345e5a JA |
2808 | In the following descriptions, if the file descriptor number is |
2809 | omitted, and the first character of the redirection operator is | |
2810 | <SAMP>`<'</SAMP>, the redirection refers to the standard input (file | |
2811 | descriptor 0). If the first character of the redirection operator | |
2812 | is <SAMP>`>'</SAMP>, the redirection refers to the standard output (file | |
2813 | descriptor 1). | |
2814 | </P><P> | |
2815 | ||
2816 | The word following the redirection operator in the following | |
2817 | descriptions, unless otherwise noted, is subjected to brace expansion, | |
2818 | tilde expansion, parameter expansion, command substitution, arithmetic | |
2819 | expansion, quote removal, filename expansion, and word splitting. | |
2820 | If it expands to more than one word, Bash reports an error. | |
2821 | </P><P> | |
2822 | ||
2823 | Note that the order of redirections is significant. For example, | |
2824 | the command | |
2825 | <TABLE><tr><td> </td><td class=example><pre>ls > <VAR>dirlist</VAR> 2>&1 | |
2826 | </pre></td></tr></table>directs both standard output (file descriptor 1) and standard error | |
2827 | (file descriptor 2) to the file <VAR>dirlist</VAR>, while the command | |
2828 | <TABLE><tr><td> </td><td class=example><pre>ls 2>&1 > <VAR>dirlist</VAR> | |
2829 | </pre></td></tr></table>directs only the standard output to file <VAR>dirlist</VAR>, | |
0001803f | 2830 | because the standard error was made a copy of the standard output |
17345e5a JA |
2831 | before the standard output was redirected to <VAR>dirlist</VAR>. |
2832 | </P><P> | |
2833 | ||
2834 | Bash handles several filenames specially when they are used in | |
2835 | redirections, 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> | |
2857 | is an integer port number or service name, Bash attempts to open a TCP | |
2858 | connection 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> | |
2863 | is an integer port number or service name, Bash attempts to open a UDP | |
2864 | connection to the corresponding socket. | |
2865 | <P> | |
2866 | ||
2867 | </DL> | |
2868 | <P> | |
2869 | ||
2870 | A failure to open or create a file causes the redirection to fail. | |
2871 | </P><P> | |
2872 | ||
2873 | Redirections using file descriptors greater than 9 should be used with | |
2874 | care, as they may conflict with file descriptors the shell uses | |
2875 | internally. | |
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"> < </A>]</TD> | |
2882 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> > </A>]</TD> | |
2883 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> << </A>]</TD> | |
2884 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
2885 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2886 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2887 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2888 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2889 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2890 | </TR></TABLE> | |
2891 | <H3> 3.6.1 Redirecting Input </H3> | |
2892 | <!--docid::SEC40::--> | |
2893 | Redirection of input causes the file whose name results from | |
2894 | the expansion of <VAR>word</VAR> | |
2895 | to be opened for reading on file descriptor <CODE>n</CODE>, | |
2896 | or the standard input (file descriptor 0) if <CODE>n</CODE> | |
2897 | is not specified. | |
2898 | <P> | |
2899 | ||
2900 | The general format for redirecting input is: | |
2901 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<<VAR>word</VAR> | |
2902 | </pre></td></tr></table></P><P> | |
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"> < </A>]</TD> | |
2908 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> > </A>]</TD> | |
2909 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> << </A>]</TD> | |
2910 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
2911 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2912 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2913 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2914 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2915 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2916 | </TR></TABLE> | |
2917 | <H3> 3.6.2 Redirecting Output </H3> | |
2918 | <!--docid::SEC41::--> | |
2919 | Redirection of output causes the file whose name results from | |
2920 | the expansion of <VAR>word</VAR> | |
2921 | to be opened for writing on file descriptor <VAR>n</VAR>, | |
2922 | or the standard output (file descriptor 1) if <VAR>n</VAR> | |
2923 | is not specified. If the file does not exist it is created; | |
2924 | if it does exist it is truncated to zero size. | |
2925 | <P> | |
2926 | ||
2927 | The general format for redirecting output is: | |
2928 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>[|]<VAR>word</VAR> | |
2929 | </pre></td></tr></table></P><P> | |
2930 | ||
2931 | If the redirection operator is <SAMP>`>'</SAMP>, and the <CODE>noclobber</CODE> | |
2932 | option to the <CODE>set</CODE> builtin has been enabled, the redirection | |
2933 | will fail if the file whose name results from the expansion of | |
2934 | <VAR>word</VAR> exists and is a regular file. | |
2935 | If the redirection operator is <SAMP>`>|'</SAMP>, or the redirection operator is | |
2936 | <SAMP>`>'</SAMP> and the <CODE>noclobber</CODE> option is not enabled, the redirection | |
2937 | is attempted even if the file named by <VAR>word</VAR> exists. | |
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"> < </A>]</TD> | |
2944 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> > </A>]</TD> | |
2945 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> << </A>]</TD> | |
2946 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
2947 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2948 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2949 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2950 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2951 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2952 | </TR></TABLE> | |
2953 | <H3> 3.6.3 Appending Redirected Output </H3> | |
2954 | <!--docid::SEC42::--> | |
2955 | Redirection of output in this fashion | |
2956 | causes the file whose name results from | |
2957 | the expansion of <VAR>word</VAR> | |
2958 | to be opened for appending on file descriptor <VAR>n</VAR>, | |
2959 | or the standard output (file descriptor 1) if <VAR>n</VAR> | |
2960 | is not specified. If the file does not exist it is created. | |
2961 | <P> | |
2962 | ||
2963 | The general format for appending output is: | |
2964 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>><VAR>word</VAR> | |
2965 | </pre></td></tr></table></P><P> | |
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"> < </A>]</TD> | |
2971 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> > </A>]</TD> | |
2972 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> << </A>]</TD> | |
2973 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
2974 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2975 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2976 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2977 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2978 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2979 | </TR></TABLE> | |
2980 | <H3> 3.6.4 Redirecting Standard Output and Standard Error </H3> | |
2981 | <!--docid::SEC43::--> | |
2982 | This construct allows both the | |
2983 | standard output (file descriptor 1) and | |
2984 | the standard error output (file descriptor 2) | |
2985 | to be redirected to the file whose name is the | |
2986 | expansion of <VAR>word</VAR>. | |
2987 | <P> | |
2988 | ||
2989 | There are two formats for redirecting standard output and | |
2990 | standard error: | |
2991 | <TABLE><tr><td> </td><td class=example><pre>&><VAR>word</VAR> | |
2992 | </pre></td></tr></table>and | |
2993 | <TABLE><tr><td> </td><td class=example><pre>>&<VAR>word</VAR> | |
2994 | </pre></td></tr></table>Of the two forms, the first is preferred. | |
2995 | This is semantically equivalent to | |
2996 | <TABLE><tr><td> </td><td class=example><pre>><VAR>word</VAR> 2>&1 | |
2997 | </pre></td></tr></table></P><P> | |
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"> < </A>]</TD> | |
3003 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> > </A>]</TD> | |
3004 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> << </A>]</TD> | |
3005 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3006 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3007 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3008 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3009 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3010 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3011 | </TR></TABLE> | |
3012 | <H3> 3.6.5 Appending Standard Output and Standard Error </H3> | |
3013 | <!--docid::SEC44::--> | |
3014 | This construct allows both the | |
3015 | standard output (file descriptor 1) and | |
3016 | the standard error output (file descriptor 2) | |
3017 | to be appended to the file whose name is the | |
3018 | expansion of <VAR>word</VAR>. | |
3019 | <P> | |
3020 | ||
3021 | The format for appending standard output and standard error is: | |
3022 | <TABLE><tr><td> </td><td class=example><pre>&>><VAR>word</VAR> | |
3023 | </pre></td></tr></table>This is semantically equivalent to | |
3024 | <TABLE><tr><td> </td><td class=example><pre>>><VAR>word</VAR> 2>&1 | |
3025 | </pre></td></tr></table></P><P> | |
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"> < </A>]</TD> | |
3031 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> > </A>]</TD> | |
3032 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> << </A>]</TD> | |
3033 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3034 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3035 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3036 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3037 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3038 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3039 | </TR></TABLE> | |
3040 | <H3> 3.6.6 Here Documents </H3> | |
3041 | <!--docid::SEC45::--> | |
3042 | This type of redirection instructs the shell to read input from the | |
3043 | current source until a line containing only <VAR>word</VAR> | |
3044 | (with no trailing blanks) is seen. All of | |
3045 | the lines read up to that point are then used as the standard | |
3046 | input for a command. | |
3047 | <P> | |
3048 | ||
3049 | The format of here-documents is: | |
3050 | <TABLE><tr><td> </td><td class=example><pre><<[-]<VAR>word</VAR> | |
3051 | <VAR>here-document</VAR> | |
3052 | <VAR>delimiter</VAR> | |
3053 | </pre></td></tr></table></P><P> | |
3054 | ||
3055 | No parameter expansion, command substitution, arithmetic expansion, | |
3056 | or filename expansion is performed on | |
3057 | <VAR>word</VAR>. If any characters in <VAR>word</VAR> are quoted, the | |
3058 | <VAR>delimiter</VAR> is the result of quote removal on <VAR>word</VAR>, | |
3059 | and the lines in the here-document are not expanded. | |
3060 | If <VAR>word</VAR> is unquoted, | |
3061 | all lines of the here-document are subjected to parameter expansion, | |
3062 | command substitution, and arithmetic expansion. In the latter | |
3063 | case, the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP> | |
3064 | must be used to quote the characters | |
3065 | <SAMP>`\'</SAMP>, <SAMP>`$'</SAMP>, and <SAMP>``'</SAMP>. | |
3066 | </P><P> | |
3067 | ||
3068 | If the redirection operator is <SAMP>`<<-'</SAMP>, | |
3069 | then all leading tab characters are stripped from input lines and the | |
3070 | line containing <VAR>delimiter</VAR>. | |
3071 | This allows here-documents within shell scripts to be indented in a | |
3072 | natural 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"> < </A>]</TD> | |
3079 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> > </A>]</TD> | |
3080 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> << </A>]</TD> | |
3081 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3082 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3083 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3084 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3085 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3086 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3087 | </TR></TABLE> | |
3088 | <H3> 3.6.7 Here Strings </H3> | |
3089 | <!--docid::SEC46::--> | |
3090 | A variant of here documents, the format is: | |
3091 | <TABLE><tr><td> </td><td class=example><pre><<< <VAR>word</VAR> | |
3092 | </pre></td></tr></table><P> | |
3093 | ||
3094 | The <VAR>word</VAR> is expanded and supplied to the command on its standard | |
3095 | input. | |
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"> < </A>]</TD> | |
3102 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> > </A>]</TD> | |
3103 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> << </A>]</TD> | |
3104 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3105 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3106 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3107 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3108 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3109 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3110 | </TR></TABLE> | |
3111 | <H3> 3.6.8 Duplicating File Descriptors </H3> | |
3112 | <!--docid::SEC47::--> | |
3113 | The redirection operator | |
3114 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>word</VAR> | |
3115 | </pre></td></tr></table>is used to duplicate input file descriptors. | |
3116 | If <VAR>word</VAR> | |
3117 | expands to one or more digits, the file descriptor denoted by <VAR>n</VAR> | |
3118 | is made to be a copy of that file descriptor. | |
3119 | If the digits in <VAR>word</VAR> do not specify a file descriptor open for | |
3120 | input, a redirection error occurs. | |
3121 | If <VAR>word</VAR> | |
3122 | evaluates to <SAMP>`-'</SAMP>, file descriptor <VAR>n</VAR> is closed. If | |
3123 | <VAR>n</VAR> is not specified, the standard input (file descriptor 0) is used. | |
3124 | <P> | |
3125 | ||
3126 | The operator | |
3127 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>word</VAR> | |
3128 | </pre></td></tr></table>is used similarly to duplicate output file descriptors. If | |
3129 | <VAR>n</VAR> is not specified, the standard output (file descriptor 1) is used. | |
3130 | If the digits in <VAR>word</VAR> do not specify a file descriptor open for | |
3131 | output, a redirection error occurs. | |
3132 | As a special case, if <VAR>n</VAR> is omitted, and <VAR>word</VAR> does not | |
3133 | expand to one or more digits, the standard output and standard | |
3134 | error are redirected as described previously. | |
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"> < </A>]</TD> | |
3141 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> > </A>]</TD> | |
3142 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> << </A>]</TD> | |
3143 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3144 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3145 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3146 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3147 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3148 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3149 | </TR></TABLE> | |
3150 | <H3> 3.6.9 Moving File Descriptors </H3> | |
3151 | <!--docid::SEC48::--> | |
3152 | The redirection operator | |
3153 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>digit</VAR>- | |
3154 | </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>, | |
3155 | or the standard input (file descriptor 0) if <VAR>n</VAR> is not specified. | |
3156 | <VAR>digit</VAR> is closed after being duplicated to <VAR>n</VAR>. | |
3157 | <P> | |
3158 | ||
3159 | Similarly, the redirection operator | |
3160 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>digit</VAR>- | |
3161 | </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>, | |
3162 | or the standard output (file descriptor 1) if <VAR>n</VAR> is not specified. | |
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"> < </A>]</TD> | |
3169 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> > </A>]</TD> | |
3170 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> << </A>]</TD> | |
3171 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3172 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3173 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3174 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3175 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3176 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3177 | </TR></TABLE> | |
3178 | <H3> 3.6.10 Opening File Descriptors for Reading and Writing </H3> | |
3179 | <!--docid::SEC49::--> | |
3180 | The redirection operator | |
3181 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<><VAR>word</VAR> | |
3182 | </pre></td></tr></table>causes the file whose name is the expansion of <VAR>word</VAR> | |
3183 | to be opened for both reading and writing on file descriptor | |
3184 | <VAR>n</VAR>, or on file descriptor 0 if <VAR>n</VAR> | |
3185 | is not specified. If the file does not exist, it is created. | |
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"> < </A>]</TD> | |
3193 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> > </A>]</TD> | |
3194 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD> | |
3195 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
3196 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3197 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3198 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3199 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3200 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands simple commands before | |
3208 | executing them.</TD></TR> | |
3209 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash finds commands and runs them.</TD></TR> | |
3210 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment in which Bash | |
3211 | executes commands that are not | |
3212 | shell builtins.</TD></TR> | |
3213 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC54">3.7.4 Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment given to a command.</TD></TR> | |
3214 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC55">3.7.5 Exit Status</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The status returned by commands and how Bash | |
3215 | interprets it.</TD></TR> | |
3216 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC56">3.7.6 Signals</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What happens when Bash or a command it runs | |
3217 | receives a signal.</TD></TR> | |
3218 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
3226 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> > </A>]</TD> | |
3227 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD> | |
3228 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3229 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3230 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3231 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3232 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3233 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3234 | </TR></TABLE> | |
3235 | <H3> 3.7.1 Simple Command Expansion </H3> | |
3236 | <!--docid::SEC51::--> | |
3237 | <P> | |
3238 | ||
3239 | When a simple command is executed, the shell performs the following | |
3240 | expansions, assignments, and redirections, from left to right. | |
3241 | </P><P> | |
3242 | ||
3243 | <OL> | |
3244 | <LI> | |
3245 | The words that the parser has marked as variable assignments (those | |
3246 | preceding the command name) and redirections are saved for later | |
3247 | processing. | |
3248 | <P> | |
3249 | ||
3250 | <LI> | |
3251 | The words that are not variable assignments or redirections are | |
3252 | expanded (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>). | |
3253 | If any words remain after expansion, the first word | |
3254 | is taken to be the name of the command and the remaining words are | |
3255 | the arguments. | |
3256 | <P> | |
3257 | ||
3258 | <LI> | |
3259 | Redirections are performed as described above (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
3260 | <P> | |
3261 | ||
3262 | <LI> | |
3263 | The text after the <SAMP>`='</SAMP> in each variable assignment undergoes tilde | |
3264 | expansion, parameter expansion, command substitution, arithmetic expansion, | |
3265 | and quote removal before being assigned to the variable. | |
3266 | </OL> | |
3267 | <P> | |
3268 | ||
3269 | If no command name results, the variable assignments affect the current | |
3270 | shell environment. Otherwise, the variables are added to the environment | |
3271 | of the executed command and do not affect the current shell environment. | |
3272 | If any of the assignments attempts to assign a value to a readonly variable, | |
3273 | an error occurs, and the command exits with a non-zero status. | |
3274 | </P><P> | |
3275 | ||
3276 | If no command name results, redirections are performed, but do not | |
3277 | affect the current shell environment. A redirection error causes the | |
3278 | command to exit with a non-zero status. | |
3279 | </P><P> | |
3280 | ||
3281 | If there is a command name left after expansion, execution proceeds as | |
3282 | described below. Otherwise, the command exits. If one of the expansions | |
3283 | contained a command substitution, the exit status of the command is | |
3284 | the exit status of the last command substitution performed. If there | |
3285 | were no command substitutions, the command exits with a status of zero. | |
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"> < </A>]</TD> | |
3293 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> > </A>]</TD> | |
3294 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> << </A>]</TD> | |
3295 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3296 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3297 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3298 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3299 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3300 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3301 | </TR></TABLE> | |
3302 | <H3> 3.7.2 Command Search and Execution </H3> | |
3303 | <!--docid::SEC52::--> | |
3304 | <P> | |
3305 | ||
3306 | After a command has been split into words, if it results in a | |
3307 | simple command and an optional list of arguments, the following | |
3308 | actions are taken. | |
3309 | </P><P> | |
3310 | ||
3311 | <OL> | |
3312 | <LI> | |
3313 | If the command name contains no slashes, the shell attempts to | |
3314 | locate it. If there exists a shell function by that name, that | |
3315 | function is invoked as described in <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>. | |
3316 | <P> | |
3317 | ||
3318 | <LI> | |
3319 | If the name does not match a function, the shell searches for | |
3320 | it in the list of shell builtins. If a match is found, that | |
3321 | builtin is invoked. | |
3322 | <P> | |
3323 | ||
3324 | <LI> | |
3325 | If the name is neither a shell function nor a builtin, | |
3326 | and contains no slashes, Bash searches each element of | |
3327 | <CODE>$PATH</CODE> for a directory containing an executable file | |
3328 | by that name. Bash uses a hash table to remember the full | |
3329 | pathnames of executable files to avoid multiple <CODE>PATH</CODE> searches | |
3330 | (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
3331 | A full search of the directories in <CODE>$PATH</CODE> | |
3332 | is performed only if the command is not found in the hash table. | |
3333 | If the search is unsuccessful, the shell searches for a defined shell | |
3334 | function named <CODE>command_not_found_handle</CODE>. | |
3335 | If that function exists, it is invoked with the original command and | |
3336 | the original command's arguments as its arguments, and the function's | |
3337 | exit status becomes the exit status of the shell. | |
3338 | If that function is not defined, the shell prints an error | |
3339 | message and returns an exit status of 127. | |
3340 | <P> | |
3341 | ||
3342 | <LI> | |
3343 | If the search is successful, or if the command name contains | |
3344 | one or more slashes, the shell executes the named program in | |
3345 | a separate execution environment. | |
3346 | Argument 0 is set to the name given, and the remaining arguments | |
3347 | to the command are set to the arguments supplied, if any. | |
3348 | <P> | |
3349 | ||
3350 | <LI> | |
3351 | If this execution fails because the file is not in executable | |
3352 | format, and the file is not a directory, it is assumed to be a | |
3353 | <VAR>shell script</VAR> and the shell executes it as described in | |
3354 | <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>. | |
3355 | <P> | |
3356 | ||
3357 | <LI> | |
3358 | If the command was not begun asynchronously, the shell waits for | |
3359 | the 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"> < </A>]</TD> | |
3370 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> > </A>]</TD> | |
3371 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> << </A>]</TD> | |
3372 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3373 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3374 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3375 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3376 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3377 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3378 | </TR></TABLE> | |
3379 | <H3> 3.7.3 Command Execution Environment </H3> | |
3380 | <!--docid::SEC53::--> | |
3381 | <P> | |
3382 | ||
3383 | The shell has an <VAR>execution environment</VAR>, which consists of the | |
3384 | following: | |
3385 | </P><P> | |
3386 | ||
3387 | <UL> | |
3388 | <LI> | |
3389 | open files inherited by the shell at invocation, as modified by | |
3390 | redirections supplied to the <CODE>exec</CODE> builtin | |
3391 | <P> | |
3392 | ||
3393 | <LI> | |
3394 | the current working directory as set by <CODE>cd</CODE>, <CODE>pushd</CODE>, or | |
3395 | <CODE>popd</CODE>, or inherited by the shell at invocation | |
3396 | <P> | |
3397 | ||
3398 | <LI> | |
3399 | the file creation mode mask as set by <CODE>umask</CODE> or inherited from | |
3400 | the shell's parent | |
3401 | <P> | |
3402 | ||
3403 | <LI> | |
3404 | current traps set by <CODE>trap</CODE> | |
3405 | <P> | |
3406 | ||
3407 | <LI> | |
3408 | shell parameters that are set by variable assignment or with <CODE>set</CODE> | |
3409 | or inherited from the shell's parent in the environment | |
3410 | <P> | |
3411 | ||
3412 | <LI> | |
3413 | shell functions defined during execution or inherited from the shell's | |
3414 | parent in the environment | |
3415 | <P> | |
3416 | ||
3417 | <LI> | |
3418 | options enabled at invocation (either by default or with command-line | |
3419 | arguments) or by <CODE>set</CODE> | |
3420 | <P> | |
3421 | ||
3422 | <LI> | |
3423 | options enabled by <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) | |
3424 | <P> | |
3425 | ||
3426 | <LI> | |
3427 | shell aliases defined with <CODE>alias</CODE> (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>) | |
3428 | <P> | |
3429 | ||
3430 | <LI> | |
3431 | various process IDs, including those of background jobs | |
3432 | (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the value of <CODE>$$</CODE>, and the value of | |
3433 | <CODE>$PPID</CODE> | |
3434 | <P> | |
3435 | ||
3436 | </UL> | |
3437 | <P> | |
3438 | ||
3439 | When a simple command other than a builtin or shell function | |
3440 | is to be executed, it | |
3441 | is invoked in a separate execution environment that consists of | |
3442 | the following. Unless otherwise noted, the values are inherited | |
3443 | from the shell. | |
3444 | </P><P> | |
3445 | ||
3446 | <UL> | |
3447 | <LI> | |
3448 | the shell's open files, plus any modifications and additions specified | |
3449 | by redirections to the command | |
3450 | <P> | |
3451 | ||
3452 | <LI> | |
3453 | the current working directory | |
3454 | <P> | |
3455 | ||
3456 | <LI> | |
3457 | the file creation mode mask | |
3458 | <P> | |
3459 | ||
3460 | <LI> | |
3461 | shell variables and functions marked for export, along with variables | |
3462 | exported for the command, passed in the environment (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>) | |
3463 | <P> | |
3464 | ||
3465 | <LI> | |
3466 | traps caught by the shell are reset to the values inherited from the | |
3467 | shell's parent, and traps ignored by the shell are ignored | |
3468 | <P> | |
3469 | ||
3470 | </UL> | |
3471 | <P> | |
3472 | ||
3473 | A command invoked in this separate environment cannot affect the | |
3474 | shell's execution environment. | |
3475 | </P><P> | |
3476 | ||
3477 | Command substitution, commands grouped with parentheses, | |
3478 | and asynchronous commands are invoked in a | |
3479 | subshell environment that is a duplicate of the shell environment, | |
3480 | except that traps caught by the shell are reset to the values | |
3481 | that the shell inherited from its parent at invocation. Builtin | |
3482 | commands that are invoked as part of a pipeline are also executed | |
3483 | in a subshell environment. Changes made to the subshell environment | |
3484 | cannot affect the shell's execution environment. | |
3485 | </P><P> | |
3486 | ||
3487 | Subshells spawned to execute command substitutions inherit the value of | |
3488 | the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode, | |
3489 | Bash clears the <SAMP>`-e'</SAMP> option in such subshells. | |
3490 | </P><P> | |
3491 | ||
3492 | If a command is followed by a <SAMP>`&'</SAMP> and job control is not active, the | |
3493 | default standard input for the command is the empty file <TT>`/dev/null'</TT>. | |
3494 | Otherwise, the invoked command inherits the file descriptors of the calling | |
3495 | shell as modified by redirections. | |
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"> < </A>]</TD> | |
3503 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> > </A>]</TD> | |
3504 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> << </A>]</TD> | |
3505 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3506 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3507 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3508 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3509 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3510 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3511 | </TR></TABLE> | |
3512 | <H3> 3.7.4 Environment </H3> | |
3513 | <!--docid::SEC54::--> | |
3514 | <P> | |
3515 | ||
3516 | When a program is invoked it is given an array of strings | |
3517 | called the <VAR>environment</VAR>. | |
3518 | This is a list of name-value pairs, of the form <CODE>name=value</CODE>. | |
3519 | </P><P> | |
3520 | ||
3521 | Bash provides several ways to manipulate the environment. | |
3522 | On invocation, the shell scans its own environment and | |
3523 | creates a parameter for each name found, automatically marking | |
3524 | it for <VAR>export</VAR> | |
3525 | to child processes. Executed commands inherit the environment. | |
3526 | The <CODE>export</CODE> and <SAMP>`declare -x'</SAMP> | |
3527 | commands allow parameters and functions to be added to and | |
3528 | deleted from the environment. If the value of a parameter | |
3529 | in the environment is modified, the new value becomes part | |
3530 | of the environment, replacing the old. The environment | |
3531 | inherited by any executed command consists of the shell's | |
3532 | initial environment, whose values may be modified in the shell, | |
3533 | less any pairs removed by the <CODE>unset</CODE> and <SAMP>`export -n'</SAMP> | |
3534 | commands, plus any additions via the <CODE>export</CODE> and | |
3535 | <SAMP>`declare -x'</SAMP> commands. | |
3536 | </P><P> | |
3537 | ||
3538 | The environment for any simple command | |
3539 | or function may be augmented temporarily by prefixing it with | |
3540 | parameter assignments, as described in <A HREF="bashref.html#SEC25">3.4 Shell Parameters</A>. | |
3541 | These assignment statements affect only the environment seen | |
3542 | by that command. | |
3543 | </P><P> | |
3544 | ||
3545 | If the <SAMP>`-k'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), then all | |
3546 | parameter assignments are placed in the environment for a command, | |
3547 | not just those that precede the command name. | |
3548 | </P><P> | |
3549 | ||
3550 | When Bash invokes an external command, the variable <SAMP>`$_'</SAMP> | |
3551 | is set to the full path name of the command and passed to that | |
3552 | command in its environment. | |
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"> < </A>]</TD> | |
3560 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> > </A>]</TD> | |
3561 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> << </A>]</TD> | |
3562 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3563 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3564 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3565 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3566 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3567 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3568 | </TR></TABLE> | |
3569 | <H3> 3.7.5 Exit Status </H3> | |
3570 | <!--docid::SEC55::--> | |
3571 | <P> | |
3572 | ||
3573 | The exit status of an executed command is the value returned by the | |
3574 | <VAR>waitpid</VAR> system call or equivalent function. Exit statuses | |
3575 | fall between 0 and 255, though, as explained below, the shell may | |
3576 | use values above 125 specially. Exit statuses from shell builtins and | |
3577 | compound commands are also limited to this range. Under certain | |
3578 | circumstances, the shell will use special values to indicate specific | |
3579 | failure modes. | |
3580 | </P><P> | |
3581 | ||
3582 | For the shell's purposes, a command which exits with a | |
3583 | zero exit status has succeeded. | |
3584 | A non-zero exit status indicates failure. | |
3585 | This seemingly counter-intuitive scheme is used so there | |
3586 | is one well-defined way to indicate success and a variety of | |
3587 | ways to indicate various failure modes. | |
3588 | When a command terminates on a fatal signal whose number is <VAR>N</VAR>, | |
3589 | Bash uses the value 128+<VAR>N</VAR> as the exit status. | |
3590 | </P><P> | |
3591 | ||
3592 | If a command is not found, the child process created to | |
3593 | execute it returns a status of 127. If a command is found | |
3594 | but is not executable, the return status is 126. | |
3595 | </P><P> | |
3596 | ||
3597 | If a command fails because of an error during expansion or redirection, | |
3598 | the exit status is greater than zero. | |
3599 | </P><P> | |
3600 | ||
3601 | The exit status is used by the Bash conditional commands | |
3602 | (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) and some of the list | |
3603 | constructs (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>). | |
3604 | </P><P> | |
3605 | ||
3606 | All of the Bash builtins return an exit status of zero if they succeed | |
3607 | and a non-zero status on failure, so they may be used by the | |
3608 | conditional and list constructs. | |
3609 | All builtins return an exit status of 2 to indicate incorrect usage. | |
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"> < </A>]</TD> | |
3617 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> > </A>]</TD> | |
3618 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD> | |
3619 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3620 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3621 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3622 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3623 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3624 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3625 | </TR></TABLE> | |
3626 | <H3> 3.7.6 Signals </H3> | |
3627 | <!--docid::SEC56::--> | |
3628 | <P> | |
3629 | ||
3630 | When Bash is interactive, in the absence of any traps, it ignores | |
3631 | <CODE>SIGTERM</CODE> (so that <SAMP>`kill 0'</SAMP> does not kill an interactive shell), | |
3632 | and <CODE>SIGINT</CODE> | |
3633 | is caught and handled (so that the <CODE>wait</CODE> builtin is interruptible). | |
3634 | When Bash receives a <CODE>SIGINT</CODE>, it breaks out of any executing loops. | |
3635 | In all cases, Bash ignores <CODE>SIGQUIT</CODE>. | |
3636 | If job control is in effect (see section <A HREF="bashref.html#SEC91">7. Job Control</A>), Bash | |
3637 | ignores <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>. | |
3638 | </P><P> | |
3639 | ||
3640 | Non-builtin commands started by Bash have signal handlers set to the | |
3641 | values inherited by the shell from its parent. | |
3642 | When job control is not in effect, asynchronous commands | |
3643 | ignore <CODE>SIGINT</CODE> and <CODE>SIGQUIT</CODE> in addition to these inherited | |
3644 | handlers. | |
3645 | Commands run as a result of | |
3646 | command substitution ignore the keyboard-generated job control signals | |
3647 | <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>. | |
3648 | </P><P> | |
3649 | ||
3650 | The shell exits by default upon receipt of a <CODE>SIGHUP</CODE>. | |
3651 | Before exiting, an interactive shell resends the <CODE>SIGHUP</CODE> to | |
3652 | all jobs, running or stopped. | |
3653 | Stopped jobs are sent <CODE>SIGCONT</CODE> to ensure that they receive | |
3654 | the <CODE>SIGHUP</CODE>. | |
3655 | To prevent the shell from sending the <CODE>SIGHUP</CODE> signal to a | |
3656 | particular job, it should be removed | |
3657 | from the jobs table with the <CODE>disown</CODE> | |
3658 | builtin (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or marked | |
3659 | to not receive <CODE>SIGHUP</CODE> using <CODE>disown -h</CODE>. | |
3660 | </P><P> | |
3661 | ||
3662 | If the <CODE>huponexit</CODE> shell option has been set with <CODE>shopt</CODE> | |
3663 | (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), Bash sends a <CODE>SIGHUP</CODE> to all jobs when | |
3664 | an interactive login shell exits. | |
3665 | </P><P> | |
3666 | ||
3667 | If Bash is waiting for a command to complete and receives a signal | |
3668 | for which a trap has been set, the trap will not be executed until | |
3669 | the command completes. | |
3670 | When Bash is waiting for an asynchronous | |
3671 | command via the <CODE>wait</CODE> builtin, the reception of a signal for | |
3672 | which a trap has been set will cause the <CODE>wait</CODE> builtin to return | |
3673 | immediately with an exit status greater than 128, immediately after | |
3674 | which the trap is executed. | |
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"> < </A>]</TD> | |
3682 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> > </A>]</TD> | |
3683 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> | |
3684 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
3685 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD> | |
3686 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3687 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3688 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3689 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3690 | </TR></TABLE> | |
3691 | <H2> 3.8 Shell Scripts </H2> | |
3692 | <!--docid::SEC57::--> | |
3693 | <P> | |
3694 | ||
3695 | A shell script is a text file containing shell commands. When such | |
3696 | a file is used as the first non-option argument when invoking Bash, | |
3697 | and neither the <SAMP>`-c'</SAMP> nor <SAMP>`-s'</SAMP> option is supplied | |
3698 | (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>), | |
3699 | Bash reads and executes commands from the file, then exits. This | |
3700 | mode of operation creates a non-interactive shell. The shell first | |
3701 | searches for the file in the current directory, and looks in the | |
3702 | directories in <CODE>$PATH</CODE> if not found there. | |
3703 | </P><P> | |
3704 | ||
3705 | When Bash runs | |
3706 | a shell script, it sets the special parameter <CODE>0</CODE> to the name | |
3707 | of the file, rather than the name of the shell, and the positional | |
3708 | parameters are set to the remaining arguments, if any are given. | |
3709 | If no additional arguments are supplied, the positional parameters | |
3710 | are unset. | |
3711 | </P><P> | |
3712 | ||
3713 | A shell script may be made executable by using the <CODE>chmod</CODE> command | |
3714 | to turn on the execute bit. When Bash finds such a file while | |
3715 | searching the <CODE>$PATH</CODE> for a command, it spawns a subshell to | |
3716 | execute it. In other words, executing | |
3717 | <TABLE><tr><td> </td><td class=example><pre>filename <VAR>arguments</VAR> | |
3718 | </pre></td></tr></table>is equivalent to executing | |
3719 | <TABLE><tr><td> </td><td class=example><pre>bash filename <VAR>arguments</VAR> | |
3720 | </pre></td></tr></table></P><P> | |
3721 | ||
3722 | if <CODE>filename</CODE> is an executable shell script. | |
3723 | This subshell reinitializes itself, so that the effect is as if a | |
3724 | new shell had been invoked to interpret the script, with the | |
3725 | exception that the locations of commands remembered by the parent | |
3726 | (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) | |
3727 | are retained by the child. | |
3728 | </P><P> | |
3729 | ||
3730 | Most versions of Unix make this a part of the operating system's command | |
3731 | execution mechanism. If the first line of a script begins with | |
3732 | the two characters <SAMP>`#!'</SAMP>, the remainder of the line specifies | |
3733 | an interpreter for the program. | |
3734 | Thus, you can specify Bash, <CODE>awk</CODE>, Perl, or some other | |
3735 | interpreter and write the rest of the script file in that language. | |
3736 | </P><P> | |
3737 | ||
3738 | The arguments to the interpreter | |
3739 | consist of a single optional argument following the interpreter | |
3740 | name on the first line of the script file, followed by the name of | |
3741 | the script file, followed by the rest of the arguments. Bash | |
3742 | will perform this action on operating systems that do not handle it | |
3743 | themselves. Note that some older versions of Unix limit the interpreter | |
3744 | name and argument to a maximum of 32 characters. | |
3745 | </P><P> | |
3746 | ||
3747 | Bash scripts often begin with <CODE>#! /bin/bash</CODE> (assuming that | |
3748 | Bash has been installed in <TT>`/bin'</TT>), since this ensures that | |
3749 | Bash will be used to interpret the script, even if it is executed | |
3750 | under another shell. | |
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"> < </A>]</TD> | |
3758 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> > </A>]</TD> | |
3759 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD> | |
3760 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
3761 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD> | |
3762 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3763 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3764 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3765 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </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> </TD><TD ALIGN="left" VALIGN="TOP">Table of builtins specific to Bash.</TD></TR> | |
3775 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC61">4.3 Modifying Shell Behavior</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtins to modify shell attributes and | |
3776 | optional behavior.</TD></TR> | |
3777 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC64">4.4 Special Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands classified specially by | |
3778 | POSIX.</TD></TR> | |
3779 | </TABLE></BLOCKQUOTE> | |
3780 | <P> | |
3781 | ||
3782 | Builtin commands are contained within the shell itself. | |
3783 | When the name of a builtin command is used as the first word of | |
3784 | a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>), the shell executes | |
3785 | the command directly, without invoking another program. | |
3786 | Builtin commands are necessary to implement functionality impossible | |
3787 | or inconvenient to obtain with separate utilities. | |
3788 | </P><P> | |
3789 | ||
3790 | This section briefly describes the builtins which Bash inherits from | |
3791 | the Bourne Shell, as well as the builtin commands which are unique | |
3792 | to or have been extended in Bash. | |
3793 | </P><P> | |
3794 | ||
3795 | Several builtin commands are described in other chapters: builtin | |
3796 | commands which provide the Bash interface to the job control | |
3797 | facilities (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>), the directory stack | |
3798 | (see section <A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A>), the command history | |
3799 | (see section <A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A>), and the programmable completion | |
3800 | facilities (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>). | |
3801 | </P><P> | |
3802 | ||
3803 | Many of the builtins have been extended by POSIX or Bash. | |
3804 | </P><P> | |
3805 | ||
3806 | Unless otherwise noted, each builtin command documented as accepting | |
3807 | options preceded by <SAMP>`-'</SAMP> accepts <SAMP>`--'</SAMP> | |
3808 | to signify the end of the options. | |
0001803f CR |
3809 | The <CODE>:</CODE>, <CODE>true</CODE>, <CODE>false</CODE>, and <CODE>test</CODE> |
3810 | builtins do not accept options and do not treat <SAMP>`--'</SAMP> specially. | |
3811 | The <CODE>exit</CODE>, <CODE>logout</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, <CODE>let</CODE>, | |
3812 | and <CODE>shift</CODE> builtins accept and process arguments beginning | |
3813 | with <SAMP>`-'</SAMP> without requiring <SAMP>`--'</SAMP>. | |
3814 | Other builtins that accept arguments but are not specified as accepting | |
3815 | options interpret arguments beginning with <SAMP>`-'</SAMP> as invalid options and | |
3816 | require <SAMP>`--'</SAMP> to prevent this interpretation. | |
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"> < </A>]</TD> | |
3824 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> > </A>]</TD> | |
3825 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD> | |
3826 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD> | |
3827 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD> | |
3828 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3829 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3830 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3831 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3832 | </TR></TABLE> | |
3833 | <H2> 4.1 Bourne Shell Builtins </H2> | |
3834 | <!--docid::SEC59::--> | |
3835 | <P> | |
3836 | ||
3837 | The following shell builtin commands are inherited from the Bourne Shell. | |
3838 | These 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> </td><td class=example><pre>: [<VAR>arguments</VAR>] | |
3845 | </pre></td></tr></table>Do nothing beyond expanding <VAR>arguments</VAR> and performing redirections. | |
3846 | The return status is zero. | |
3847 | <P> | |
3848 | ||
3849 | <DT><CODE>. (a period)</CODE> | |
3850 | <DD><A NAME="IDX69"></A> | |
3851 | <TABLE><tr><td> </td><td class=example><pre>. <VAR>filename</VAR> [<VAR>arguments</VAR>] | |
3852 | </pre></td></tr></table>Read and execute commands from the <VAR>filename</VAR> argument in the | |
3853 | current shell context. If <VAR>filename</VAR> does not contain a slash, | |
3854 | the <CODE>PATH</CODE> variable is used to find <VAR>filename</VAR>. | |
3855 | When Bash is not in POSIX mode, the current directory is searched | |
3856 | if <VAR>filename</VAR> is not found in <CODE>$PATH</CODE>. | |
3857 | If any <VAR>arguments</VAR> are supplied, they become the positional | |
3858 | parameters when <VAR>filename</VAR> is executed. Otherwise the positional | |
3859 | parameters are unchanged. | |
3860 | The return status is the exit status of the last command executed, or | |
3861 | zero if no commands are executed. If <VAR>filename</VAR> is not found, or | |
3862 | cannot be read, the return status is non-zero. | |
3863 | This builtin is equivalent to <CODE>source</CODE>. | |
3864 | <P> | |
3865 | ||
3866 | <DT><CODE>break</CODE> | |
3867 | <DD><A NAME="IDX70"></A> | |
3868 | <TABLE><tr><td> </td><td class=example><pre>break [<VAR>n</VAR>] | |
3869 | </pre></td></tr></table>Exit from a <CODE>for</CODE>, <CODE>while</CODE>, <CODE>until</CODE>, or <CODE>select</CODE> loop. | |
3870 | If <VAR>n</VAR> is supplied, the <VAR>n</VAR>th enclosing loop is exited. | |
3871 | <VAR>n</VAR> must be greater than or equal to 1. | |
3872 | The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1. | |
3873 | <P> | |
3874 | ||
3875 | <DT><CODE>cd</CODE> | |
3876 | <DD><A NAME="IDX71"></A> | |
3877 | <TABLE><tr><td> </td><td class=example><pre>cd [-L|-P] [<VAR>directory</VAR>] | |
3878 | </pre></td></tr></table>Change the current working directory to <VAR>directory</VAR>. | |
3879 | If <VAR>directory</VAR> is not given, the value of the <CODE>HOME</CODE> shell | |
3880 | variable is used. | |
3881 | If the shell variable <CODE>CDPATH</CODE> exists, it is used as a search path. | |
3882 | If <VAR>directory</VAR> begins with a slash, <CODE>CDPATH</CODE> is not used. | |
3883 | <P> | |
3884 | ||
3885 | The <SAMP>`-P'</SAMP> option means to not follow symbolic links; symbolic | |
3886 | links are followed by default or with the <SAMP>`-L'</SAMP> option. | |
3887 | If <VAR>directory</VAR> is <SAMP>`-'</SAMP>, it is equivalent to <CODE>$OLDPWD</CODE>. | |
3888 | </P><P> | |
3889 | ||
3890 | If a non-empty directory name from <CODE>CDPATH</CODE> is used, or if | |
3891 | <SAMP>`-'</SAMP> is the first argument, and the directory change is | |
3892 | successful, the absolute pathname of the new working directory is | |
3893 | written to the standard output. | |
3894 | </P><P> | |
3895 | ||
3896 | The return status is zero if the directory is successfully changed, | |
3897 | non-zero otherwise. | |
3898 | </P><P> | |
3899 | ||
3900 | <DT><CODE>continue</CODE> | |
3901 | <DD><A NAME="IDX72"></A> | |
3902 | <TABLE><tr><td> </td><td class=example><pre>continue [<VAR>n</VAR>] | |
3903 | </pre></td></tr></table>Resume the next iteration of an enclosing <CODE>for</CODE>, <CODE>while</CODE>, | |
3904 | <CODE>until</CODE>, or <CODE>select</CODE> loop. | |
3905 | If <VAR>n</VAR> is supplied, the execution of the <VAR>n</VAR>th enclosing loop | |
3906 | is resumed. | |
3907 | <VAR>n</VAR> must be greater than or equal to 1. | |
3908 | The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1. | |
3909 | <P> | |
3910 | ||
3911 | <DT><CODE>eval</CODE> | |
3912 | <DD><A NAME="IDX73"></A> | |
3913 | <TABLE><tr><td> </td><td class=example><pre>eval [<VAR>arguments</VAR>] | |
3914 | </pre></td></tr></table>The arguments are concatenated together into a single command, which is | |
3915 | then read and executed, and its exit status returned as the exit status | |
3916 | of <CODE>eval</CODE>. | |
3917 | If there are no arguments or only empty arguments, the return status is | |
3918 | zero. | |
3919 | <P> | |
3920 | ||
3921 | <DT><CODE>exec</CODE> | |
3922 | <DD><A NAME="IDX74"></A> | |
3923 | <TABLE><tr><td> </td><td class=example><pre>exec [-cl] [-a <VAR>name</VAR>] [<VAR>command</VAR> [<VAR>arguments</VAR>]] | |
3924 | </pre></td></tr></table>If <VAR>command</VAR> | |
3925 | is supplied, it replaces the shell without creating a new process. | |
3926 | If the <SAMP>`-l'</SAMP> option is supplied, the shell places a dash at the | |
3927 | beginning of the zeroth argument passed to <VAR>command</VAR>. | |
3928 | This is what the <CODE>login</CODE> program does. | |
3929 | The <SAMP>`-c'</SAMP> option causes <VAR>command</VAR> to be executed with an empty | |
3930 | environment. | |
3931 | If <SAMP>`-a'</SAMP> is supplied, the shell passes <VAR>name</VAR> as the zeroth | |
3932 | argument to <VAR>command</VAR>. | |
3933 | If no <VAR>command</VAR> is specified, redirections may be used to affect | |
3934 | the current shell environment. If there are no redirection errors, the | |
3935 | return status is zero; otherwise the return status is non-zero. | |
3936 | <P> | |
3937 | ||
3938 | <DT><CODE>exit</CODE> | |
3939 | <DD><A NAME="IDX75"></A> | |
3940 | <TABLE><tr><td> </td><td class=example><pre>exit [<VAR>n</VAR>] | |
3941 | </pre></td></tr></table>Exit the shell, returning a status of <VAR>n</VAR> to the shell's parent. | |
3942 | If <VAR>n</VAR> is omitted, the exit status is that of the last command executed. | |
3943 | Any trap on <CODE>EXIT</CODE> is executed before the shell terminates. | |
3944 | <P> | |
3945 | ||
3946 | <DT><CODE>export</CODE> | |
3947 | <DD><A NAME="IDX76"></A> | |
3948 | <TABLE><tr><td> </td><td class=example><pre>export [-fn] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]] | |
3949 | </pre></td></tr></table>Mark each <VAR>name</VAR> to be passed to child processes | |
3950 | in the environment. If the <SAMP>`-f'</SAMP> option is supplied, the <VAR>name</VAR>s | |
3951 | refer to shell functions; otherwise the names refer to shell variables. | |
3952 | The <SAMP>`-n'</SAMP> option means to no longer mark each <VAR>name</VAR> for export. | |
3953 | If no <VAR>names</VAR> are supplied, or if the <SAMP>`-p'</SAMP> option is given, a | |
3954 | list of exported names is displayed. | |
3955 | The <SAMP>`-p'</SAMP> option displays output in a form that may be reused as input. | |
3956 | If a variable name is followed by =<VAR>value</VAR>, the value of | |
3957 | the variable is set to <VAR>value</VAR>. | |
3958 | <P> | |
3959 | ||
3960 | The return status is zero unless an invalid option is supplied, one of | |
3961 | the names is not a valid shell variable name, or <SAMP>`-f'</SAMP> is supplied | |
3962 | with a name that is not a shell function. | |
3963 | </P><P> | |
3964 | ||
3965 | <DT><CODE>getopts</CODE> | |
3966 | <DD><A NAME="IDX77"></A> | |
3967 | <TABLE><tr><td> </td><td class=example><pre>getopts <VAR>optstring</VAR> <VAR>name</VAR> [<VAR>args</VAR>] | |
3968 | </pre></td></tr></table><CODE>getopts</CODE> is used by shell scripts to parse positional parameters. | |
3969 | <VAR>optstring</VAR> contains the option characters to be recognized; if a | |
3970 | character is followed by a colon, the option is expected to have an | |
3971 | argument, which should be separated from it by white space. | |
3972 | The colon (<SAMP>`:'</SAMP>) and question mark (<SAMP>`?'</SAMP>) may not be | |
3973 | used as option characters. | |
3974 | Each time it is invoked, <CODE>getopts</CODE> | |
3975 | places the next option in the shell variable <VAR>name</VAR>, initializing | |
3976 | <VAR>name</VAR> if it does not exist, | |
3977 | and the index of the next argument to be processed into the | |
3978 | variable <CODE>OPTIND</CODE>. | |
3979 | <CODE>OPTIND</CODE> is initialized to 1 each time the shell or a shell script | |
3980 | is invoked. | |
3981 | When an option requires an argument, | |
3982 | <CODE>getopts</CODE> places that argument into the variable <CODE>OPTARG</CODE>. | |
3983 | The shell does not reset <CODE>OPTIND</CODE> automatically; it must be manually | |
3984 | reset between multiple calls to <CODE>getopts</CODE> within the same shell | |
3985 | invocation if a new set of parameters is to be used. | |
3986 | <P> | |
3987 | ||
3988 | When the end of options is encountered, <CODE>getopts</CODE> exits with a | |
3989 | return value greater than zero. | |
3990 | <CODE>OPTIND</CODE> is set to the index of the first non-option argument, | |
3991 | and <CODE>name</CODE> is set to <SAMP>`?'</SAMP>. | |
3992 | </P><P> | |
3993 | ||
3994 | <CODE>getopts</CODE> | |
3995 | normally parses the positional parameters, but if more arguments are | |
3996 | given in <VAR>args</VAR>, <CODE>getopts</CODE> parses those instead. | |
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> | |
4001 | error reporting is used. In normal operation diagnostic messages | |
4002 | are printed when invalid options or missing option arguments are | |
4003 | encountered. | |
4004 | If the variable <CODE>OPTERR</CODE> | |
4005 | is set to 0, no error messages will be displayed, even if the first | |
4006 | character of <CODE>optstring</CODE> is not a colon. | |
4007 | </P><P> | |
4008 | ||
4009 | If an invalid option is seen, | |
4010 | <CODE>getopts</CODE> places <SAMP>`?'</SAMP> into <VAR>name</VAR> and, if not silent, | |
4011 | prints an error message and unsets <CODE>OPTARG</CODE>. | |
4012 | If <CODE>getopts</CODE> is silent, the option character found is placed in | |
4013 | <CODE>OPTARG</CODE> and no diagnostic message is printed. | |
4014 | </P><P> | |
4015 | ||
4016 | If a required argument is not found, and <CODE>getopts</CODE> | |
4017 | is not silent, a question mark (<SAMP>`?'</SAMP>) is placed in <VAR>name</VAR>, | |
4018 | <CODE>OPTARG</CODE> is unset, and a diagnostic message is printed. | |
4019 | If <CODE>getopts</CODE> is silent, then a colon (<SAMP>`:'</SAMP>) is placed in | |
4020 | <VAR>name</VAR> and <CODE>OPTARG</CODE> is set to the option character found. | |
4021 | </P><P> | |
4022 | ||
4023 | <DT><CODE>hash</CODE> | |
4024 | <DD><A NAME="IDX78"></A> | |
4025 | <TABLE><tr><td> </td><td class=example><pre>hash [-r] [-p <VAR>filename</VAR>] [-dt] [<VAR>name</VAR>] | |
4026 | </pre></td></tr></table>Remember the full pathnames of commands specified as <VAR>name</VAR> arguments, | |
4027 | so they need not be searched for on subsequent invocations. | |
4028 | The commands are found by searching through the directories listed in | |
4029 | <CODE>$PATH</CODE>. | |
4030 | The <SAMP>`-p'</SAMP> option inhibits the path search, and <VAR>filename</VAR> is | |
4031 | used as the location of <VAR>name</VAR>. | |
4032 | The <SAMP>`-r'</SAMP> option causes the shell to forget all remembered locations. | |
4033 | The <SAMP>`-d'</SAMP> option causes the shell to forget the remembered location | |
4034 | of each <VAR>name</VAR>. | |
4035 | If the <SAMP>`-t'</SAMP> option is supplied, the full pathname to which each | |
4036 | <VAR>name</VAR> corresponds is printed. If multiple <VAR>name</VAR> arguments are | |
4037 | supplied with <SAMP>`-t'</SAMP> the <VAR>name</VAR> is printed before the hashed | |
4038 | full pathname. | |
4039 | The <SAMP>`-l'</SAMP> option causes output to be displayed in a format | |
4040 | that may be reused as input. | |
4041 | If no arguments are given, or if only <SAMP>`-l'</SAMP> is supplied, | |
4042 | information about remembered commands is printed. | |
4043 | The return status is zero unless a <VAR>name</VAR> is not found or an invalid | |
4044 | option is supplied. | |
4045 | <P> | |
4046 | ||
4047 | <DT><CODE>pwd</CODE> | |
4048 | <DD><A NAME="IDX79"></A> | |
4049 | <TABLE><tr><td> </td><td class=example><pre>pwd [-LP] | |
4050 | </pre></td></tr></table>Print the absolute pathname of the current working directory. | |
4051 | If the <SAMP>`-P'</SAMP> option is supplied, the pathname printed will not | |
4052 | contain symbolic links. | |
4053 | If the <SAMP>`-L'</SAMP> option is supplied, the pathname printed may contain | |
4054 | symbolic links. | |
4055 | The return status is zero unless an error is encountered while | |
4056 | determining the name of the current directory or an invalid option | |
4057 | is supplied. | |
4058 | <P> | |
4059 | ||
4060 | <DT><CODE>readonly</CODE> | |
4061 | <DD><A NAME="IDX80"></A> | |
4062 | <TABLE><tr><td> </td><td class=example><pre>readonly [-aApf] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small> | |
4063 | </pre></td></tr></table>Mark each <VAR>name</VAR> as readonly. | |
4064 | The values of these names may not be changed by subsequent assignment. | |
4065 | If the <SAMP>`-f'</SAMP> option is supplied, each <VAR>name</VAR> refers to a shell | |
4066 | function. | |
4067 | The <SAMP>`-a'</SAMP> option means each <VAR>name</VAR> refers to an indexed | |
4068 | array variable; the <SAMP>`-A'</SAMP> option means each <VAR>name</VAR> refers | |
4069 | to an associative array variable. | |
4070 | If no <VAR>name</VAR> arguments are given, or if the <SAMP>`-p'</SAMP> | |
4071 | option is supplied, a list of all readonly names is printed. | |
4072 | The <SAMP>`-p'</SAMP> option causes output to be displayed in a format that | |
4073 | may be reused as input. | |
4074 | If a variable name is followed by =<VAR>value</VAR>, the value of | |
4075 | the variable is set to <VAR>value</VAR>. | |
4076 | The return status is zero unless an invalid option is supplied, one of | |
4077 | the <VAR>name</VAR> arguments is not a valid shell variable or function name, | |
4078 | or the <SAMP>`-f'</SAMP> option is supplied with a name that is not a shell function. | |
4079 | <P> | |
4080 | ||
4081 | <DT><CODE>return</CODE> | |
4082 | <DD><A NAME="IDX81"></A> | |
4083 | <TABLE><tr><td> </td><td class=example><pre>return [<VAR>n</VAR>] | |
4084 | </pre></td></tr></table>Cause a shell function to exit with the return value <VAR>n</VAR>. | |
4085 | If <VAR>n</VAR> is not supplied, the return value is the exit status of the | |
4086 | last command executed in the function. | |
4087 | This may also be used to terminate execution of a script being executed | |
4088 | with the <CODE>.</CODE> (or <CODE>source</CODE>) builtin, returning either <VAR>n</VAR> or | |
4089 | the exit status of the last command executed within the script as the exit | |
4090 | status of the script. | |
4091 | Any command associated with the <CODE>RETURN</CODE> trap is executed | |
4092 | before execution resumes after the function or script. | |
4093 | The return status is non-zero if <CODE>return</CODE> is used outside a function | |
4094 | and not during the execution of a script by <CODE>.</CODE> or <CODE>source</CODE>. | |
4095 | <P> | |
4096 | ||
4097 | <DT><CODE>shift</CODE> | |
4098 | <DD><A NAME="IDX82"></A> | |
4099 | <TABLE><tr><td> </td><td class=example><pre>shift [<VAR>n</VAR>] | |
4100 | </pre></td></tr></table>Shift the positional parameters to the left by <VAR>n</VAR>. | |
4101 | The positional parameters from <VAR>n</VAR>+1 <small>...</small> <CODE>$#</CODE> are | |
4102 | renamed to <CODE>$1</CODE> <small>...</small> <CODE>$#</CODE>-<VAR>n</VAR>. | |
4103 | Parameters represented by the numbers <CODE>$#</CODE> to <CODE>$#</CODE>-<VAR>n</VAR>+1 | |
4104 | are unset. | |
4105 | <VAR>n</VAR> must be a non-negative number less than or equal to <CODE>$#</CODE>. | |
4106 | If <VAR>n</VAR> is zero or greater than <CODE>$#</CODE>, the positional parameters | |
4107 | are not changed. | |
4108 | If <VAR>n</VAR> is not supplied, it is assumed to be 1. | |
4109 | The return status is zero unless <VAR>n</VAR> is greater than <CODE>$#</CODE> or | |
4110 | less than zero, non-zero otherwise. | |
4111 | <P> | |
4112 | ||
4113 | <DT><CODE>test</CODE> | |
4114 | <DD><DT><CODE>[</CODE> | |
4115 | <DD><A NAME="IDX83"></A> | |
4116 | <A NAME="IDX84"></A> | |
4117 | Evaluate a conditional expression <VAR>expr</VAR>. | |
4118 | Each operator and operand must be a separate argument. | |
4119 | Expressions are composed of the primaries described below in | |
4120 | <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>. | |
4121 | <CODE>test</CODE> does not accept any options, nor does it accept and ignore | |
4122 | an argument of <SAMP>`--'</SAMP> as signifying the end of options. | |
4123 | <P> | |
4124 | ||
4125 | When the <CODE>[</CODE> form is used, the last argument to the command must | |
4126 | be a <CODE>]</CODE>. | |
4127 | </P><P> | |
4128 | ||
4129 | Expressions may be combined using the following operators, listed in | |
4130 | decreasing order of precedence. | |
4131 | The evaluation depends on the number of arguments; see below. | |
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>. | |
4141 | This 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 | ||
4153 | The <CODE>test</CODE> and <CODE>[</CODE> builtins evaluate conditional | |
4154 | expressions 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 | |
4168 | only if the second argument is null. | |
4169 | If the first argument is one of the unary conditional operators | |
4170 | (see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the expression | |
4171 | is true if the unary test is true. | |
4172 | If the first argument is not a valid unary operator, the expression is | |
4173 | false. | |
4174 | <P> | |
4175 | ||
4176 | <DT>3 arguments | |
4177 | <DD>If the second argument is one of the binary conditional | |
4178 | operators (see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the | |
4179 | result of the expression is the result of the binary test using the | |
4180 | first and third arguments as operands. | |
4181 | The <SAMP>`-a'</SAMP> and <SAMP>`-o'</SAMP> operators are considered binary operators | |
4182 | when there are three arguments. | |
4183 | If the first argument is <SAMP>`!'</SAMP>, the value is the negation of | |
4184 | the two-argument test using the second and third arguments. | |
4185 | If the first argument is exactly <SAMP>`('</SAMP> and the third argument is | |
4186 | exactly <SAMP>`)'</SAMP>, the result is the one-argument test of the second | |
4187 | argument. | |
4188 | Otherwise, 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 | |
4193 | the three-argument expression composed of the remaining arguments. | |
4194 | Otherwise, the expression is parsed and evaluated according to | |
4195 | precedence using the rules listed above. | |
4196 | <P> | |
4197 | ||
4198 | <DT>5 or more arguments | |
4199 | <DD>The expression is parsed and evaluated according to precedence | |
4200 | using the rules listed above. | |
4201 | </DL> | |
4202 | <P> | |
4203 | ||
4204 | <DT><CODE>times</CODE> | |
4205 | <DD><A NAME="IDX85"></A> | |
4206 | <TABLE><tr><td> </td><td class=example><pre>times | |
4207 | </pre></td></tr></table>Print out the user and system times used by the shell and its children. | |
4208 | The return status is zero. | |
4209 | <P> | |
4210 | ||
4211 | <DT><CODE>trap</CODE> | |
4212 | <DD><A NAME="IDX86"></A> | |
4213 | <TABLE><tr><td> </td><td class=example><pre>trap [-lp] [<VAR>arg</VAR>] [<VAR>sigspec</VAR> <small>...</small>] | |
4214 | </pre></td></tr></table>The commands in <VAR>arg</VAR> are to be read and executed when the | |
4215 | shell receives signal <VAR>sigspec</VAR>. If <VAR>arg</VAR> is absent (and | |
4216 | there is a single <VAR>sigspec</VAR>) or | |
4217 | equal to <SAMP>`-'</SAMP>, each specified signal's disposition is reset | |
4218 | to the value it had when the shell was started. | |
4219 | If <VAR>arg</VAR> is the null string, then the signal specified by | |
4220 | each <VAR>sigspec</VAR> is ignored by the shell and commands it invokes. | |
4221 | If <VAR>arg</VAR> is not present and <SAMP>`-p'</SAMP> has been supplied, | |
4222 | the shell displays the trap commands associated with each <VAR>sigspec</VAR>. | |
4223 | If no arguments are supplied, or | |
4224 | only <SAMP>`-p'</SAMP> is given, <CODE>trap</CODE> prints the list of commands | |
4225 | associated with each signal number in a form that may be reused as | |
4226 | shell input. | |
4227 | The <SAMP>`-l'</SAMP> option causes the shell to print a list of signal names | |
4228 | and their corresponding numbers. | |
4229 | Each <VAR>sigspec</VAR> is either a signal name or a signal number. | |
4230 | Signal names are case insensitive and the <CODE>SIG</CODE> prefix is optional. | |
0001803f CR |
4231 | <P> |
4232 | ||
17345e5a JA |
4233 | If a <VAR>sigspec</VAR> |
4234 | is <CODE>0</CODE> or <CODE>EXIT</CODE>, <VAR>arg</VAR> is executed when the shell exits. | |
4235 | If a <VAR>sigspec</VAR> is <CODE>DEBUG</CODE>, the command <VAR>arg</VAR> is executed | |
4236 | before every simple command, <CODE>for</CODE> command, <CODE>case</CODE> command, | |
4237 | <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before | |
4238 | the first command executes in a shell function. | |
0001803f | 4239 | Refer 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 |
4241 | effect on the <CODE>DEBUG</CODE> trap. | |
0001803f CR |
4242 | If a <VAR>sigspec</VAR> is <CODE>RETURN</CODE>, the command <VAR>arg</VAR> is executed |
4243 | each time a shell function or a script executed with the <CODE>.</CODE> or | |
4244 | <CODE>source</CODE> builtins finishes executing. | |
4245 | </P><P> | |
4246 | ||
17345e5a JA |
4247 | If a <VAR>sigspec</VAR> is <CODE>ERR</CODE>, the command <VAR>arg</VAR> |
4248 | is executed whenever a simple command has a non-zero exit status, | |
4249 | subject to the following conditions. | |
4250 | The <CODE>ERR</CODE> trap is not executed if the failed command is part of the | |
4251 | command list immediately following an <CODE>until</CODE> or <CODE>while</CODE> keyword, | |
0001803f | 4252 | part of the test following the <CODE>if</CODE> or <CODE>elif</CODE> reserved words, |
17345e5a JA |
4253 | part of a command executed in a <CODE>&&</CODE> or <CODE>||</CODE> list, |
4254 | or if the command's return | |
4255 | status is being inverted using <CODE>!</CODE>. | |
4256 | These are the same conditions obeyed by the <CODE>errexit</CODE> option. | |
0001803f | 4257 | </P><P> |
17345e5a JA |
4258 | |
4259 | Signals ignored upon entry to the shell cannot be trapped or reset. | |
4260 | Trapped signals that are not being ignored are reset to their original | |
0001803f | 4261 | values in a subshell or subshell environment when one is created. |
17345e5a JA |
4262 | </P><P> |
4263 | ||
4264 | The return status is zero unless a <VAR>sigspec</VAR> does not specify a | |
4265 | valid signal. | |
4266 | </P><P> | |
4267 | ||
4268 | <DT><CODE>umask</CODE> | |
4269 | <DD><A NAME="IDX87"></A> | |
4270 | <TABLE><tr><td> </td><td class=example><pre>umask [-p] [-S] [<VAR>mode</VAR>] | |
4271 | </pre></td></tr></table>Set the shell process's file creation mask to <VAR>mode</VAR>. If | |
4272 | <VAR>mode</VAR> begins with a digit, it is interpreted as an octal number; | |
4273 | if not, it is interpreted as a symbolic mode mask similar | |
4274 | to that accepted by the <CODE>chmod</CODE> command. If <VAR>mode</VAR> is | |
4275 | omitted, the current value of the mask is printed. If the <SAMP>`-S'</SAMP> | |
4276 | option is supplied without a <VAR>mode</VAR> argument, the mask is printed | |
4277 | in a symbolic format. | |
4278 | If the <SAMP>`-p'</SAMP> option is supplied, and <VAR>mode</VAR> | |
4279 | is omitted, the output is in a form that may be reused as input. | |
4280 | The return status is zero if the mode is successfully changed or if | |
4281 | no <VAR>mode</VAR> argument is supplied, and non-zero otherwise. | |
4282 | <P> | |
4283 | ||
4284 | Note that when the mode is interpreted as an octal number, each number | |
4285 | of the umask is subtracted from <CODE>7</CODE>. Thus, a umask of <CODE>022</CODE> | |
4286 | results in permissions of <CODE>755</CODE>. | |
4287 | </P><P> | |
4288 | ||
4289 | <DT><CODE>unset</CODE> | |
4290 | <DD><A NAME="IDX88"></A> | |
4291 | <TABLE><tr><td> </td><td class=example><pre>unset [-fv] [<VAR>name</VAR>] | |
4292 | </pre></td></tr></table>Each variable or function <VAR>name</VAR> is removed. | |
4293 | If no options are supplied, or the <SAMP>`-v'</SAMP> option is given, each | |
4294 | <VAR>name</VAR> refers to a shell variable. | |
4295 | If the <SAMP>`-f'</SAMP> option is given, the <VAR>name</VAR>s refer to shell | |
4296 | functions, and the function definition is removed. | |
4297 | Readonly variables and functions may not be unset. | |
4298 | The return status is zero unless a <VAR>name</VAR> is readonly. | |
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"> < </A>]</TD> | |
4307 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> > </A>]</TD> | |
4308 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> << </A>]</TD> | |
4309 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD> | |
4310 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD> | |
4311 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
4312 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
4313 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
4314 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
4315 | </TR></TABLE> | |
4316 | <H2> 4.2 Bash Builtin Commands </H2> | |
4317 | <!--docid::SEC60::--> | |
4318 | <P> | |
4319 | ||
4320 | This section describes builtin commands which are unique to | |
4321 | or have been extended in Bash. | |
4322 | Some of these commands are specified in the POSIX standard. | |
4323 | </P><P> | |
4324 | ||
4325 | <DL COMPACT> | |
4326 | ||
4327 | <DT><CODE>alias</CODE> | |
4328 | <DD><A NAME="IDX89"></A> | |
4329 | <TABLE><tr><td> </td><td class=example><pre>alias [<CODE>-p</CODE>] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>] | |
4330 | </pre></td></tr></table><P> | |
4331 | ||
4332 | Without arguments or with the <SAMP>`-p'</SAMP> option, <CODE>alias</CODE> prints | |
4333 | the list of aliases on the standard output in a form that allows | |
4334 | them to be reused as input. | |
4335 | If arguments are supplied, an alias is defined for each <VAR>name</VAR> | |
4336 | whose <VAR>value</VAR> is given. If no <VAR>value</VAR> is given, the name | |
4337 | and value of the alias is printed. | |
4338 | Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>. | |
4339 | </P><P> | |
4340 | ||
4341 | <DT><CODE>bind</CODE> | |
4342 | <DD><A NAME="IDX90"></A> | |
4343 | <TABLE><tr><td> </td><td class=example><pre>bind [-m <VAR>keymap</VAR>] [-lpsvPSV] | |
4344 | bind [-m <VAR>keymap</VAR>] [-q <VAR>function</VAR>] [-u <VAR>function</VAR>] [-r <VAR>keyseq</VAR>] | |
4345 | bind [-m <VAR>keymap</VAR>] -f <VAR>filename</VAR> | |
4346 | bind [-m <VAR>keymap</VAR>] -x <VAR>keyseq:shell-command</VAR> | |
4347 | bind [-m <VAR>keymap</VAR>] <VAR>keyseq:function-name</VAR> | |
4348 | bind <VAR>readline-command</VAR> | |
4349 | </pre></td></tr></table><P> | |
4350 | ||
4351 | Display current Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) | |
4352 | key and function bindings, | |
4353 | bind a key sequence to a Readline function or macro, | |
4354 | or set a Readline variable. | |
4355 | Each non-option argument is a command as it would appear in a | |
4356 | Readline initialization file (see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>), | |
4357 | but each binding or command must be passed as a separate argument; e.g., | |
4358 | <SAMP>`"\C-x\C-r":re-read-init-file'</SAMP>. | |
4359 | </P><P> | |
4360 | ||
4361 | Options, 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 | |
4367 | the subsequent bindings. Acceptable <VAR>keymap</VAR> | |
4368 | names 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 | |
4387 | can 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 | |
4396 | can 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 | |
4405 | in such a way that they can be used as input or in a Readline | |
4406 | initialization 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 | |
4431 | entered. | |
4432 | When <VAR>shell-command</VAR> is executed, the shell sets the | |
4433 | <CODE>READLINE_LINE</CODE> variable to the contents of the Readline line | |
4434 | buffer and the <CODE>READLINE_POINT</CODE> variable to the current location | |
4435 | of the insertion point. | |
4436 | If the executed command changes the value of <CODE>READLINE_LINE</CODE> or | |
4437 | <CODE>READLINE_POINT</CODE>, those new values will be reflected in the | |
4438 | editing state. | |
4439 | </DL> | |
4440 | <P> | |
4441 | ||
4442 | The return status is zero unless an invalid option is supplied or an | |
4443 | error occurs. | |
4444 | </P><P> | |
4445 | ||
4446 | <DT><CODE>builtin</CODE> | |
4447 | <DD><A NAME="IDX91"></A> | |
4448 | <TABLE><tr><td> </td><td class=example><pre>builtin [<VAR>shell-builtin</VAR> [<VAR>args</VAR>]] | |
4449 | </pre></td></tr></table>Run a shell builtin, passing it <VAR>args</VAR>, and return its exit status. | |
4450 | This is useful when defining a shell function with the same | |
4451 | name as a shell builtin, retaining the functionality of the builtin within | |
4452 | the function. | |
4453 | The return status is non-zero if <VAR>shell-builtin</VAR> is not a shell | |
4454 | builtin command. | |
4455 | <P> | |
4456 | ||
4457 | <DT><CODE>caller</CODE> | |
4458 | <DD><A NAME="IDX92"></A> | |
4459 | <TABLE><tr><td> </td><td class=example><pre>caller [<VAR>expr</VAR>] | |
4460 | </pre></td></tr></table>Returns the context of any active subroutine call (a shell function or | |
4461 | a script executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins). | |
4462 | <P> | |
4463 | ||
4464 | Without <VAR>expr</VAR>, <CODE>caller</CODE> displays the line number and source | |
4465 | filename of the current subroutine call. | |
4466 | If a non-negative integer is supplied as <VAR>expr</VAR>, <CODE>caller</CODE> | |
4467 | displays the line number, subroutine name, and source file corresponding | |
4468 | to that position in the current execution call stack. This extra | |
4469 | information may be used, for example, to print a stack trace. The | |
4470 | current frame is frame 0. | |
4471 | </P><P> | |
4472 | ||
4473 | The return value is 0 unless the shell is not executing a subroutine | |
4474 | call or <VAR>expr</VAR> does not correspond to a valid position in the | |
4475 | call stack. | |
4476 | </P><P> | |
4477 | ||
4478 | <DT><CODE>command</CODE> | |
4479 | <DD><A NAME="IDX93"></A> | |
4480 | <TABLE><tr><td> </td><td class=example><pre>command [-pVv] <VAR>command</VAR> [<VAR>arguments</VAR> <small>...</small>] | |
4481 | </pre></td></tr></table>Runs <VAR>command</VAR> with <VAR>arguments</VAR> ignoring any shell function | |
4482 | named <VAR>command</VAR>. | |
4483 | Only shell builtin commands or commands found by searching the | |
4484 | <CODE>PATH</CODE> are executed. | |
4485 | If there is a shell function named <CODE>ls</CODE>, running <SAMP>`command ls'</SAMP> | |
4486 | within the function will execute the external command <CODE>ls</CODE> | |
4487 | instead of calling the function recursively. | |
4488 | The <SAMP>`-p'</SAMP> option means to use a default value for <CODE>PATH</CODE> | |
4489 | that is guaranteed to find all of the standard utilities. | |
4490 | The return status in this case is 127 if <VAR>command</VAR> cannot be | |
4491 | found or an error occurred, and the exit status of <VAR>command</VAR> | |
4492 | otherwise. | |
4493 | <P> | |
4494 | ||
4495 | If either the <SAMP>`-V'</SAMP> or <SAMP>`-v'</SAMP> option is supplied, a | |
4496 | description of <VAR>command</VAR> is printed. The <SAMP>`-v'</SAMP> option | |
4497 | causes a single word indicating the command or file name used to | |
4498 | invoke <VAR>command</VAR> to be displayed; the <SAMP>`-V'</SAMP> option produces | |
4499 | a more verbose description. In this case, the return status is | |
4500 | zero if <VAR>command</VAR> is found, and non-zero if not. | |
4501 | </P><P> | |
4502 | ||
4503 | <DT><CODE>declare</CODE> | |
4504 | <DD><A NAME="IDX94"></A> | |
4505 | <TABLE><tr><td> </td><td class=example><pre>declare [-aAfFilrtux] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>] | |
4506 | </pre></td></tr></table><P> | |
4507 | ||
4508 | Declare variables and give them attributes. If no <VAR>name</VAR>s | |
4509 | are given, then display the values of variables instead. | |
4510 | </P><P> | |
4511 | ||
4512 | The <SAMP>`-p'</SAMP> option will display the attributes and values of each | |
4513 | <VAR>name</VAR>. | |
4514 | When <SAMP>`-p'</SAMP> is used with <VAR>name</VAR> arguments, additional options | |
4515 | are ignored. | |
4516 | </P><P> | |
4517 | ||
4518 | When <SAMP>`-p'</SAMP> is supplied without <VAR>name</VAR> arguments, <CODE>declare</CODE> | |
4519 | will display the attributes and values of all variables having the | |
4520 | attributes specified by the additional options. | |
4521 | If no other options are supplied with <SAMP>`-p'</SAMP>, <CODE>declare</CODE> will | |
4522 | display the attributes and values of all shell variables. The <SAMP>`-f'</SAMP> | |
4523 | option will restrict the display to shell functions. | |
4524 | </P><P> | |
4525 | ||
4526 | The <SAMP>`-F'</SAMP> option inhibits the display of function definitions; | |
4527 | only the function name and attributes are printed. | |
4528 | If the <CODE>extdebug</CODE> shell option is enabled using <CODE>shopt</CODE> | |
4529 | (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the source file name and line number where | |
4530 | the function is defined are displayed as well. | |
4531 | <SAMP>`-F'</SAMP> implies <SAMP>`-f'</SAMP>. | |
4532 | The following options can be used to restrict output to variables with | |
4533 | the specified attributes or to give variables attributes: | |
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 | |
4551 | an integer; arithmetic evaluation (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) is | |
4552 | performed when the variable is assigned a value. | |
4553 | <P> | |
4554 | ||
4555 | <DT><CODE>-l</CODE> | |
4556 | <DD>When the variable is assigned a value, all upper-case characters are | |
4557 | converted to lower-case. | |
4558 | The upper-case attribute is disabled. | |
4559 | <P> | |
4560 | ||
4561 | <DT><CODE>-r</CODE> | |
4562 | <DD>Make <VAR>name</VAR>s readonly. These names cannot then be assigned values | |
4563 | by 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. | |
4568 | Traced functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps from | |
4569 | the calling shell. | |
4570 | The 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 | |
4575 | converted to upper-case. | |
4576 | The 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 | |
4581 | the environment. | |
4582 | </DL> | |
4583 | <P> | |
4584 | ||
4585 | Using <SAMP>`+'</SAMP> instead of <SAMP>`-'</SAMP> turns off the attribute instead, | |
4586 | with the exceptions that <SAMP>`+a'</SAMP> | |
4587 | may not be used to destroy an array variable and <SAMP>`+r'</SAMP> will not | |
4588 | remove the readonly attribute. | |
4589 | When used in a function, <CODE>declare</CODE> makes each <VAR>name</VAR> local, | |
4590 | as with the <CODE>local</CODE> command. If a variable name is followed by | |
4591 | =<VAR>value</VAR>, the value of the variable is set to <VAR>value</VAR>. | |
4592 | </P><P> | |
4593 | ||
4594 | The return status is zero unless an invalid option is encountered, | |
4595 | an attempt is made to define a function using <SAMP>`-f foo=bar'</SAMP>, | |
4596 | an attempt is made to assign a value to a readonly variable, | |
4597 | an attempt is made to assign a value to an array variable without | |
4598 | using the compound assignment syntax (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), | |
4599 | one of the <VAR>names</VAR> is not a valid shell variable name, | |
4600 | an attempt is made to turn off readonly status for a readonly variable, | |
4601 | an attempt is made to turn off array status for an array variable, | |
4602 | or an attempt is made to display a non-existent function with <SAMP>`-f'</SAMP>. | |
4603 | </P><P> | |
4604 | ||
4605 | <DT><CODE>echo</CODE> | |
4606 | <DD><A NAME="IDX95"></A> | |
4607 | <TABLE><tr><td> </td><td class=example><pre>echo [-neE] [<VAR>arg</VAR> <small>...</small>] | |
4608 | </pre></td></tr></table>Output the <VAR>arg</VAR>s, separated by spaces, terminated with a | |
4609 | newline. | |
4610 | The return status is always 0. | |
4611 | If <SAMP>`-n'</SAMP> is specified, the trailing newline is suppressed. | |
4612 | If the <SAMP>`-e'</SAMP> option is given, interpretation of the following | |
4613 | backslash-escaped characters is enabled. | |
4614 | The <SAMP>`-E'</SAMP> option disables the interpretation of these escape characters, | |
4615 | even on systems where they are interpreted by default. | |
4616 | The <CODE>xpg_echo</CODE> shell option may be used to | |
4617 | dynamically determine whether or not <CODE>echo</CODE> expands these | |
4618 | escape characters by default. | |
4619 | <CODE>echo</CODE> does not interpret <SAMP>`--'</SAMP> to mean the end of options. | |
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> </td><td class=example><pre>enable [-a] [-dnps] [-f <VAR>filename</VAR>] [<VAR>name</VAR> <small>...</small>] | |
4656 | </pre></td></tr></table>Enable and disable builtin shell commands. | |
4657 | Disabling a builtin allows a disk command which has the same name | |
4658 | as a shell builtin to be executed without specifying a full pathname, | |
4659 | even though the shell normally searches for builtins before disk commands. | |
4660 | If <SAMP>`-n'</SAMP> is used, the <VAR>name</VAR>s become disabled. Otherwise | |
4661 | <VAR>name</VAR>s are enabled. For example, to use the <CODE>test</CODE> binary | |
4662 | found via <CODE>$PATH</CODE> instead of the shell builtin version, type | |
4663 | <SAMP>`enable -n test'</SAMP>. | |
4664 | <P> | |
4665 | ||
4666 | If the <SAMP>`-p'</SAMP> option is supplied, or no <VAR>name</VAR> arguments appear, | |
4667 | a list of shell builtins is printed. With no other arguments, the list | |
4668 | consists of all enabled shell builtins. | |
4669 | The <SAMP>`-a'</SAMP> option means to list | |
4670 | each builtin with an indication of whether or not it is enabled. | |
4671 | </P><P> | |
4672 | ||
4673 | The <SAMP>`-f'</SAMP> option means to load the new builtin command <VAR>name</VAR> | |
4674 | from shared object <VAR>filename</VAR>, on systems that support dynamic loading. | |
4675 | The <SAMP>`-d'</SAMP> option will delete a builtin loaded with <SAMP>`-f'</SAMP>. | |
4676 | </P><P> | |
4677 | ||
4678 | If there are no options, a list of the shell builtins is displayed. | |
4679 | The <SAMP>`-s'</SAMP> option restricts <CODE>enable</CODE> to the POSIX special | |
4680 | builtins. If <SAMP>`-s'</SAMP> is used with <SAMP>`-f'</SAMP>, the new builtin becomes | |
4681 | a special builtin (see section <A HREF="bashref.html#SEC64">4.4 Special Builtins</A>). | |
4682 | </P><P> | |
4683 | ||
4684 | The return status is zero unless a <VAR>name</VAR> is not a shell builtin | |
4685 | or there is an error loading a new builtin from a shared object. | |
4686 | </P><P> | |
4687 | ||
4688 | <DT><CODE>help</CODE> | |
4689 | <DD><A NAME="IDX97"></A> | |
4690 | <TABLE><tr><td> </td><td class=example><pre>help [-dms] [<VAR>pattern</VAR>] | |
4691 | </pre></td></tr></table>Display helpful information about builtin commands. | |
4692 | If <VAR>pattern</VAR> is specified, <CODE>help</CODE> gives detailed help | |
4693 | on all commands matching <VAR>pattern</VAR>, otherwise a list of | |
4694 | the builtins is printed. | |
4695 | <P> | |
4696 | ||
4697 | Options, 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 | ||
4710 | The 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> </td><td class=example><pre>let <VAR>expression</VAR> [<VAR>expression</VAR>] | |
4716 | </pre></td></tr></table>The <CODE>let</CODE> builtin allows arithmetic to be performed on shell | |
4717 | variables. Each <VAR>expression</VAR> is evaluated according to the | |
4718 | rules given below in <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>. If the | |
4719 | last <VAR>expression</VAR> evaluates to 0, <CODE>let</CODE> returns 1; | |
4720 | otherwise 0 is returned. | |
4721 | <P> | |
4722 | ||
4723 | <DT><CODE>local</CODE> | |
4724 | <DD><A NAME="IDX99"></A> | |
4725 | <TABLE><tr><td> </td><td class=example><pre>local [<VAR>option</VAR>] <VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small> | |
4726 | </pre></td></tr></table>For each argument, a local variable named <VAR>name</VAR> is created, | |
4727 | and assigned <VAR>value</VAR>. | |
4728 | The <VAR>option</VAR> can be any of the options accepted by <CODE>declare</CODE>. | |
4729 | <CODE>local</CODE> can only be used within a function; it makes the variable | |
4730 | <VAR>name</VAR> have a visible scope restricted to that function and its | |
4731 | children. The return status is zero unless <CODE>local</CODE> is used outside | |
4732 | a function, an invalid <VAR>name</VAR> is supplied, or <VAR>name</VAR> is a | |
4733 | readonly variable. | |
4734 | <P> | |
4735 | ||
4736 | <DT><CODE>logout</CODE> | |
4737 | <DD><A NAME="IDX100"></A> | |
4738 | <TABLE><tr><td> </td><td class=example><pre>logout [<VAR>n</VAR>] | |
4739 | </pre></td></tr></table>Exit a login shell, returning a status of <VAR>n</VAR> to the shell's | |
4740 | parent. | |
4741 | <P> | |
4742 | ||
4743 | <DT><CODE>mapfile</CODE> | |
4744 | <DD><A NAME="IDX101"></A> | |
4745 | <TABLE><tr><td> </td><td class=example><pre>mapfile [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>] [ | |
4746 | -C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>] | |
0001803f | 4747 | </pre></td></tr></table>Read lines from the standard input into the indexed array variable <VAR>array</VAR>, |
17345e5a JA |
4748 | or from file descriptor <VAR>fd</VAR> |
4749 | if the <SAMP>`-u'</SAMP> option is supplied. | |
4750 | The variable <CODE>MAPFILE</CODE> is the default <VAR>array</VAR>. | |
4751 | Options, if supplied, have the following meanings: | |
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>. | |
4758 | The 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. | |
4767 | The <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 | ||
4773 | If <SAMP>`-C'</SAMP> is specified without <SAMP>`-c'</SAMP>, | |
4774 | the default quantum is 5000. | |
4775 | When <VAR>callback</VAR> is evaluated, it is supplied the index of the next | |
4776 | array element to be assigned as an additional argument. | |
4777 | <VAR>callback</VAR> is evaluated after the line is read but before the | |
4778 | array element is assigned. | |
4779 | </P><P> | |
4780 | ||
4781 | If not supplied with an explicit origin, <CODE>mapfile</CODE> will clear <VAR>array</VAR> | |
4782 | before assigning to it. | |
4783 | </P><P> | |
4784 | ||
4785 | <CODE>mapfile</CODE> returns successfully unless an invalid option or option | |
0001803f CR |
4786 | argument is supplied, <VAR>array</VAR> is invalid or unassignable, or <VAR>array</VAR> |
4787 | is 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> </td><td class=example><pre>printf [-v <VAR>var</VAR>] <VAR>format</VAR> [<VAR>arguments</VAR>] | |
4793 | </pre></td></tr></table>Write the formatted <VAR>arguments</VAR> to the standard output under the | |
4794 | control of the <VAR>format</VAR>. | |
4795 | The <VAR>format</VAR> is a character string which contains three types of objects: | |
4796 | plain characters, which are simply copied to standard output, character | |
4797 | escape sequences, which are converted and copied to the standard output, and | |
4798 | format specifications, each of which causes printing of the next successive | |
4799 | <VAR>argument</VAR>. | |
4800 | In addition to the standard <CODE>printf(1)</CODE> formats, <SAMP>`%b'</SAMP> causes | |
4801 | <CODE>printf</CODE> to expand backslash escape sequences in the corresponding | |
4802 | <VAR>argument</VAR>, | |
4803 | (except that <SAMP>`\c'</SAMP> terminates output, backslashes in | |
4804 | <SAMP>`\''</SAMP>, <SAMP>`\"'</SAMP>, and <SAMP>`\?'</SAMP> are not removed, and octal escapes | |
4805 | beginning with <SAMP>`\0'</SAMP> may contain up to four digits), | |
4806 | and <SAMP>`%q'</SAMP> causes <CODE>printf</CODE> to output the | |
4807 | corresponding <VAR>argument</VAR> in a format that can be reused as shell input. | |
4808 | <P> | |
4809 | ||
4810 | The <SAMP>`-v'</SAMP> option causes the output to be assigned to the variable | |
4811 | <VAR>var</VAR> rather than being printed to the standard output. | |
4812 | </P><P> | |
4813 | ||
4814 | The <VAR>format</VAR> is reused as necessary to consume all of the <VAR>arguments</VAR>. | |
4815 | If the <VAR>format</VAR> requires more <VAR>arguments</VAR> than are supplied, the | |
4816 | extra format specifications behave as if a zero value or null string, as | |
4817 | appropriate, had been supplied. The return value is zero on success, | |
4818 | non-zero on failure. | |
4819 | </P><P> | |
4820 | ||
4821 | <DT><CODE>read</CODE> | |
4822 | <DD><A NAME="IDX103"></A> | |
0001803f | 4823 | <TABLE><tr><td> </td><td class=example><pre>read [-ers] [-a <VAR>aname</VAR>] [-d <VAR>delim</VAR>] [-i <VAR>text</VAR>] [-n <VAR>nchars</VAR>] [-N <VAR>nchars</VAR>] [-p <VAR>prompt</VAR>] [-t <VAR>timeout</VAR>] [-u <VAR>fd</VAR>] [<VAR>name</VAR> <small>...</small>] |
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 | |
4826 | is assigned to the first <VAR>name</VAR>, the second word to the second <VAR>name</VAR>, | |
4827 | and so on, with leftover words and their intervening separators assigned | |
4828 | to the last <VAR>name</VAR>. | |
4829 | If there are fewer words read from the input stream than names, | |
4830 | the remaining names are assigned empty values. | |
4831 | The characters in the value of the <CODE>IFS</CODE> variable | |
4832 | are used to split the line into words. | |
4833 | The backslash character <SAMP>`\'</SAMP> may be used to remove any special | |
4834 | meaning for the next character read and for line continuation. | |
4835 | If no names are supplied, the line read is assigned to the | |
4836 | variable <CODE>REPLY</CODE>. | |
4837 | The return code is zero, unless end-of-file is encountered, <CODE>read</CODE> | |
4838 | times out (in which case the return code is greater than 128), or an | |
4839 | invalid file descriptor is supplied as the argument to <SAMP>`-u'</SAMP>. | |
4840 | <P> | |
4841 | ||
4842 | Options, 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. | |
4849 | All elements are removed from <VAR>aname</VAR> before the assignment. | |
4850 | Other <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, | |
4855 | rather 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. | |
4860 | Readline uses the current (or default, if line editing was not previously | |
4861 | active) 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 | |
4866 | the 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 |
4871 | waiting for a complete line of input, but honor a delimiter if fewer |
4872 | than <VAR>nchars</VAR> characters are read before the delimiter. | |
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 | |
4877 | than waiting for a complete line of input, unless EOF is encountered or | |
4878 | <CODE>read</CODE> times out. | |
4879 | Delimiter characters encountered in the input are | |
4880 | not treated specially and do not cause <CODE>read</CODE> to return until | |
4881 | <VAR>nchars</VAR> characters are read. | |
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 | |
4886 | to read any input. | |
4887 | The 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. | |
4892 | The backslash is considered to be part of the line. | |
4893 | In particular, a backslash-newline pair may not be used as a line | |
4894 | continuation. | |
4895 | <P> | |
4896 | ||
4897 | <DT><CODE>-s</CODE> | |
4898 | <DD>Silent mode. If input is coming from a terminal, characters are | |
4899 | not 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 | |
4904 | input is not read within <VAR>timeout</VAR> seconds. | |
4905 | <VAR>timeout</VAR> may be a decimal number with a fractional portion following | |
4906 | the decimal point. | |
4907 | This option is only effective if <CODE>read</CODE> is reading input from a | |
4908 | terminal, pipe, or other special file; it has no effect when reading | |
4909 | from regular files. | |
4910 | If <VAR>timeout</VAR> is 0, <CODE>read</CODE> returns success if input is available on | |
4911 | the specified file descriptor, failure otherwise. | |
4912 | The exit status is greater than 128 if the timeout is exceeded. | |
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> </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 |
4927 | or from file descriptor <VAR>fd</VAR> |
4928 | if the <SAMP>`-u'</SAMP> option is supplied. | |
4929 | <P> | |
4930 | ||
4931 | A synonym for <CODE>mapfile</CODE>. | |
4932 | </P><P> | |
4933 | ||
4934 | <DT><CODE>source</CODE> | |
4935 | <DD><A NAME="IDX105"></A> | |
4936 | <TABLE><tr><td> </td><td class=example><pre>source <VAR>filename</VAR> | |
4937 | </pre></td></tr></table>A synonym for <CODE>.</CODE> (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
4938 | <P> | |
4939 | ||
4940 | <DT><CODE>type</CODE> | |
4941 | <DD><A NAME="IDX106"></A> | |
4942 | <TABLE><tr><td> </td><td class=example><pre>type [-afptP] [<VAR>name</VAR> <small>...</small>] | |
4943 | </pre></td></tr></table>For each <VAR>name</VAR>, indicate how it would be interpreted if used as a | |
4944 | command name. | |
4945 | <P> | |
4946 | ||
4947 | If the <SAMP>`-t'</SAMP> option is used, <CODE>type</CODE> prints a single word | |
4948 | which is one of <SAMP>`alias'</SAMP>, <SAMP>`function'</SAMP>, <SAMP>`builtin'</SAMP>, | |
4949 | <SAMP>`file'</SAMP> or <SAMP>`keyword'</SAMP>, | |
4950 | if <VAR>name</VAR> is an alias, shell function, shell builtin, | |
4951 | disk file, or shell reserved word, respectively. | |
4952 | If the <VAR>name</VAR> is not found, then nothing is printed, and | |
4953 | <CODE>type</CODE> returns a failure status. | |
4954 | </P><P> | |
4955 | ||
4956 | If the <SAMP>`-p'</SAMP> option is used, <CODE>type</CODE> either returns the name | |
4957 | of the disk file that would be executed, or nothing if <SAMP>`-t'</SAMP> | |
4958 | would not return <SAMP>`file'</SAMP>. | |
4959 | </P><P> | |
4960 | ||
4961 | The <SAMP>`-P'</SAMP> option forces a path search for each <VAR>name</VAR>, even if | |
4962 | <SAMP>`-t'</SAMP> would not return <SAMP>`file'</SAMP>. | |
4963 | </P><P> | |
4964 | ||
4965 | If a command is hashed, <SAMP>`-p'</SAMP> and <SAMP>`-P'</SAMP> print the hashed value, | |
4966 | not necessarily the file that appears first in <CODE>$PATH</CODE>. | |
4967 | </P><P> | |
4968 | ||
4969 | If the <SAMP>`-a'</SAMP> option is used, <CODE>type</CODE> returns all of the places | |
4970 | that contain an executable named <VAR>file</VAR>. | |
4971 | This includes aliases and functions, if and only if the <SAMP>`-p'</SAMP> option | |
4972 | is not also used. | |
4973 | </P><P> | |
4974 | ||
4975 | If the <SAMP>`-f'</SAMP> option is used, <CODE>type</CODE> does not attempt to find | |
4976 | shell functions, as with the <CODE>command</CODE> builtin. | |
4977 | </P><P> | |
4978 | ||
4979 | The return status is zero if all of the <VAR>names</VAR> are found, non-zero | |
4980 | if any are not found. | |
4981 | </P><P> | |
4982 | ||
4983 | <DT><CODE>typeset</CODE> | |
4984 | <DD><A NAME="IDX107"></A> | |
4985 | <TABLE><tr><td> </td><td class=example><pre>typeset [-afFrxi] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>] | |
4986 | </pre></td></tr></table>The <CODE>typeset</CODE> command is supplied for compatibility with the Korn | |
4987 | shell; however, it has been deprecated in favor of the <CODE>declare</CODE> | |
4988 | builtin command. | |
4989 | <P> | |
4990 | ||
4991 | <DT><CODE>ulimit</CODE> | |
4992 | <DD><A NAME="IDX108"></A> | |
4993 | <TABLE><tr><td> </td><td class=example><pre>ulimit [-abcdefilmnpqrstuvxHST] [<VAR>limit</VAR>] | |
4994 | </pre></td></tr></table><CODE>ulimit</CODE> provides control over the resources available to processes | |
4995 | started by the shell, on systems that allow such control. If an | |
4996 | option is given, it is interpreted as follows: | |
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 |
5044 | allow 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 | ||
5086 | If <VAR>limit</VAR> is given, it is the new value of the specified resource; | |
5087 | the special <VAR>limit</VAR> values <CODE>hard</CODE>, <CODE>soft</CODE>, and | |
5088 | <CODE>unlimited</CODE> stand for the current hard limit, the current soft limit, | |
5089 | and no limit, respectively. | |
5090 | A hard limit cannot be increased by a non-root user once it is set; | |
5091 | a soft limit may be increased up to the value of the hard limit. | |
5092 | Otherwise, the current value of the soft limit for the specified resource | |
5093 | is printed, unless the <SAMP>`-H'</SAMP> option is supplied. | |
5094 | When setting new limits, if neither <SAMP>`-H'</SAMP> nor <SAMP>`-S'</SAMP> is supplied, | |
5095 | both the hard and soft limits are set. | |
5096 | If no option is given, then <SAMP>`-f'</SAMP> is assumed. Values are in 1024-byte | |
5097 | increments, except for <SAMP>`-t'</SAMP>, which is in seconds, <SAMP>`-p'</SAMP>, | |
5098 | which is in units of 512-byte blocks, and <SAMP>`-n'</SAMP> and <SAMP>`-u'</SAMP>, which | |
5099 | are unscaled values. | |
5100 | </P><P> | |
5101 | ||
5102 | The return status is zero unless an invalid option or argument is supplied, | |
5103 | or 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> </td><td class=example><pre>unalias [-a] [<VAR>name</VAR> <small>...</small> ] | |
5109 | </pre></td></tr></table><P> | |
5110 | ||
5111 | Remove each <VAR>name</VAR> from the list of aliases. If <SAMP>`-a'</SAMP> is | |
5112 | supplied, all aliases are removed. | |
5113 | Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>. | |
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"> < </A>]</TD> | |
5124 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> > </A>]</TD> | |
5125 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD> | |
5126 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD> | |
5127 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD> | |
5128 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5129 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5130 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5131 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Change the values of shell attributes and | |
5138 | positional parameters.</TD></TR> | |
5139 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Modify shell optional behavior.</TD></TR> | |
5140 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
5148 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> > </A>]</TD> | |
5149 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD> | |
5150 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD> | |
5151 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD> | |
5152 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5153 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5154 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5155 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5156 | </TR></TABLE> | |
5157 | <H3> 4.3.1 The Set Builtin </H3> | |
5158 | <!--docid::SEC62::--> | |
5159 | <P> | |
5160 | ||
5161 | This builtin is so complicated that it deserves its own section. <CODE>set</CODE> | |
5162 | allows you to change the values of shell options and set the positional | |
5163 | parameters, or to display the names and values of shell variables. | |
5164 | </P><P> | |
5165 | ||
5166 | <DL COMPACT> | |
5167 | <DT><CODE>set</CODE> | |
5168 | <DD><A NAME="IDX110"></A> | |
5169 | <TABLE><tr><td> </td><td class=example><pre>set [--abefhkmnptuvxBCEHPT] [-o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>] | |
5170 | set [+abefhkmnptuvxBCEHPT] [+o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>] | |
5171 | </pre></td></tr></table><P> | |
5172 | ||
5173 | If no options or arguments are supplied, <CODE>set</CODE> displays the names | |
5174 | and values of all shell variables and functions, sorted according to the | |
5175 | current locale, in a format that may be reused as input | |
5176 | for setting or resetting the currently-set variables. | |
5177 | Read-only variables cannot be reset. | |
5178 | In POSIX mode, only shell variables are listed. | |
5179 | </P><P> | |
5180 | ||
5181 | When options are supplied, they set or unset shell attributes. | |
5182 | Options, 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 | |
5188 | to 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 | |
5193 | immediately, 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 |
5198 | of a single simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>), | |
5199 | a subshell command enclosed in parentheses (see section <A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>), | |
5200 | or one of the commands executed as part of a command list enclosed | |
5201 | by braces (see section <A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>) | |
5202 | returns a non-zero status. | |
5203 | The shell does not exit if the command that fails is part of the | |
17345e5a JA |
5204 | command list immediately following a <CODE>while</CODE> or <CODE>until</CODE> keyword, |
5205 | part of the test in an <CODE>if</CODE> statement, | |
0001803f CR |
5206 | part of any command executed in a <CODE>&&</CODE> or <CODE>||</CODE> list except |
5207 | the command following the final <CODE>&&</CODE> or <CODE>||</CODE>, | |
17345e5a | 5208 | any command in a pipeline but the last, |
0001803f | 5209 | or if the command's return status is being inverted with <CODE>!</CODE>. |
17345e5a JA |
5210 | A trap on <CODE>ERR</CODE>, if set, is executed before the shell exits. |
5211 | <P> | |
5212 | ||
0001803f CR |
5213 | This option applies to the shell environment and each subshell environment |
5214 | separately (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>), and may cause | |
5215 | subshells to exit before executing all the commands in the subshell. | |
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. | |
5224 | This 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 | |
5229 | in the environment for a command, not just those that precede | |
5230 | the 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 | |
5239 | script for syntax errors. | |
5240 | This option is ignored by interactive shells. | |
5241 | <P> | |
5242 | ||
5243 | <DT><CODE>-o <VAR>option-name</VAR></CODE> | |
5244 | <DD><P> | |
5245 | ||
5246 | Set 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>). | |
5260 | This 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>. | |
5285 | This 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 | |
5335 | commands in the pipeline exit successfully. | |
5336 | This 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 | |
5341 | from the POSIX standard to match the standard | |
5342 | (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>). | |
5343 | This is intended to make Bash behave as a strict superset of that | |
5344 | standard. | |
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. | |
5357 | This 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. | |
5367 | In this mode, the <CODE>$BASH_ENV</CODE> and <CODE>$ENV</CODE> files are not | |
5368 | processed, shell functions are not inherited from the environment, | |
0001803f CR |
5369 | and the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE> and <CODE>GLOBIGNORE</CODE> |
5370 | variables, if they appear in the environment, are ignored. | |
17345e5a JA |
5371 | If the shell is started with the effective user (group) id not equal to the |
5372 | real user (group) id, and the <CODE>-p</CODE> option is not supplied, these actions | |
5373 | are taken and the effective user id is set to the real user id. | |
5374 | If the <CODE>-p</CODE> option is supplied at startup, the effective user id is | |
5375 | not reset. | |
5376 | Turning this option off causes the effective user | |
5377 | and 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 |
5387 | An error message will be written to the standard error, and a non-interactive |
5388 | shell 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> | |
5397 | commands, <CODE>select</CODE> commands, and arithmetic <CODE>for</CODE> commands | |
5398 | and their arguments or associated word lists after they are | |
5399 | expanded and before they are executed. The value of the <CODE>PS4</CODE> | |
5400 | variable is expanded and the resultant value is printed before | |
5401 | the command and its expanded arguments. | |
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>). | |
5406 | This option is on by default. | |
5407 | <P> | |
5408 | ||
5409 | <DT><CODE>-C</CODE> | |
5410 | <DD>Prevent output redirection using <SAMP>`>'</SAMP>, <SAMP>`>&'</SAMP>, and <SAMP>`<>'</SAMP> | |
5411 | from 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 | |
5416 | substitutions, and commands executed in a subshell environment. | |
5417 | The <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>). | |
5422 | This 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 | |
5428 | is used instead. By default, Bash follows | |
5429 | the logical chain of directories when performing commands | |
5430 | which change the current directory. | |
5431 | <P> | |
5432 | ||
5433 | For example, if <TT>`/usr/sys'</TT> is a symbolic link to <TT>`/usr/local/sys'</TT> | |
5434 | then: | |
5435 | <TABLE><tr><td> </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 | ||
5441 | If <CODE>set -P</CODE> is on, then: | |
5442 | <TABLE><tr><td> </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 | |
5450 | shell functions, command substitutions, and commands executed | |
5451 | in a subshell environment. | |
5452 | The <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps are normally not inherited | |
5453 | in such cases. | |
5454 | <P> | |
5455 | ||
5456 | <DT><CODE>--</CODE> | |
5457 | <DD>If no arguments follow this option, then the positional parameters are | |
5458 | unset. Otherwise, the positional parameters are set to the | |
5459 | <VAR>arguments</VAR>, even if some of them begin with a <SAMP>`-'</SAMP>. | |
5460 | <P> | |
5461 | ||
5462 | <DT><CODE>-</CODE> | |
5463 | <DD>Signal the end of options, cause all remaining <VAR>arguments</VAR> | |
5464 | to be assigned to the positional parameters. The <SAMP>`-x'</SAMP> | |
5465 | and <SAMP>`-v'</SAMP> options are turned off. | |
5466 | If there are no arguments, the positional parameters remain unchanged. | |
5467 | </DL> | |
5468 | <P> | |
5469 | ||
5470 | Using <SAMP>`+'</SAMP> rather than <SAMP>`-'</SAMP> causes these options to be | |
5471 | turned off. The options can also be used upon invocation of the | |
5472 | shell. The current set of options may be found in <CODE>$-</CODE>. | |
5473 | </P><P> | |
5474 | ||
5475 | The remaining N <VAR>arguments</VAR> are positional parameters and are | |
5476 | assigned, in order, to <CODE>$1</CODE>, <CODE>$2</CODE>, <small>...</small> <CODE>$N</CODE>. | |
5477 | The special parameter <CODE>#</CODE> is set to N. | |
5478 | </P><P> | |
5479 | ||
5480 | The 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"> < </A>]</TD> | |
5489 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> > </A>]</TD> | |
5490 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD> | |
5491 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD> | |
5492 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD> | |
5493 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5494 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5495 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5496 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5497 | </TR></TABLE> | |
5498 | <H3> 4.3.2 The Shopt Builtin </H3> | |
5499 | <!--docid::SEC63::--> | |
5500 | <P> | |
5501 | ||
5502 | This 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> </td><td class=example><pre>shopt [-pqsu] [-o] [<VAR>optname</VAR> <small>...</small>] | |
5510 | </pre></td></tr></table>Toggle the values of variables controlling optional shell behavior. | |
5511 | With no options, or with the <SAMP>`-p'</SAMP> option, a list of all settable | |
5512 | options is displayed, with an indication of whether or not each is set. | |
5513 | The <SAMP>`-p'</SAMP> option causes output to be displayed in a form that | |
5514 | may be reused as input. | |
5515 | Other options have the following meanings: | |
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 | |
5529 | indicates whether the <VAR>optname</VAR> is set or unset. | |
5530 | If multiple <VAR>optname</VAR> arguments are given with <SAMP>`-q'</SAMP>, | |
5531 | the return status is zero if all <VAR>optnames</VAR> are enabled; | |
5532 | non-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 | ||
5542 | If either <SAMP>`-s'</SAMP> or <SAMP>`-u'</SAMP> | |
5543 | is used with no <VAR>optname</VAR> arguments, the display is limited to | |
5544 | those options which are set or unset, respectively. | |
5545 | </P><P> | |
5546 | ||
5547 | Unless otherwise noted, the <CODE>shopt</CODE> options are disabled (off) | |
5548 | by default. | |
5549 | </P><P> | |
5550 | ||
5551 | The return status when listing options is zero if all <VAR>optnames</VAR> | |
5552 | are enabled, non-zero otherwise. When setting or unsetting options, | |
5553 | the return status is zero unless an <VAR>optname</VAR> is not a valid shell | |
5554 | option. | |
5555 | </P><P> | |
5556 | ||
5557 | The 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 | |
5562 | it were the argument to the <CODE>cd</CODE> command. | |
5563 | This 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 | |
5568 | is not a directory is assumed to be the name of a variable whose | |
5569 | value 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. | |
5575 | The errors checked for are transposed characters, | |
5576 | a missing character, and a character too many. | |
5577 | If a correction is found, the corrected path is printed, | |
5578 | and the command proceeds. | |
5579 | This option is only used by interactive shells. | |
5580 | <P> | |
5581 | ||
5582 | <DT><CODE>checkhash</CODE> | |
5583 | <DD>If this is set, Bash checks that a command found in the hash | |
5584 | table exists before trying to execute it. If a hashed command no | |
5585 | longer exists, a normal path search is performed. | |
5586 | <P> | |
5587 | ||
5588 | <DT><CODE>checkjobs</CODE> | |
5589 | <DD>If set, Bash lists the status of any stopped and running jobs before | |
5590 | exiting an interactive shell. If any jobs are running, this causes | |
5591 | the exit to be deferred until a second exit is attempted without an | |
5592 | intervening command (see section <A HREF="bashref.html#SEC91">7. Job Control</A>). | |
5593 | The shell always postpones exiting if any jobs are stopped. | |
5594 | <P> | |
5595 | ||
5596 | <DT><CODE>checkwinsize</CODE> | |
5597 | <DD>If set, Bash checks the window size after each command | |
5598 | and, if necessary, updates the values of | |
5599 | <CODE>LINES</CODE> and <CODE>COLUMNS</CODE>. | |
5600 | <P> | |
5601 | ||
5602 | <DT><CODE>cmdhist</CODE> | |
5603 | <DD>If set, Bash | |
5604 | attempts to save all lines of a multiple-line | |
5605 | command in the same history entry. This allows | |
5606 | easy re-editing of multi-line commands. | |
5607 | <P> | |
5608 | ||
5609 | <DT><CODE>compat31</CODE> | |
5610 | <DD>If set, Bash | |
5611 | changes its behavior to that of version 3.1 with respect to quoted | |
5612 | arguments to the conditional command's =~ operator. | |
5613 | <P> | |
5614 | ||
5615 | <DT><CODE>dirspell</CODE> | |
5616 | <DD>If set, Bash | |
5617 | attempts spelling correction on directory names during word completion | |
5618 | if 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 | |
5623 | the 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 | |
5628 | it cannot execute the file specified as an argument to the <CODE>exec</CODE> | |
5629 | builtin command. An interactive shell does not exit if <CODE>exec</CODE> | |
5630 | fails. | |
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>. | |
5636 | This 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> | |
5645 | The <SAMP>`-F'</SAMP> option to the <CODE>declare</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>) | |
5646 | displays the source file name and line number corresponding to each function | |
5647 | name supplied as an argument. | |
5648 | <P> | |
5649 | ||
5650 | <LI> | |
5651 | If the command run by the <CODE>DEBUG</CODE> trap returns a non-zero value, the | |
5652 | next command is skipped and not executed. | |
5653 | <P> | |
5654 | ||
5655 | <LI> | |
5656 | If the command run by the <CODE>DEBUG</CODE> trap returns a value of 2, and the | |
5657 | shell is executing in a subroutine (a shell function or a shell script | |
5658 | executed by the <CODE>.</CODE> or <CODE>source</CODE> builtins), a call to | |
5659 | <CODE>return</CODE> is simulated. | |
5660 | <P> | |
5661 | ||
5662 | <LI> | |
5663 | <CODE>BASH_ARGC</CODE> and <CODE>BASH_ARGV</CODE> are updated as described in their | |
5664 | descriptions (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
5665 | <P> | |
5666 | ||
5667 | <LI> | |
5668 | Function tracing is enabled: command substitution, shell functions, and | |
5669 | subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the | |
5670 | <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps. | |
5671 | <P> | |
5672 | ||
5673 | <LI> | |
5674 | Error tracing is enabled: command substitution, shell functions, and | |
5675 | subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the | |
5676 | <CODE>ERROR</CODE> trap. | |
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 | |
5687 | performed within <CODE>${<VAR>parameter</VAR>}</CODE> expansions | |
5688 | enclosed 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 |
5693 | result 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 | |
5698 | cause words to be ignored when performing word completion even if | |
5699 | the ignored words are the only possible completions. | |
5700 | See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>. | |
5701 | This option is enabled by default. | |
5702 | <P> | |
5703 | ||
5704 | <DT><CODE>globstar</CODE> | |
5705 | <DD>If set, the pattern <SAMP>`**'</SAMP> used in a filename expansion context will | |
5706 | match a files and zero or more directories and subdirectories. | |
5707 | If the pattern is followed by a <SAMP>`/'</SAMP>, only directories and | |
5708 | subdirectories match. | |
5709 | <P> | |
5710 | ||
5711 | <DT><CODE>gnu_errfmt</CODE> | |
5712 | <DD>If set, shell error messages are written in the standard GNU error | |
5713 | message 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 | |
5718 | of the <CODE>HISTFILE</CODE> | |
5719 | variable when the shell exits, rather than overwriting the file. | |
5720 | <P> | |
5721 | ||
5722 | <DT><CODE>histreedit</CODE> | |
5723 | <DD>If set, and Readline | |
5724 | is being used, a user is given the opportunity to re-edit a | |
5725 | failed history substitution. | |
5726 | <P> | |
5727 | ||
5728 | <DT><CODE>histverify</CODE> | |
5729 | <DD>If set, and Readline | |
5730 | is being used, the results of history substitution are not immediately | |
5731 | passed to the shell parser. Instead, the resulting line is loaded into | |
5732 | the Readline editing buffer, allowing further modification. | |
5733 | <P> | |
5734 | ||
5735 | <DT><CODE>hostcomplete</CODE> | |
5736 | <DD>If set, and Readline is being used, Bash will attempt to perform | |
5737 | hostname completion when a word containing a <SAMP>`@'</SAMP> is being | |
5738 | completed (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>). This option is enabled | |
5739 | by 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 | |
5744 | login 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> | |
5749 | to cause that word and all remaining characters on that | |
5750 | line to be ignored in an interactive shell. | |
5751 | This option is enabled by default. | |
5752 | <P> | |
5753 | ||
5754 | <DT><CODE>lithist</CODE> | |
5755 | <DD>If enabled, and the <CODE>cmdhist</CODE> | |
5756 | option is enabled, multi-line commands are saved to the history with | |
5757 | embedded newlines rather than using semicolon separators where possible. | |
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>). | |
5763 | The 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 | |
5768 | accessed since the last time it was checked, the message | |
5769 | <CODE>"The mail in <VAR>mailfile</VAR> has been read"</CODE> is displayed. | |
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 | |
5774 | the <CODE>PATH</CODE> for possible completions when completion is attempted | |
5775 | on an empty line. | |
5776 | <P> | |
5777 | ||
5778 | <DT><CODE>nocaseglob</CODE> | |
5779 | <DD>If set, Bash matches filenames in a case-insensitive fashion when | |
5780 | performing filename expansion. | |
5781 | <P> | |
5782 | ||
5783 | <DT><CODE>nocasematch</CODE> | |
5784 | <DD>If set, Bash matches patterns in a case-insensitive fashion when | |
5785 | performing matching while executing <CODE>case</CODE> or <CODE>[[</CODE> | |
5786 | conditional commands. | |
5787 | <P> | |
5788 | ||
5789 | <DT><CODE>nullglob</CODE> | |
5790 | <DD>If set, Bash allows filename patterns which match no | |
5791 | files to expand to a null string, rather than themselves. | |
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. | |
5797 | This option is enabled by default. | |
5798 | <P> | |
5799 | ||
5800 | <DT><CODE>promptvars</CODE> | |
5801 | <DD>If set, prompt strings undergo | |
5802 | parameter expansion, command substitution, arithmetic | |
5803 | expansion, and quote removal after being expanded | |
5804 | as described below (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>). | |
5805 | This option is enabled by default. | |
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>). | |
5811 | The value may not be changed. | |
5812 | This is not reset when the startup files are executed, allowing | |
5813 | the startup files to discover whether or not a shell is restricted. | |
5814 | <P> | |
5815 | ||
5816 | <DT><CODE>shift_verbose</CODE> | |
5817 | <DD>If this is set, the <CODE>shift</CODE> | |
5818 | builtin prints an error message when the shift count exceeds the | |
5819 | number of positional parameters. | |
5820 | <P> | |
5821 | ||
5822 | <DT><CODE>sourcepath</CODE> | |
5823 | <DD>If set, the <CODE>source</CODE> builtin uses the value of <CODE>PATH</CODE> | |
5824 | to find the directory containing the file supplied as an argument. | |
5825 | This option is enabled by default. | |
5826 | <P> | |
5827 | ||
5828 | <DT><CODE>xpg_echo</CODE> | |
5829 | <DD>If set, the <CODE>echo</CODE> builtin expands backslash-escape sequences | |
5830 | by default. | |
5831 | <P> | |
5832 | ||
5833 | </DL> | |
5834 | <P> | |
5835 | ||
5836 | The return status when listing options is zero if all <VAR>optnames</VAR> | |
5837 | are enabled, non-zero otherwise. | |
5838 | When setting or unsetting options, the return status is zero unless an | |
5839 | <VAR>optname</VAR> is not a valid shell option. | |
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"> < </A>]</TD> | |
5850 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> > </A>]</TD> | |
5851 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD> | |
5852 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD> | |
5853 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD> | |
5854 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5855 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5856 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5857 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5858 | </TR></TABLE> | |
5859 | <H2> 4.4 Special Builtins </H2> | |
5860 | <!--docid::SEC64::--> | |
5861 | <P> | |
5862 | ||
5863 | For historical reasons, the POSIX standard has classified | |
5864 | several builtin commands as <EM>special</EM>. | |
5865 | When Bash is executing in POSIX mode, the special builtins | |
5866 | differ from other builtin commands in three respects: | |
5867 | </P><P> | |
5868 | ||
5869 | <OL> | |
5870 | <LI> | |
5871 | Special builtins are found before shell functions during command lookup. | |
5872 | <P> | |
5873 | ||
5874 | <LI> | |
5875 | If a special builtin returns an error status, a non-interactive shell exits. | |
5876 | <P> | |
5877 | ||
5878 | <LI> | |
5879 | Assignment statements preceding the command stay in effect in the shell | |
5880 | environment after the command completes. | |
5881 | </OL> | |
5882 | <P> | |
5883 | ||
5884 | When Bash is not executing in POSIX mode, these builtins behave no | |
5885 | differently than the rest of the Bash builtin commands. | |
5886 | The Bash POSIX mode is described in <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>. | |
5887 | </P><P> | |
5888 | ||
5889 | These are the POSIX special builtins: | |
5890 | <TABLE><tr><td> </td><td class=example><pre>break : . continue eval exec exit export readonly return set | |
5891 | shift 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"> < </A>]</TD> | |
5899 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> > </A>]</TD> | |
5900 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> << </A>]</TD> | |
5901 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
5902 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> >> </A>]</TD> | |
5903 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5904 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5905 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5906 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Variables which Bash uses in the same way | |
5914 | as the Bourne Shell.</TD></TR> | |
5915 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">List of variables that exist in Bash.</TD></TR> | |
5916 | </TABLE></BLOCKQUOTE> | |
5917 | <P> | |
5918 | ||
5919 | This chapter describes the shell variables that Bash uses. | |
5920 | Bash 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"> < </A>]</TD> | |
5928 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> > </A>]</TD> | |
5929 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD> | |
5930 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD> | |
5931 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> >> </A>]</TD> | |
5932 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5933 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5934 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5935 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5936 | </TR></TABLE> | |
5937 | <H2> 5.1 Bourne Shell Variables </H2> | |
5938 | <!--docid::SEC66::--> | |
5939 | <P> | |
5940 | ||
5941 | Bash uses certain shell variables in the same way as the Bourne shell. | |
5942 | In some cases, Bash assigns a default value to the variable. | |
5943 | </P><P> | |
5944 | ||
5945 | <DL COMPACT> | |
5946 | ||
5947 | <A NAME="IDX112"></A> | |
5948 | <DT><CODE>CDPATH</CODE> | |
5949 | <DD><A NAME="IDX113"></A> | |
5950 | A colon-separated list of directories used as a search path for | |
5951 | the <CODE>cd</CODE> builtin command. | |
5952 | <P> | |
5953 | ||
5954 | <A NAME="IDX114"></A> | |
5955 | <DT><CODE>HOME</CODE> | |
5956 | <DD><A NAME="IDX115"></A> | |
5957 | The current user's home directory; the default for the <CODE>cd</CODE> builtin | |
5958 | command. | |
5959 | The value of this variable is also used by tilde expansion | |
5960 | (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>). | |
5961 | <P> | |
5962 | ||
5963 | <A NAME="IDX116"></A> | |
5964 | <DT><CODE>IFS</CODE> | |
5965 | <DD><A NAME="IDX117"></A> | |
5966 | A list of characters that separate fields; used when the shell splits | |
5967 | words as part of expansion. | |
5968 | <P> | |
5969 | ||
5970 | <A NAME="IDX118"></A> | |
5971 | <DT><CODE>MAIL</CODE> | |
5972 | <DD><A NAME="IDX119"></A> | |
5973 | If this parameter is set to a filename and the <CODE>MAILPATH</CODE> variable | |
5974 | is not set, Bash informs the user of the arrival of mail in | |
5975 | the specified file. | |
5976 | <P> | |
5977 | ||
5978 | <A NAME="IDX120"></A> | |
5979 | <DT><CODE>MAILPATH</CODE> | |
5980 | <DD><A NAME="IDX121"></A> | |
5981 | A colon-separated list of filenames which the shell periodically checks | |
5982 | for new mail. | |
5983 | Each list entry can specify the message that is printed when new mail | |
5984 | arrives in the mail file by separating the file name from the message with | |
5985 | a <SAMP>`?'</SAMP>. | |
5986 | When used in the text of the message, <CODE>$_</CODE> expands to the name of | |
5987 | the current mail file. | |
5988 | <P> | |
5989 | ||
5990 | <A NAME="IDX122"></A> | |
5991 | <DT><CODE>OPTARG</CODE> | |
5992 | <DD><A NAME="IDX123"></A> | |
5993 | The value of the last option argument processed by the <CODE>getopts</CODE> builtin. | |
5994 | <P> | |
5995 | ||
5996 | <A NAME="IDX124"></A> | |
5997 | <DT><CODE>OPTIND</CODE> | |
5998 | <DD><A NAME="IDX125"></A> | |
5999 | The index of the last option argument processed by the <CODE>getopts</CODE> builtin. | |
6000 | <P> | |
6001 | ||
6002 | <A NAME="IDX126"></A> | |
6003 | <DT><CODE>PATH</CODE> | |
6004 | <DD><A NAME="IDX127"></A> | |
6005 | A colon-separated list of directories in which the shell looks for | |
6006 | commands. | |
6007 | A zero-length (null) directory name in the value of <CODE>PATH</CODE> indicates the | |
6008 | current directory. | |
6009 | A null directory name may appear as two adjacent colons, or as an initial | |
6010 | or trailing colon. | |
6011 | <P> | |
6012 | ||
6013 | <A NAME="IDX128"></A> | |
6014 | <DT><CODE>PS1</CODE> | |
6015 | <DD><A NAME="IDX129"></A> | |
6016 | The primary prompt string. The default value is <SAMP>`\s-\v\$ '</SAMP>. | |
6017 | See section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for the complete list of escape | |
6018 | sequences that are expanded before <CODE>PS1</CODE> is displayed. | |
6019 | <P> | |
6020 | ||
6021 | <A NAME="IDX130"></A> | |
6022 | <DT><CODE>PS2</CODE> | |
6023 | <DD><A NAME="IDX131"></A> | |
6024 | The secondary prompt string. The default value is <SAMP>`> '</SAMP>. | |
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"> < </A>]</TD> | |
6035 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> > </A>]</TD> | |
6036 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD> | |
6037 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD> | |
6038 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> >> </A>]</TD> | |
6039 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
6040 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
6041 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
6042 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
6043 | </TR></TABLE> | |
6044 | <H2> 5.2 Bash Variables </H2> | |
6045 | <!--docid::SEC67::--> | |
6046 | <P> | |
6047 | ||
6048 | These variables are set or used by Bash, but other shells | |
6049 | do not normally treat them specially. | |
6050 | </P><P> | |
6051 | ||
6052 | A few variables used by Bash are described in different chapters: | |
6053 | variables for controlling the job control facilities | |
6054 | (see section <A HREF="bashref.html#SEC94">7.3 Job Control Variables</A>). | |
6055 | </P><P> | |
6056 | ||
6057 | <DL COMPACT> | |
6058 | ||
6059 | <A NAME="IDX132"></A> | |
6060 | <DT><CODE>BASH</CODE> | |
6061 | <DD><A NAME="IDX133"></A> | |
6062 | The full pathname used to execute the current instance of Bash. | |
6063 | <P> | |
6064 | ||
6065 | <A NAME="IDX134"></A> | |
0001803f | 6066 | <DT><CODE>BASHOPTS</CODE> |
17345e5a | 6067 | <DD><A NAME="IDX135"></A> |
0001803f CR |
6068 | A colon-separated list of enabled shell options. Each word in |
6069 | the list is a valid argument for the <SAMP>`-s'</SAMP> option to the | |
6070 | <CODE>shopt</CODE> builtin command (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>). | |
6071 | The options appearing in <CODE>BASHOPTS</CODE> are those reported | |
6072 | as <SAMP>`on'</SAMP> by <SAMP>`shopt'</SAMP>. | |
6073 | If this variable is in the environment when Bash | |
6074 | starts up, each shell option in the list will be enabled before | |
6075 | reading any startup files. This variable is readonly. | |
6076 | <P> | |
6077 | ||
6078 | <A NAME="IDX136"></A> | |
6079 | <DT><CODE>BASHPID</CODE> | |
6080 | <DD><A NAME="IDX137"></A> | |
17345e5a JA |
6081 | Expands to the process id of the current Bash process. |
6082 | This differs from <CODE>$$</CODE> under certain circumstances, such as subshells | |
6083 | that do not require Bash to be re-initialized. | |
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 |
6089 | An associative array variable whose members correspond to the internal |
6090 | list of aliases as maintained by the <CODE>alias</CODE> builtin | |
6091 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
6092 | Elements added to this array appear in the alias list; unsetting array | |
6093 | elements cause aliases to be removed from the alias list. | |
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 |
6099 | An array variable whose values are the number of parameters in each |
6100 | frame of the current bash execution call stack. The number of | |
6101 | parameters to the current subroutine (shell function or script executed | |
6102 | with <CODE>.</CODE> or <CODE>source</CODE>) is at the top of the stack. When a | |
6103 | subroutine is executed, the number of parameters passed is pushed onto | |
6104 | <CODE>BASH_ARGC</CODE>. | |
6105 | The shell sets <CODE>BASH_ARGC</CODE> only when in extended debugging mode | |
6106 | (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A> | |
6107 | for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE> | |
6108 | builtin). | |
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 |
6114 | An array variable containing all of the parameters in the current bash |
6115 | execution call stack. The final parameter of the last subroutine call | |
6116 | is at the top of the stack; the first parameter of the initial call is | |
6117 | at the bottom. When a subroutine is executed, the parameters supplied | |
6118 | are pushed onto <CODE>BASH_ARGV</CODE>. | |
6119 | The shell sets <CODE>BASH_ARGV</CODE> only when in extended debugging mode | |
6120 | (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A> | |
6121 | for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE> | |
6122 | builtin). | |
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 |
6128 | An associative array variable whose members correspond to the internal |
6129 | hash table of commands as maintained by the <CODE>hash</CODE> builtin | |
6130 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
6131 | Elements added to this array appear in the hash table; unsetting array | |
6132 | elements cause commands to be removed from the hash table. | |
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 |
6138 | The command currently being executed or about to be executed, unless the |
6139 | shell is executing a command as the result of a trap, | |
6140 | in which case it is the command executing at the time of the trap. | |
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 |
6146 | If this variable is set when Bash is invoked to execute a shell |
6147 | script, its value is expanded and used as the name of a startup file | |
6148 | to read before executing the script. See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>. | |
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 |
6154 | The 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 |
6160 | An array variable whose members are the line numbers in source files |
6161 | corresponding to each member of <VAR>FUNCNAME</VAR>. | |
6162 | <CODE>${BASH_LINENO[$i]}</CODE> is the line number in the source file where | |
6163 | <CODE>${FUNCNAME[$i]}</CODE> was called (or <CODE>${BASH_LINENO[$i-1]}</CODE> if | |
6164 | referenced within another shell function). | |
6165 | The corresponding source file name is <CODE>${BASH_SOURCE[$i]}</CODE>. | |
6166 | Use <CODE>LINENO</CODE> to obtain the current line number. | |
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 |
6172 | An array variable whose members are assigned by the <SAMP>`=~'</SAMP> binary |
6173 | operator to the <CODE>[[</CODE> conditional command | |
6174 | (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). | |
6175 | The element with index 0 is the portion of the string | |
6176 | matching the entire regular expression. | |
6177 | The element with index <VAR>n</VAR> is the portion of the | |
6178 | string matching the <VAR>n</VAR>th parenthesized subexpression. | |
6179 | This variable is read-only. | |
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 |
6185 | An array variable whose members are the source filenames corresponding |
6186 | to 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 |
6192 | Incremented by one each time a subshell or subshell environment is spawned. |
6193 | The 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 |
6199 | A readonly array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>) |
6200 | whose members hold version information for this instance of Bash. | |
6201 | The values assigned to the array members are as follows: | |
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 |
6236 | The 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> | |
6242 | If set to an integer corresponding to a valid file descriptor, Bash | |
6243 | will write the trace output generated when <SAMP>`set -x'</SAMP> | |
6244 | is enabled to that file descriptor. | |
6245 | This allows tracing output to be separated from diagnostic and error | |
6246 | messages. | |
6247 | The file descriptor is closed when <CODE>BASH_XTRACEFD</CODE> is unset or assigned | |
6248 | a new value. | |
6249 | Unsetting <CODE>BASH_XTRACEFD</CODE> or assigning it the empty string causes the | |
6250 | trace output to be sent to the standard error. | |
6251 | Note that setting <CODE>BASH_XTRACEFD</CODE> to 2 (the standard error file | |
6252 | descriptor) and then unsetting it will result in the standard error | |
6253 | being closed. | |
6254 | <P> | |
6255 | ||
6256 | <A NAME="IDX166"></A> | |
17345e5a | 6257 | <DT><CODE>COLUMNS</CODE> |
0001803f | 6258 | <DD><A NAME="IDX167"></A> |
17345e5a JA |
6259 | Used by the <CODE>select</CODE> builtin command to determine the terminal width |
6260 | when printing selection lists. Automatically set upon receipt of a | |
6261 | <CODE>SIGWINCH</CODE>. | |
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 |
6267 | An index into <CODE>${COMP_WORDS}</CODE> of the word containing the current |
6268 | cursor position. | |
6269 | This variable is available only in shell functions invoked by the | |
6270 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
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 |
6276 | The current command line. |
6277 | This variable is available only in shell functions and external | |
6278 | commands invoked by the | |
6279 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
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 |
6285 | The index of the current cursor position relative to the beginning of |
6286 | the current command. | |
6287 | If the current cursor position is at the end of the current command, | |
6288 | the value of this variable is equal to <CODE>${#COMP_LINE}</CODE>. | |
6289 | This variable is available only in shell functions and external | |
6290 | commands invoked by the | |
6291 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
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 |
6297 | Set to an integer value corresponding to the type of completion attempted |
6298 | that caused a completion function to be called: | |
6299 | <VAR>TAB</VAR>, for normal completion, | |
6300 | <SAMP>`?'</SAMP>, for listing completions after successive tabs, | |
6301 | <SAMP>`!'</SAMP>, for listing alternatives on partial word completion, | |
6302 | <SAMP>`@'</SAMP>, to list completions if the word is not unmodified, | |
6303 | or | |
6304 | <SAMP>`%'</SAMP>, for menu completion. | |
6305 | This variable is available only in shell functions and external | |
6306 | commands invoked by the | |
6307 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
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 |
6313 | The key (or final key of a key sequence) used to invoke the current |
6314 | completion 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 |
6320 | The set of characters that the Readline library treats as word |
6321 | separators when performing word completion. | |
6322 | If <CODE>COMP_WORDBREAKS</CODE> is unset, it loses its special properties, | |
6323 | even if it is subsequently reset. | |
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 |
6329 | An array variable consisting of the individual |
6330 | words in the current command line. | |
0001803f CR |
6331 | The line is split into words as Readline would split it, using |
6332 | <CODE>COMP_WORDBREAKS</CODE> as described above. | |
17345e5a JA |
6333 | This variable is available only in shell functions invoked by the |
6334 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
6335 | <P> | |
6336 | ||
0001803f | 6337 | <A NAME="IDX182"></A> |
17345e5a | 6338 | <DT><CODE>COMPREPLY</CODE> |
0001803f | 6339 | <DD><A NAME="IDX183"></A> |
17345e5a JA |
6340 | An array variable from which Bash reads the possible completions |
6341 | generated by a shell function invoked by the programmable completion | |
6342 | facility (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
6343 | <P> | |
6344 | ||
0001803f | 6345 | <A NAME="IDX184"></A> |
17345e5a | 6346 | <DT><CODE>DIRSTACK</CODE> |
0001803f | 6347 | <DD><A NAME="IDX185"></A> |
17345e5a JA |
6348 | An array variable containing the current contents of the directory stack. |
6349 | Directories appear in the stack in the order they are displayed by the | |
6350 | <CODE>dirs</CODE> builtin. | |
6351 | Assigning to members of this array variable may be used to modify | |
6352 | directories already in the stack, but the <CODE>pushd</CODE> and <CODE>popd</CODE> | |
6353 | builtins must be used to add and remove directories. | |
6354 | Assignment to this variable will not change the current directory. | |
6355 | If <CODE>DIRSTACK</CODE> is unset, it loses its special properties, even if | |
6356 | it is subsequently reset. | |
6357 | <P> | |
6358 | ||
0001803f | 6359 | <A NAME="IDX186"></A> |
17345e5a | 6360 | <DT><CODE>EMACS</CODE> |
0001803f | 6361 | <DD><A NAME="IDX187"></A> |
17345e5a JA |
6362 | If Bash finds this variable in the environment when the shell |
6363 | starts with value <SAMP>`t'</SAMP>, it assumes that the shell is running in an | |
6364 | emacs shell buffer and disables line editing. | |
6365 | <P> | |
6366 | ||
0001803f | 6367 | <A NAME="IDX188"></A> |
17345e5a | 6368 | <DT><CODE>EUID</CODE> |
0001803f | 6369 | <DD><A NAME="IDX189"></A> |
17345e5a JA |
6370 | The numeric effective user id of the current user. This variable |
6371 | is 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 |
6377 | The editor used as a default by the <SAMP>`-e'</SAMP> option to the <CODE>fc</CODE> |
6378 | builtin 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 |
6384 | A colon-separated list of suffixes to ignore when performing |
6385 | filename completion. | |
6386 | A file name whose suffix matches one of the entries in | |
6387 | <CODE>FIGNORE</CODE> | |
6388 | is excluded from the list of matched file names. A sample | |
6389 | value is <SAMP>`.o:~'</SAMP> | |
6390 | <P> | |
6391 | ||
0001803f | 6392 | <A NAME="IDX194"></A> |
17345e5a | 6393 | <DT><CODE>FUNCNAME</CODE> |
0001803f | 6394 | <DD><A NAME="IDX195"></A> |
17345e5a JA |
6395 | An array variable containing the names of all shell functions |
6396 | currently in the execution call stack. | |
6397 | The element with index 0 is the name of any currently-executing | |
6398 | shell function. | |
6399 | The bottom-most element is <CODE>"main"</CODE>. | |
6400 | This variable exists only when a shell function is executing. | |
6401 | Assignments to <CODE>FUNCNAME</CODE> have no effect and return an error status. | |
6402 | If <CODE>FUNCNAME</CODE> is unset, it loses its special properties, even if | |
6403 | it is subsequently reset. | |
6404 | <P> | |
6405 | ||
0001803f | 6406 | <A NAME="IDX196"></A> |
17345e5a | 6407 | <DT><CODE>GLOBIGNORE</CODE> |
0001803f | 6408 | <DD><A NAME="IDX197"></A> |
17345e5a JA |
6409 | A colon-separated list of patterns defining the set of filenames to |
6410 | be ignored by filename expansion. | |
6411 | If a filename matched by a filename expansion pattern also matches one | |
6412 | of the patterns in <CODE>GLOBIGNORE</CODE>, it is removed from the list | |
6413 | of 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 |
6419 | An array variable containing the list of groups of which the current |
6420 | user is a member. | |
6421 | Assignments to <CODE>GROUPS</CODE> have no effect and return an error status. | |
6422 | If <CODE>GROUPS</CODE> is unset, it loses its special properties, even if it is | |
6423 | subsequently 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 |
6429 | Up to three characters which control history expansion, quick |
6430 | substitution, and tokenization (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>). | |
6431 | The first character is the | |
6432 | <VAR>history expansion</VAR> character, that is, the character which signifies the | |
6433 | start of a history expansion, normally <SAMP>`!'</SAMP>. The second character is the | |
6434 | character which signifies `quick substitution' when seen as the first | |
6435 | character on a line, normally <SAMP>`^'</SAMP>. The optional third character is the | |
6436 | character which indicates that the remainder of the line is a comment when | |
6437 | found as the first character of a word, usually <SAMP>`#'</SAMP>. The history | |
6438 | comment character causes history substitution to be skipped for the | |
6439 | remaining words on the line. It does not necessarily cause the shell | |
6440 | parser to treat the rest of the line as a comment. | |
6441 | <P> | |
6442 | ||
0001803f | 6443 | <A NAME="IDX202"></A> |
17345e5a | 6444 | <DT><CODE>HISTCMD</CODE> |
0001803f | 6445 | <DD><A NAME="IDX203"></A> |
17345e5a JA |
6446 | The history number, or index in the history list, of the current |
6447 | command. If <CODE>HISTCMD</CODE> is unset, it loses its special properties, | |
6448 | even if it is subsequently reset. | |
6449 | <P> | |
6450 | ||
0001803f | 6451 | <A NAME="IDX204"></A> |
17345e5a | 6452 | <DT><CODE>HISTCONTROL</CODE> |
0001803f | 6453 | <DD><A NAME="IDX205"></A> |
17345e5a JA |
6454 | A colon-separated list of values controlling how commands are saved on |
6455 | the history list. | |
6456 | If the list of values includes <SAMP>`ignorespace'</SAMP>, lines which begin | |
6457 | with a space character are not saved in the history list. | |
6458 | A value of <SAMP>`ignoredups'</SAMP> causes lines which match the previous | |
6459 | history entry to not be saved. | |
6460 | A value of <SAMP>`ignoreboth'</SAMP> is shorthand for | |
6461 | <SAMP>`ignorespace'</SAMP> and <SAMP>`ignoredups'</SAMP>. | |
6462 | A value of <SAMP>`erasedups'</SAMP> causes all previous lines matching the | |
6463 | current line to be removed from the history list before that line | |
6464 | is saved. | |
6465 | Any value not in the above list is ignored. | |
6466 | If <CODE>HISTCONTROL</CODE> is unset, or does not include a valid value, | |
6467 | all lines read by the shell parser are saved on the history list, | |
6468 | subject to the value of <CODE>HISTIGNORE</CODE>. | |
6469 | The second and subsequent lines of a multi-line compound command are | |
6470 | not tested, and are added to the history regardless of the value of | |
6471 | <CODE>HISTCONTROL</CODE>. | |
6472 | <P> | |
6473 | ||
0001803f | 6474 | <A NAME="IDX206"></A> |
17345e5a | 6475 | <DT><CODE>HISTFILE</CODE> |
0001803f | 6476 | <DD><A NAME="IDX207"></A> |
17345e5a JA |
6477 | The name of the file to which the command history is saved. The |
6478 | default 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 |
6484 | The maximum number of lines contained in the history file. When this |
6485 | variable is assigned a value, the history file is truncated, if | |
6486 | necessary, by removing the oldest entries, | |
6487 | to contain no more than that number of lines. | |
6488 | The history file is also truncated to this size after | |
6489 | writing it when an interactive shell exits. | |
6490 | The default value is 500. | |
6491 | <P> | |
6492 | ||
0001803f | 6493 | <A NAME="IDX210"></A> |
17345e5a | 6494 | <DT><CODE>HISTIGNORE</CODE> |
0001803f | 6495 | <DD><A NAME="IDX211"></A> |
17345e5a JA |
6496 | A colon-separated list of patterns used to decide which command |
6497 | lines should be saved on the history list. Each pattern is | |
6498 | anchored at the beginning of the line and must match the complete | |
6499 | line (no implicit <SAMP>`*'</SAMP> is appended). Each pattern is tested | |
6500 | against the line after the checks specified by <CODE>HISTCONTROL</CODE> | |
6501 | are applied. In addition to the normal shell pattern matching | |
6502 | characters, <SAMP>`&'</SAMP> matches the previous history line. <SAMP>`&'</SAMP> | |
6503 | may be escaped using a backslash; the backslash is removed | |
6504 | before attempting a match. | |
6505 | The second and subsequent lines of a multi-line compound command are | |
6506 | not tested, and are added to the history regardless of the value of | |
6507 | <CODE>HISTIGNORE</CODE>. | |
6508 | <P> | |
6509 | ||
6510 | <CODE>HISTIGNORE</CODE> subsumes the function of <CODE>HISTCONTROL</CODE>. A | |
6511 | pattern of <SAMP>`&'</SAMP> is identical to <CODE>ignoredups</CODE>, and a | |
6512 | pattern of <SAMP>`[ ]*'</SAMP> is identical to <CODE>ignorespace</CODE>. | |
6513 | Combining these two patterns, separating them with a colon, | |
6514 | provides the functionality of <CODE>ignoreboth</CODE>. | |
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 |
6520 | The maximum number of commands to remember on the history list. |
6521 | The 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 |
6527 | If this variable is set and not null, its value is used as a format string |
6528 | for <VAR>strftime</VAR> to print the time stamp associated with each history | |
6529 | entry displayed by the <CODE>history</CODE> builtin. | |
6530 | If this variable is set, time stamps are written to the history file so | |
6531 | they may be preserved across shell sessions. | |
6532 | This uses the history comment character to distinguish timestamps from | |
6533 | other history lines. | |
6534 | <P> | |
6535 | ||
0001803f | 6536 | <A NAME="IDX216"></A> |
17345e5a | 6537 | <DT><CODE>HOSTFILE</CODE> |
0001803f | 6538 | <DD><A NAME="IDX217"></A> |
17345e5a JA |
6539 | Contains the name of a file in the same format as <TT>`/etc/hosts'</TT> that |
6540 | should be read when the shell needs to complete a hostname. | |
6541 | The list of possible hostname completions may be changed while the shell | |
6542 | is running; | |
6543 | the next time hostname completion is attempted after the | |
6544 | value is changed, Bash adds the contents of the new file to the | |
6545 | existing list. | |
0001803f CR |
6546 | If <CODE>HOSTFILE</CODE> is set, but has no value, or does not name a readable file, |
6547 | Bash attempts to read | |
17345e5a JA |
6548 | <TT>`/etc/hosts'</TT> to obtain the list of possible hostname completions. |
6549 | When <CODE>HOSTFILE</CODE> is unset, the hostname list is cleared. | |
6550 | <P> | |
6551 | ||
0001803f | 6552 | <A NAME="IDX218"></A> |
17345e5a | 6553 | <DT><CODE>HOSTNAME</CODE> |
0001803f | 6554 | <DD><A NAME="IDX219"></A> |
17345e5a JA |
6555 | The 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 |
6561 | A 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 |
6567 | Controls the action of the shell on receipt of an <CODE>EOF</CODE> character |
6568 | as the sole input. If set, the value denotes the number | |
6569 | of consecutive <CODE>EOF</CODE> characters that can be read as the | |
6570 | first character on an input line | |
6571 | before the shell will exit. If the variable exists but does not | |
6572 | have a numeric value (or has no value) then the default is 10. | |
6573 | If the variable does not exist, then <CODE>EOF</CODE> signifies the end of | |
6574 | input to the shell. This is only in effect for interactive shells. | |
6575 | <P> | |
6576 | ||
0001803f | 6577 | <A NAME="IDX224"></A> |
17345e5a | 6578 | <DT><CODE>INPUTRC</CODE> |
0001803f | 6579 | <DD><A NAME="IDX225"></A> |
17345e5a JA |
6580 | The name of the Readline initialization file, overriding the default |
6581 | of <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 |
6587 | Used to determine the locale category for any category not specifically |
6588 | selected 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 |
6594 | This 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 |
6601 | This variable determines the collation order used when sorting the |
6602 | results of filename expansion, and | |
6603 | determines the behavior of range expressions, equivalence classes, | |
6604 | and collating sequences within filename expansion and pattern matching | |
6605 | (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). | |
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 |
6611 | This variable determines the interpretation of characters and the |
6612 | behavior of character classes within filename expansion and pattern | |
6613 | matching (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). | |
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 |
6619 | This variable determines the locale used to translate double-quoted |
6620 | strings preceded by a <SAMP>`$'</SAMP> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>). | |
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 |
6626 | This 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 |
6632 | The 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 |
6638 | Used by the <CODE>select</CODE> builtin command to determine the column length |
6639 | for printing selection lists. Automatically set upon receipt of a | |
6640 | <CODE>SIGWINCH</CODE>. | |
6641 | <P> | |
6642 | ||
0001803f | 6643 | <A NAME="IDX242"></A> |
17345e5a | 6644 | <DT><CODE>MACHTYPE</CODE> |
0001803f | 6645 | <DD><A NAME="IDX243"></A> |
17345e5a JA |
6646 | A string that fully describes the system type on which Bash |
6647 | is executing, in the standard GNU <VAR>cpu-company-system</VAR> format. | |
6648 | <P> | |
6649 | ||
0001803f | 6650 | <A NAME="IDX244"></A> |
17345e5a | 6651 | <DT><CODE>MAILCHECK</CODE> |
0001803f | 6652 | <DD><A NAME="IDX245"></A> |
17345e5a JA |
6653 | How often (in seconds) that the shell should check for mail in the |
6654 | files specified in the <CODE>MAILPATH</CODE> or <CODE>MAIL</CODE> variables. | |
6655 | The default is 60 seconds. When it is time to check | |
6656 | for mail, the shell does so before displaying the primary prompt. | |
6657 | If this variable is unset, or set to a value that is not a number | |
6658 | greater than or equal to zero, the shell disables mail checking. | |
6659 | <P> | |
6660 | ||
0001803f | 6661 | <A NAME="IDX246"></A> |
17345e5a | 6662 | <DT><CODE>OLDPWD</CODE> |
0001803f | 6663 | <DD><A NAME="IDX247"></A> |
17345e5a JA |
6664 | The 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 |
6670 | If set to the value 1, Bash displays error messages |
6671 | generated 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 |
6677 | A 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 |
6683 | An array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>) |
6684 | containing a list of exit status values from the processes | |
6685 | in the most-recently-executed foreground pipeline (which may | |
6686 | contain only a single command). | |
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 |
6692 | If this variable is in the environment when <CODE>bash</CODE> starts, the shell |
6693 | enters POSIX mode (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>) before reading the | |
6694 | startup files, as if the <SAMP>`--posix'</SAMP> invocation option had been supplied. | |
6695 | If it is set while the shell is running, <CODE>bash</CODE> enables POSIX mode, | |
6696 | as if the command | |
6697 | <TABLE><tr><td> </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 |
6704 | The process ID of the shell's parent process. This variable |
6705 | is 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 |
6711 | If set, the value is interpreted as a command to execute |
6712 | before 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 |
6718 | If set to a number greater than zero, the value is used as the number of |
6719 | trailing directory components to retain when expanding the <CODE>\w</CODE> and | |
6720 | <CODE>\W</CODE> prompt string escapes (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>). | |
6721 | Characters removed are replaced with an ellipsis. | |
6722 | <P> | |
6723 | ||
0001803f | 6724 | <A NAME="IDX262"></A> |
17345e5a | 6725 | <DT><CODE>PS3</CODE> |
0001803f | 6726 | <DD><A NAME="IDX263"></A> |
17345e5a JA |
6727 | The value of this variable is used as the prompt for the |
6728 | <CODE>select</CODE> command. If this variable is not set, the | |
6729 | <CODE>select</CODE> command prompts with <SAMP>`#? '</SAMP> | |
6730 | <P> | |
6731 | ||
0001803f | 6732 | <A NAME="IDX264"></A> |
17345e5a | 6733 | <DT><CODE>PS4</CODE> |
0001803f | 6734 | <DD><A NAME="IDX265"></A> |
17345e5a JA |
6735 | The value is the prompt printed before the command line is echoed |
6736 | when the <SAMP>`-x'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
6737 | The first character of <CODE>PS4</CODE> is replicated multiple times, as | |
6738 | necessary, to indicate multiple levels of indirection. | |
6739 | The default is <SAMP>`+ '</SAMP>. | |
6740 | <P> | |
6741 | ||
0001803f | 6742 | <A NAME="IDX266"></A> |
17345e5a | 6743 | <DT><CODE>PWD</CODE> |
0001803f | 6744 | <DD><A NAME="IDX267"></A> |
17345e5a JA |
6745 | The 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 |
6751 | Each time this parameter is referenced, a random integer |
6752 | between 0 and 32767 is generated. Assigning a value to this | |
6753 | variable seeds the random number generator. | |
6754 | <P> | |
6755 | ||
0001803f | 6756 | <A NAME="IDX270"></A> |
17345e5a | 6757 | <DT><CODE>REPLY</CODE> |
0001803f | 6758 | <DD><A NAME="IDX271"></A> |
17345e5a JA |
6759 | The 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 |
6765 | This variable expands to the number of seconds since the |
6766 | shell was started. Assignment to this variable resets | |
6767 | the count to the value assigned, and the expanded value | |
6768 | becomes the value assigned plus the number of seconds | |
6769 | since the assignment. | |
6770 | <P> | |
6771 | ||
0001803f | 6772 | <A NAME="IDX274"></A> |
17345e5a | 6773 | <DT><CODE>SHELL</CODE> |
0001803f | 6774 | <DD><A NAME="IDX275"></A> |
17345e5a JA |
6775 | The full pathname to the shell is kept in this environment variable. |
6776 | If it is not set when the shell starts, | |
6777 | Bash assigns to it the full pathname of the current user's login shell. | |
6778 | <P> | |
6779 | ||
0001803f | 6780 | <A NAME="IDX276"></A> |
17345e5a | 6781 | <DT><CODE>SHELLOPTS</CODE> |
0001803f | 6782 | <DD><A NAME="IDX277"></A> |
17345e5a JA |
6783 | A colon-separated list of enabled shell options. Each word in |
6784 | the list is a valid argument for the <SAMP>`-o'</SAMP> option to the | |
6785 | <CODE>set</CODE> builtin command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
6786 | The options appearing in <CODE>SHELLOPTS</CODE> are those reported | |
6787 | as <SAMP>`on'</SAMP> by <SAMP>`set -o'</SAMP>. | |
6788 | If this variable is in the environment when Bash | |
6789 | starts up, each shell option in the list will be enabled before | |
6790 | reading any startup files. This variable is readonly. | |
6791 | <P> | |
6792 | ||
0001803f | 6793 | <A NAME="IDX278"></A> |
17345e5a | 6794 | <DT><CODE>SHLVL</CODE> |
0001803f | 6795 | <DD><A NAME="IDX279"></A> |
17345e5a JA |
6796 | Incremented by one each time a new instance of Bash is started. This is |
6797 | intended to be a count of how deeply your Bash shells are nested. | |
6798 | <P> | |
6799 | ||
0001803f | 6800 | <A NAME="IDX280"></A> |
17345e5a | 6801 | <DT><CODE>TIMEFORMAT</CODE> |
0001803f | 6802 | <DD><A NAME="IDX281"></A> |
17345e5a JA |
6803 | The value of this parameter is used as a format string specifying |
6804 | how the timing information for pipelines prefixed with the <CODE>time</CODE> | |
6805 | reserved word should be displayed. | |
6806 | The <SAMP>`%'</SAMP> character introduces an | |
6807 | escape sequence that is expanded to a time value or other | |
6808 | information. | |
6809 | The escape sequences and their meanings are as | |
6810 | follows; 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 | ||
6836 | The optional <VAR>p</VAR> is a digit specifying the precision, the number of | |
6837 | fractional digits after a decimal point. | |
6838 | A value of 0 causes no decimal point or fraction to be output. | |
6839 | At most three places after the decimal point may be specified; values | |
6840 | of <VAR>p</VAR> greater than 3 are changed to 3. | |
6841 | If <VAR>p</VAR> is not specified, the value 3 is used. | |
6842 | </P><P> | |
6843 | ||
6844 | The optional <CODE>l</CODE> specifies a longer format, including minutes, of | |
6845 | the form <VAR>MM</VAR>m<VAR>SS</VAR>.<VAR>FF</VAR>s. | |
6846 | The value of <VAR>p</VAR> determines whether or not the fraction is included. | |
6847 | </P><P> | |
6848 | ||
6849 | If this variable is not set, Bash acts as if it had the value | |
6850 | <TABLE><tr><td> </td><td class=example><pre><CODE>$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'</CODE> | |
6851 | </pre></td></tr></table>If the value is null, no timing information is displayed. | |
6852 | A trailing newline is added when the format string is displayed. | |
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 |
6858 | If set to a value greater than zero, <CODE>TMOUT</CODE> is treated as the |
6859 | default timeout for the <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
6860 | The <CODE>select</CODE> command (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) terminates | |
6861 | if input does not arrive after <CODE>TMOUT</CODE> seconds when input is coming | |
6862 | from a terminal. | |
6863 | <P> | |
6864 | ||
6865 | In an interactive shell, the value is interpreted as | |
6866 | the number of seconds to wait for input after issuing the primary | |
6867 | prompt when the shell is interactive. | |
6868 | Bash terminates after that number of seconds if input does | |
6869 | not 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 |
6875 | If set, Bash uses its value as the name of a directory in which |
6876 | Bash creates temporary files for the shell's use. | |
6877 | <P> | |
6878 | ||
0001803f | 6879 | <A NAME="IDX286"></A> |
17345e5a | 6880 | <DT><CODE>UID</CODE> |
0001803f | 6881 | <DD><A NAME="IDX287"></A> |
17345e5a JA |
6882 | The 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"> < </A>]</TD> | |
6893 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> > </A>]</TD> | |
6894 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD> | |
6895 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
6896 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
6897 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
6898 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
6899 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
6900 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
6901 | </TR></TABLE> | |
6902 | <H1> 6. Bash Features </H1> | |
6903 | <!--docid::SEC68::--> | |
6904 | <P> | |
6905 | ||
6906 | This 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> </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> </TD><TD ALIGN="left" VALIGN="TOP">When and how Bash executes scripts.</TD></TR> | |
6913 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What an interactive shell is.</TD></TR> | |
6914 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Primitives used in composing expressions for | |
6915 | the <CODE>test</CODE> builtin.</TD></TR> | |
6916 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Arithmetic on shell variables.</TD></TR> | |
6917 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC84">6.6 Aliases</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Substituting one command for another.</TD></TR> | |
6918 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC85">6.7 Arrays</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Array Variables.</TD></TR> | |
6919 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC86">6.8 The Directory Stack</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">History of visited directories.</TD></TR> | |
6920 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling the PS1 string.</TD></TR> | |
6921 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A more controlled mode of shell execution.</TD></TR> | |
6922 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Making Bash behave more closely to what | |
6923 | the POSIX standard specifies.</TD></TR> | |
6924 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
6932 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> > </A>]</TD> | |
6933 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> << </A>]</TD> | |
6934 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
6935 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
6936 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
6937 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
6938 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
6939 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
6940 | </TR></TABLE> | |
6941 | <H2> 6.1 Invoking Bash </H2> | |
6942 | <!--docid::SEC69::--> | |
6943 | <P> | |
6944 | ||
6945 | <TABLE><tr><td> </td><td class=example><pre>bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>] | |
6946 | bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] -c <VAR>string</VAR> [<VAR>argument</VAR> <small>...</small>] | |
6947 | bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>] | |
6948 | </pre></td></tr></table></P><P> | |
6949 | ||
6950 | In addition to the single-character shell command-line options | |
6951 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), there are several multi-character | |
6952 | options that you can use. These options must appear on the command | |
6953 | line before the single-character options to be recognized. | |
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 | |
6959 | starts. Turns on extended debugging mode (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A> | |
6960 | for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE> | |
6961 | builtin) and shell function tracing | |
6962 | (see <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A> for a description of the <CODE>-o functrace</CODE> | |
6963 | option). | |
6964 | <P> | |
6965 | ||
6966 | <DT><CODE>--dump-po-strings</CODE> | |
6967 | <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP> | |
6968 | is printed on the standard output | |
6969 | in the GNU <CODE>gettext</CODE> PO (portable object) file format. | |
6970 | Equivalent to <SAMP>`-D'</SAMP> except for the output format. | |
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>) | |
6984 | in 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>) | |
6993 | to 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> | |
6998 | or any of the personal initialization files | |
6999 | <TT>`~/.bash_profile'</TT>, <TT>`~/.bash_login'</TT>, or <TT>`~/.profile'</TT> | |
7000 | when Bash is invoked as a login shell. | |
7001 | <P> | |
7002 | ||
7003 | <DT><CODE>--norc</CODE> | |
7004 | <DD>Don't read the <TT>`~/.bashrc'</TT> initialization file in an | |
7005 | interactive shell. This is on by default if the shell is | |
7006 | invoked as <CODE>sh</CODE>. | |
7007 | <P> | |
7008 | ||
7009 | <DT><CODE>--posix</CODE> | |
7010 | <DD>Change the behavior of Bash where the default operation differs | |
7011 | from the POSIX standard to match the standard. This | |
7012 | is intended to make Bash behave as a strict superset of that | |
7013 | standard. See section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>, for a description of the Bash | |
7014 | POSIX 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 | |
7027 | Bash on the standard output and exit successfully. | |
7028 | <P> | |
7029 | ||
7030 | </DL> | |
7031 | <P> | |
7032 | ||
7033 | There are several single-character options that may be supplied at | |
7034 | invocation 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 | |
7040 | options, then exit. Any remaining arguments are assigned to the | |
7041 | positional 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 | |
7046 | described 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. | |
7051 | When the shell is interactive, this is equivalent to starting a | |
7052 | login shell with <SAMP>`exec -l bash'</SAMP>. | |
7053 | When the shell is not interactive, the login shell startup files will | |
7054 | be executed. | |
7055 | <SAMP>`exec bash -l'</SAMP> or <SAMP>`exec bash --login'</SAMP> | |
7056 | will replace the current shell with a Bash login shell. | |
7057 | See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>, for a description of the special behavior | |
7058 | of 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 | |
7067 | processing, then commands are read from the standard input. | |
7068 | This option allows the positional parameters to be set | |
7069 | when invoking an interactive shell. | |
7070 | <P> | |
7071 | ||
7072 | <DT><CODE>-D</CODE> | |
7073 | <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP> | |
7074 | is printed on the standard output. | |
7075 | These are the strings that | |
7076 | are subject to language translation when the current locale | |
7077 | is not <CODE>C</CODE> or <CODE>POSIX</CODE> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>). | |
7078 | This implies the <SAMP>`-n'</SAMP> option; no commands will be executed. | |
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>). | |
7084 | If <VAR>shopt_option</VAR> is present, <SAMP>`-O'</SAMP> sets the value of that option; | |
7085 | <SAMP>`+O'</SAMP> unsets it. | |
7086 | If <VAR>shopt_option</VAR> is not supplied, the names and values of the shell | |
7087 | options accepted by <CODE>shopt</CODE> are printed on the standard output. | |
7088 | If the invocation option is <SAMP>`+O'</SAMP>, the output is displayed in a format | |
7089 | that may be reused as input. | |
7090 | <P> | |
7091 | ||
7092 | <DT><CODE>--</CODE> | |
7093 | <DD>A <CODE>--</CODE> signals the end of options and disables further option | |
7094 | processing. | |
7095 | Any 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 |
7102 | A <EM>login</EM> shell is one whose first character of argument zero is |
7103 | <SAMP>`-'</SAMP>, or one invoked with the <SAMP>`--login'</SAMP> option. | |
7104 | </P><P> | |
7105 | ||
0001803f | 7106 | <A NAME="IDX289"></A> |
17345e5a JA |
7107 | An <EM>interactive</EM> shell is one started without non-option arguments, |
7108 | unless <SAMP>`-s'</SAMP> is specified, | |
7109 | without specifying the <SAMP>`-c'</SAMP> option, and whose input and output are both | |
7110 | connected to terminals (as determined by <CODE>isatty(3)</CODE>), or one | |
7111 | started with the <SAMP>`-i'</SAMP> option. See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for more | |
7112 | information. | |
7113 | </P><P> | |
7114 | ||
7115 | If arguments remain after option processing, and neither the | |
7116 | <SAMP>`-c'</SAMP> nor the <SAMP>`-s'</SAMP> | |
7117 | option has been supplied, the first argument is assumed to | |
7118 | be the name of a file containing shell commands (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>). | |
7119 | When Bash is invoked in this fashion, <CODE>$0</CODE> | |
7120 | is set to the name of the file, and the positional parameters | |
7121 | are set to the remaining arguments. | |
7122 | Bash reads and executes commands from this file, then exits. | |
7123 | Bash's exit status is the exit status of the last command executed | |
7124 | in the script. If no commands are executed, the exit status is 0. | |
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"> < </A>]</TD> | |
7132 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> > </A>]</TD> | |
7133 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> << </A>]</TD> | |
7134 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7135 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7136 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7137 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7138 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7139 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7140 | </TR></TABLE> | |
7141 | <H2> 6.2 Bash Startup Files </H2> | |
7142 | <!--docid::SEC70::--> | |
7143 | <P> | |
7144 | ||
7145 | This section describes how Bash executes its startup files. | |
7146 | If any of the files exist but cannot be read, Bash reports an error. | |
7147 | Tildes are expanded in file names as described above under | |
7148 | Tilde Expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>). | |
7149 | </P><P> | |
7150 | ||
7151 | Interactive 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 | ||
7159 | When Bash is invoked as an interactive login shell, or as a | |
7160 | non-interactive shell with the <SAMP>`--login'</SAMP> option, it first reads and | |
7161 | executes commands from the file <TT>`/etc/profile'</TT>, if that file exists. | |
7162 | After reading that file, it looks for <TT>`~/.bash_profile'</TT>, | |
7163 | <TT>`~/.bash_login'</TT>, and <TT>`~/.profile'</TT>, in that order, and reads | |
7164 | and executes commands from the first one that exists and is readable. | |
7165 | The <SAMP>`--noprofile'</SAMP> option may be used when the shell is started to | |
7166 | inhibit this behavior. | |
7167 | </P><P> | |
7168 | ||
7169 | When a login shell exits, Bash reads and executes commands from | |
7170 | the 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 | ||
7178 | When an interactive shell that is not a login shell is started, Bash | |
7179 | reads and executes commands from <TT>`~/.bashrc'</TT>, if that file exists. | |
7180 | This may be inhibited by using the <SAMP>`--norc'</SAMP> option. | |
7181 | The <SAMP>`--rcfile <VAR>file</VAR>'</SAMP> option will force Bash to read and | |
7182 | execute commands from <VAR>file</VAR> instead of <TT>`~/.bashrc'</TT>. | |
7183 | </P><P> | |
7184 | ||
7185 | So, typically, your <TT>`~/.bash_profile'</TT> contains the line | |
7186 | <TABLE><tr><td> </td><td class=example><pre><CODE>if [ -f ~/.bashrc ]; then . ~/.bashrc; fi</CODE> | |
7187 | </pre></td></tr></table>after (or before) any login-specific initializations. | |
7188 | </P><P> | |
7189 | ||
7190 | <A NAME="SEC73"></A> | |
7191 | <H4> Invoked non-interactively </H4> | |
7192 | <!--docid::SEC73::--> | |
7193 | <P> | |
7194 | ||
7195 | When Bash is started non-interactively, to run a shell script, | |
7196 | for example, it looks for the variable <CODE>BASH_ENV</CODE> in the environment, | |
7197 | expands its value if it appears there, and uses the expanded value as | |
7198 | the name of a file to read and execute. Bash behaves as if the | |
7199 | following command were executed: | |
7200 | <TABLE><tr><td> </td><td class=example><pre><CODE>if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi</CODE> | |
7201 | </pre></td></tr></table>but the value of the <CODE>PATH</CODE> variable is not used to search for the | |
7202 | file name. | |
7203 | </P><P> | |
7204 | ||
7205 | As noted above, if a non-interactive shell is invoked with the | |
7206 | <SAMP>`--login'</SAMP> option, Bash attempts to read and execute commands from the | |
7207 | login shell startup files. | |
7208 | </P><P> | |
7209 | ||
7210 | <A NAME="SEC74"></A> | |
7211 | <H4> Invoked with name <CODE>sh</CODE> </H4> | |
7212 | <!--docid::SEC74::--> | |
7213 | <P> | |
7214 | ||
7215 | If Bash is invoked with the name <CODE>sh</CODE>, it tries to mimic the | |
7216 | startup behavior of historical versions of <CODE>sh</CODE> as closely as | |
7217 | possible, while conforming to the POSIX standard as well. | |
7218 | </P><P> | |
7219 | ||
7220 | When invoked as an interactive login shell, or as a non-interactive | |
7221 | shell with the <SAMP>`--login'</SAMP> option, it first attempts to read | |
7222 | and execute commands from <TT>`/etc/profile'</TT> and <TT>`~/.profile'</TT>, in | |
7223 | that order. | |
7224 | The <SAMP>`--noprofile'</SAMP> option may be used to inhibit this behavior. | |
7225 | When invoked as an interactive shell with the name <CODE>sh</CODE>, Bash | |
7226 | looks for the variable <CODE>ENV</CODE>, expands its value if it is defined, | |
7227 | and uses the expanded value as the name of a file to read and execute. | |
7228 | Since a shell invoked as <CODE>sh</CODE> does not attempt to read and execute | |
7229 | commands from any other startup files, the <SAMP>`--rcfile'</SAMP> option has | |
7230 | no effect. | |
7231 | A non-interactive shell invoked with the name <CODE>sh</CODE> does not attempt | |
7232 | to read any other startup files. | |
7233 | </P><P> | |
7234 | ||
7235 | When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after | |
7236 | the 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 | ||
7244 | When Bash is started in POSIX mode, as with the | |
7245 | <SAMP>`--posix'</SAMP> command line option, it follows the POSIX standard | |
7246 | for startup files. | |
7247 | In this mode, interactive shells expand the <CODE>ENV</CODE> variable | |
7248 | and commands are read and executed from the file whose name is the | |
7249 | expanded value. | |
7250 | No 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 | ||
7258 | Bash attempts to determine when it is being run with its standard input | |
7259 | connected to a a network connection, as if by the remote shell | |
7260 | daemon, usually <CODE>rshd</CODE>, or the secure shell daemon <CODE>sshd</CODE>. | |
7261 | If Bash determines it is being run in | |
7262 | this fashion, it reads and executes commands from <TT>`~/.bashrc'</TT>, if that | |
7263 | file exists and is readable. | |
7264 | It will not do this if invoked as <CODE>sh</CODE>. | |
7265 | The <SAMP>`--norc'</SAMP> option may be used to inhibit this behavior, and the | |
7266 | <SAMP>`--rcfile'</SAMP> option may be used to force another file to be read, but | |
7267 | <CODE>rshd</CODE> does not generally invoke the shell with those options or | |
7268 | allow them to be specified. | |
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 | ||
7276 | If Bash is started with the effective user (group) id not equal to the | |
7277 | real user (group) id, and the <CODE>-p</CODE> option is not supplied, no startup | |
7278 | files are read, shell functions are not inherited from the environment, | |
0001803f CR |
7279 | the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE>, and <CODE>GLOBIGNORE</CODE> |
7280 | variables, if they appear in the environment, are ignored, and the effective | |
7281 | user id is set to the real user id. | |
17345e5a JA |
7282 | If the <CODE>-p</CODE> option is supplied at invocation, the startup behavior is |
7283 | the same, but the effective user id is not reset. | |
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"> < </A>]</TD> | |
7291 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> > </A>]</TD> | |
7292 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD> | |
7293 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7294 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD> | |
7295 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7296 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7297 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7298 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">What determines whether a shell is Interactive.</TD></TR> | |
7306 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC80">6.3.2 Is this Shell Interactive?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to tell if a shell is interactive.</TD></TR> | |
7307 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC81">6.3.3 Interactive Shell Behavior</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What changes in a interactive shell?</TD></TR> | |
7308 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
7316 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> > </A>]</TD> | |
7317 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD> | |
7318 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD> | |
7319 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD> | |
7320 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7321 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7322 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7323 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7324 | </TR></TABLE> | |
7325 | <H3> 6.3.1 What is an Interactive Shell? </H3> | |
7326 | <!--docid::SEC79::--> | |
7327 | <P> | |
7328 | ||
7329 | An interactive shell | |
7330 | is one started without non-option arguments, unless <SAMP>`-s'</SAMP> is | |
7331 | specified, without specifying the <SAMP>`-c'</SAMP> option, and | |
7332 | whose input and error output are both | |
7333 | connected to terminals (as determined by <CODE>isatty(3)</CODE>), | |
7334 | or one started with the <SAMP>`-i'</SAMP> option. | |
7335 | </P><P> | |
7336 | ||
7337 | An interactive shell generally reads from and writes to a user's | |
7338 | terminal. | |
7339 | </P><P> | |
7340 | ||
7341 | The <SAMP>`-s'</SAMP> invocation option may be used to set the positional parameters | |
7342 | when 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"> < </A>]</TD> | |
7350 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> > </A>]</TD> | |
7351 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> << </A>]</TD> | |
7352 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD> | |
7353 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD> | |
7354 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7355 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7356 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7357 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7358 | </TR></TABLE> | |
7359 | <H3> 6.3.2 Is this Shell Interactive? </H3> | |
7360 | <!--docid::SEC80::--> | |
7361 | <P> | |
7362 | ||
7363 | To determine within a startup script whether or not Bash is | |
7364 | running interactively, | |
7365 | test the value of the <SAMP>`-'</SAMP> special parameter. | |
7366 | It contains <CODE>i</CODE> when the shell is interactive. For example: | |
7367 | </P><P> | |
7368 | ||
7369 | <TABLE><tr><td> </td><td class=example><pre>case "$-" in | |
7370 | *i*) echo This shell is interactive ;; | |
7371 | *) echo This shell is not interactive ;; | |
7372 | esac | |
7373 | </pre></td></tr></table></P><P> | |
7374 | ||
7375 | Alternatively, startup scripts may examine the variable | |
7376 | <CODE>PS1</CODE>; it is unset in non-interactive shells, and set in | |
7377 | interactive shells. Thus: | |
7378 | </P><P> | |
7379 | ||
7380 | <TABLE><tr><td> </td><td class=example><pre>if [ -z "$PS1" ]; then | |
7381 | echo This shell is not interactive | |
7382 | else | |
7383 | echo This shell is interactive | |
7384 | fi | |
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"> < </A>]</TD> | |
7392 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> > </A>]</TD> | |
7393 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD> | |
7394 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD> | |
7395 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD> | |
7396 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7397 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7398 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7399 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7400 | </TR></TABLE> | |
7401 | <H3> 6.3.3 Interactive Shell Behavior </H3> | |
7402 | <!--docid::SEC81::--> | |
7403 | <P> | |
7404 | ||
7405 | When the shell is running interactively, it changes its behavior in | |
7406 | several ways. | |
7407 | </P><P> | |
7408 | ||
7409 | <OL> | |
7410 | <LI> | |
7411 | Startup files are read and executed as described in <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>. | |
7412 | <P> | |
7413 | ||
7414 | <LI> | |
7415 | Job Control (see section <A HREF="bashref.html#SEC91">7. Job Control</A>) is enabled by default. When job | |
7416 | control is in effect, Bash ignores the keyboard-generated job control | |
7417 | signals <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>. | |
7418 | <P> | |
7419 | ||
7420 | <LI> | |
7421 | Bash expands and displays <CODE>PS1</CODE> before reading the first line | |
7422 | of a command, and expands and displays <CODE>PS2</CODE> before reading the | |
7423 | second and subsequent lines of a multi-line command. | |
7424 | <P> | |
7425 | ||
7426 | <LI> | |
7427 | Bash executes the value of the <CODE>PROMPT_COMMAND</CODE> variable as a command | |
7428 | before printing the primary prompt, <CODE>$PS1</CODE> | |
7429 | (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
7430 | <P> | |
7431 | ||
7432 | <LI> | |
7433 | Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) is used to read commands from | |
7434 | the user's terminal. | |
7435 | <P> | |
7436 | ||
7437 | <LI> | |
7438 | Bash inspects the value of the <CODE>ignoreeof</CODE> option to <CODE>set -o</CODE> | |
7439 | instead of exiting immediately when it receives an <CODE>EOF</CODE> on its | |
7440 | standard input when reading a command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
7441 | <P> | |
7442 | ||
7443 | <LI> | |
7444 | Command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>) | |
7445 | and history expansion (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>) | |
7446 | are enabled by default. | |
7447 | Bash will save the command history to the file named by <CODE>$HISTFILE</CODE> | |
7448 | when an interactive shell exits. | |
7449 | <P> | |
7450 | ||
7451 | <LI> | |
7452 | Alias expansion (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>) is performed by default. | |
7453 | <P> | |
7454 | ||
7455 | <LI> | |
7456 | In the absence of any traps, Bash ignores <CODE>SIGTERM</CODE> | |
7457 | (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>). | |
7458 | <P> | |
7459 | ||
7460 | <LI> | |
7461 | In the absence of any traps, <CODE>SIGINT</CODE> is caught and handled | |
7462 | ((see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>). | |
7463 | <CODE>SIGINT</CODE> will interrupt some shell builtins. | |
7464 | <P> | |
7465 | ||
7466 | <LI> | |
7467 | An interactive login shell sends a <CODE>SIGHUP</CODE> to all jobs on exit | |
7468 | if the <CODE>huponexit</CODE> shell option has been enabled (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>). | |
7469 | <P> | |
7470 | ||
7471 | <LI> | |
7472 | The <SAMP>`-n'</SAMP> invocation option is ignored, and <SAMP>`set -n'</SAMP> has | |
7473 | no effect (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
7474 | <P> | |
7475 | ||
7476 | <LI> | |
7477 | Bash will check for mail periodically, depending on the values of the | |
7478 | <CODE>MAIL</CODE>, <CODE>MAILPATH</CODE>, and <CODE>MAILCHECK</CODE> shell variables | |
7479 | (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
7480 | <P> | |
7481 | ||
7482 | <LI> | |
7483 | Expansion errors due to references to unbound shell variables after | |
7484 | <SAMP>`set -u'</SAMP> has been enabled will not cause the shell to exit | |
7485 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
7486 | <P> | |
7487 | ||
7488 | <LI> | |
7489 | The shell will not exit on expansion errors caused by <VAR>var</VAR> being unset | |
7490 | or null in <CODE>${<VAR>var</VAR>:?<VAR>word</VAR>}</CODE> expansions | |
7491 | (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
7492 | <P> | |
7493 | ||
7494 | <LI> | |
7495 | Redirection errors encountered by shell builtins will not cause the | |
7496 | shell to exit. | |
7497 | <P> | |
7498 | ||
7499 | <LI> | |
7500 | When running in POSIX mode, a special builtin returning an error | |
7501 | status will not cause the shell to exit (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>). | |
7502 | <P> | |
7503 | ||
7504 | <LI> | |
7505 | A failed <CODE>exec</CODE> will not cause the shell to exit | |
7506 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
7507 | <P> | |
7508 | ||
7509 | <LI> | |
7510 | Parser syntax errors will not cause the shell to exit. | |
7511 | <P> | |
7512 | ||
7513 | <LI> | |
7514 | Simple spelling correction for directory arguments to the <CODE>cd</CODE> | |
7515 | builtin is enabled by default (see the description of the <CODE>cdspell</CODE> | |
7516 | option to the <CODE>shopt</CODE> builtin in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>). | |
7517 | <P> | |
7518 | ||
7519 | <LI> | |
7520 | The shell will check the value of the <CODE>TMOUT</CODE> variable and exit | |
7521 | if a command is not read within the specified number of seconds after | |
7522 | printing <CODE>$PS1</CODE> (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
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"> < </A>]</TD> | |
7533 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> > </A>]</TD> | |
7534 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> << </A>]</TD> | |
7535 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7536 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7537 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7538 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7539 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7540 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7541 | </TR></TABLE> | |
7542 | <H2> 6.4 Bash Conditional Expressions </H2> | |
7543 | <!--docid::SEC82::--> | |
7544 | <P> | |
7545 | ||
7546 | Conditional expressions are used by the <CODE>[[</CODE> compound command | |
7547 | and the <CODE>test</CODE> and <CODE>[</CODE> builtin commands. | |
7548 | </P><P> | |
7549 | ||
7550 | Expressions may be unary or binary. | |
7551 | Unary expressions are often used to examine the status of a file. | |
7552 | There are string operators and numeric comparison operators as well. | |
7553 | If the <VAR>file</VAR> argument to one of the primaries is of the form | |
7554 | <TT>`/dev/fd/<VAR>N</VAR>'</TT>, then file descriptor <VAR>N</VAR> is checked. | |
7555 | If the <VAR>file</VAR> argument to one of the primaries is one of | |
7556 | <TT>`/dev/stdin'</TT>, <TT>`/dev/stdout'</TT>, or <TT>`/dev/stderr'</TT>, file | |
7557 | descriptor 0, 1, or 2, respectively, is checked. | |
7558 | </P><P> | |
7559 | ||
0001803f CR |
7560 | When used with <SAMP>`[['</SAMP>, The <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP> operators sort |
7561 | lexicographically using the current locale. | |
7562 | </P><P> | |
7563 | ||
17345e5a JA |
7564 | Unless otherwise specified, primaries that operate on files follow symbolic |
7565 | links and operate on the target of the link, rather than the link itself. | |
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) | |
7655 | than <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>, | |
7660 | or 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 | |
7665 | inode numbers. | |
7666 | <P> | |
7667 | ||
7668 | <DT><CODE>-o <VAR>optname</VAR></CODE> | |
7669 | <DD>True if shell option <VAR>optname</VAR> is enabled. | |
7670 | The list of options appears in the description of the <SAMP>`-o'</SAMP> | |
7671 | option to the <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
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> < <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> > <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>. | |
7704 | These arithmetic binary operators return true if <VAR>arg1</VAR> | |
7705 | is equal to, not equal to, less than, less than or equal to, | |
7706 | greater than, or greater than or equal to <VAR>arg2</VAR>, | |
7707 | respectively. <VAR>Arg1</VAR> and <VAR>arg2</VAR> | |
7708 | may be positive or negative integers. | |
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"> < </A>]</TD> | |
7719 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> > </A>]</TD> | |
7720 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> << </A>]</TD> | |
7721 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7722 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7723 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7724 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7725 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7726 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7727 | </TR></TABLE> | |
7728 | <H2> 6.5 Shell Arithmetic </H2> | |
7729 | <!--docid::SEC83::--> | |
7730 | <P> | |
7731 | ||
7732 | The shell allows arithmetic expressions to be evaluated, as one of | |
7733 | the shell expansions or by the <CODE>let</CODE> and the <SAMP>`-i'</SAMP> option | |
7734 | to the <CODE>declare</CODE> builtins. | |
7735 | </P><P> | |
7736 | ||
7737 | Evaluation is done in fixed-width integers with no check for overflow, | |
7738 | though division by 0 is trapped and flagged as an error. | |
7739 | The operators and their precedence, associativity, and values | |
7740 | are the same as in the C language. | |
7741 | The following list of operators is grouped into levels of | |
7742 | equal-precedence operators. | |
7743 | The levels are listed in order of decreasing precedence. | |
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><< >></CODE> | |
7777 | <DD>left and right bitwise shifts | |
7778 | <P> | |
7779 | ||
7780 | <DT><CODE><= >= < ></CODE> | |
7781 | <DD>comparison | |
7782 | <P> | |
7783 | ||
7784 | <DT><CODE>== !=</CODE> | |
7785 | <DD>equality and inequality | |
7786 | <P> | |
7787 | ||
7788 | <DT><CODE>&</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>&&</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>= *= /= %= += -= <<= >>= &= ^= |=</CODE> | |
7813 | <DD>assignment | |
7814 | <P> | |
7815 | ||
7816 | <DT><CODE>expr1 , expr2</CODE> | |
7817 | <DD>comma | |
7818 | </DL> | |
7819 | <P> | |
7820 | ||
7821 | Shell variables are allowed as operands; parameter expansion is | |
7822 | performed before the expression is evaluated. | |
7823 | Within an expression, shell variables may also be referenced by name | |
7824 | without using the parameter expansion syntax. | |
7825 | A shell variable that is null or unset evaluates to 0 when referenced | |
7826 | by name without using the parameter expansion syntax. | |
7827 | The value of a variable is evaluated as an arithmetic expression | |
7828 | when it is referenced, or when a variable which has been given the | |
7829 | <VAR>integer</VAR> attribute using <SAMP>`declare -i'</SAMP> is assigned a value. | |
7830 | A null value evaluates to 0. | |
7831 | A shell variable need not have its integer attribute turned on | |
7832 | to be used in an expression. | |
7833 | </P><P> | |
7834 | ||
7835 | Constants with a leading 0 are interpreted as octal numbers. | |
7836 | A leading <SAMP>`0x'</SAMP> or <SAMP>`0X'</SAMP> denotes hexadecimal. Otherwise, | |
7837 | numbers take the form [<VAR>base</VAR><CODE>#</CODE>]<VAR>n</VAR>, where <VAR>base</VAR> | |
7838 | is a decimal number between 2 and 64 representing the arithmetic | |
7839 | base, and <VAR>n</VAR> is a number in that base. If <VAR>base</VAR><CODE>#</CODE> is | |
7840 | omitted, then base 10 is used. | |
7841 | The digits greater than 9 are represented by the lowercase letters, | |
7842 | the uppercase letters, <SAMP>`@'</SAMP>, and <SAMP>`_'</SAMP>, in that order. | |
7843 | If <VAR>base</VAR> is less than or equal to 36, lowercase and uppercase | |
7844 | letters may be used interchangeably to represent numbers between 10 | |
7845 | and 35. | |
7846 | </P><P> | |
7847 | ||
7848 | Operators are evaluated in order of precedence. Sub-expressions in | |
7849 | parentheses are evaluated first and may override the precedence | |
7850 | rules 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"> < </A>]</TD> | |
7858 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> > </A>]</TD> | |
7859 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> << </A>]</TD> | |
7860 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7861 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7862 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7863 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7864 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7865 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 | |
7872 | as the first word of a simple command. | |
7873 | The shell maintains a list of aliases that may be set and unset with | |
7874 | the <CODE>alias</CODE> and <CODE>unalias</CODE> builtin commands. | |
7875 | </P><P> | |
7876 | ||
7877 | The first word of each simple command, if unquoted, is checked to see | |
7878 | if it has an alias. | |
7879 | If so, that word is replaced by the text of the alias. | |
7880 | The characters <SAMP>`/'</SAMP>, <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`='</SAMP> and any of the | |
7881 | shell metacharacters or quoting characters listed above may not appear | |
7882 | in an alias name. | |
7883 | The replacement text may contain any valid | |
7884 | shell input, including shell metacharacters. | |
7885 | The first word of the replacement text is tested for | |
7886 | aliases, but a word that is identical to an alias being expanded | |
7887 | is not expanded a second time. | |
7888 | This means that one may alias <CODE>ls</CODE> to <CODE>"ls -F"</CODE>, | |
7889 | for instance, and Bash does not try to recursively expand the | |
7890 | replacement text. If the last character of the alias value is a | |
7891 | space or tab character, then the next command word following the | |
7892 | alias is also checked for alias expansion. | |
7893 | </P><P> | |
7894 | ||
7895 | Aliases are created and listed with the <CODE>alias</CODE> | |
7896 | command, and removed with the <CODE>unalias</CODE> command. | |
7897 | </P><P> | |
7898 | ||
7899 | There is no mechanism for using arguments in the replacement text, | |
7900 | as in <CODE>csh</CODE>. | |
7901 | If arguments are needed, a shell function should be used | |
7902 | (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>). | |
7903 | </P><P> | |
7904 | ||
7905 | Aliases are not expanded when the shell is not interactive, | |
7906 | unless the <CODE>expand_aliases</CODE> shell option is set using | |
7907 | <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>). | |
7908 | </P><P> | |
7909 | ||
7910 | The rules concerning the definition and use of aliases are | |
7911 | somewhat confusing. Bash | |
7912 | always reads at least one complete line | |
7913 | of input before executing any | |
7914 | of the commands on that line. Aliases are expanded when a | |
7915 | command is read, not when it is executed. Therefore, an | |
7916 | alias definition appearing on the same line as another | |
7917 | command does not take effect until the next line of input is read. | |
7918 | The commands following the alias definition | |
7919 | on that line are not affected by the new alias. | |
7920 | This behavior is also an issue when functions are executed. | |
7921 | Aliases are expanded when a function definition is read, | |
7922 | not when the function is executed, because a function definition | |
7923 | is itself a compound command. As a consequence, aliases | |
7924 | defined in a function are not available until after that | |
7925 | function is executed. To be safe, always put | |
7926 | alias definitions on a separate line, and do not use <CODE>alias</CODE> | |
7927 | in compound commands. | |
7928 | </P><P> | |
7929 | ||
7930 | For 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"> < </A>]</TD> | |
7938 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> > </A>]</TD> | |
7939 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> << </A>]</TD> | |
7940 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7941 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7942 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7943 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7944 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7945 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7946 | </TR></TABLE> | |
7947 | <H2> 6.7 Arrays </H2> | |
7948 | <!--docid::SEC85::--> | |
7949 | <P> | |
7950 | ||
7951 | Bash provides one-dimensional indexed and associative array variables. | |
7952 | Any variable may be used as an indexed array; | |
7953 | the <CODE>declare</CODE> builtin will explicitly declare an array. | |
7954 | There is no maximum | |
7955 | limit on the size of an array, nor any requirement that members | |
7956 | be indexed or assigned contiguously. | |
7957 | Indexed arrays are referenced using integers (including arithmetic | |
7958 | expressions (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) and are zero-based; | |
7959 | associative arrays use arbitrary strings. | |
7960 | </P><P> | |
7961 | ||
7962 | An indexed array is created automatically if any variable is assigned to | |
7963 | using the syntax | |
7964 | <TABLE><tr><td> </td><td class=example><pre>name[<VAR>subscript</VAR>]=<VAR>value</VAR> | |
7965 | </pre></td></tr></table></P><P> | |
7966 | ||
7967 | The <VAR>subscript</VAR> | |
7968 | is treated as an arithmetic expression that must evaluate to a number | |
7969 | greater than or equal to zero. To explicitly declare an array, use | |
7970 | <TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR> | |
7971 | </pre></td></tr></table>The syntax | |
7972 | <TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR>[<VAR>subscript</VAR>] | |
7973 | </pre></td></tr></table>is also accepted; the <VAR>subscript</VAR> is ignored. | |
7974 | </P><P> | |
7975 | ||
7976 | Associative arrays are created using | |
7977 | <TABLE><tr><td> </td><td class=example><pre>declare -A <VAR>name</VAR>. | |
7978 | </pre></td></tr></table></P><P> | |
7979 | ||
7980 | Attributes may be | |
7981 | specified for an array variable using the <CODE>declare</CODE> and | |
7982 | <CODE>readonly</CODE> builtins. Each attribute applies to all members of | |
7983 | an array. | |
7984 | </P><P> | |
7985 | ||
7986 | Arrays are assigned to using compound assignments of the form | |
7987 | <TABLE><tr><td> </td><td class=example><pre>name=(value<VAR>1</VAR> <small>...</small> value<VAR>n</VAR>) | |
7988 | </pre></td></tr></table>where each | |
7989 | <VAR>value</VAR> is of the form <CODE>[<VAR>subscript</VAR>]=</CODE><VAR>string</VAR>. | |
7990 | Indexed array assignments do not require the bracket and subscript. | |
7991 | When assigning to indexed arrays, if | |
7992 | the optional subscript is supplied, that index is assigned to; | |
7993 | otherwise the index of the element assigned is the last index assigned | |
7994 | to by the statement plus one. Indexing starts at zero. | |
7995 | </P><P> | |
7996 | ||
7997 | When assigning to an associative array, the subscript is required. | |
7998 | </P><P> | |
7999 | ||
8000 | This syntax is also accepted by the <CODE>declare</CODE> | |
8001 | builtin. Individual array elements may be assigned to using the | |
8002 | <CODE>name[</CODE><VAR>subscript</VAR><CODE>]=</CODE><VAR>value</VAR> syntax introduced above. | |
8003 | </P><P> | |
8004 | ||
8005 | Any element of an array may be referenced using | |
8006 | <CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>. | |
8007 | The braces are required to avoid | |
8008 | conflicts with the shell's filename expansion operators. If the | |
8009 | <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the word expands to all members | |
8010 | of the array <VAR>name</VAR>. These subscripts differ only when the word | |
8011 | appears within double quotes. | |
8012 | If the word is double-quoted, | |
8013 | <CODE>${name[*]}</CODE> expands to a single word with | |
8014 | the value of each array member separated by the first character of the | |
8015 | <CODE>IFS</CODE> variable, and <CODE>${name[@]}</CODE> expands each element of | |
8016 | <VAR>name</VAR> to a separate word. When there are no array members, | |
8017 | <CODE>${name[@]}</CODE> expands to nothing. | |
8018 | If the double-quoted expansion occurs within a word, the expansion of | |
8019 | the first parameter is joined with the beginning part of the original | |
8020 | word, and the expansion of the last parameter is joined with the last | |
8021 | part of the original word. | |
8022 | This is analogous to the | |
8023 | expansion of the special parameters <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP>. | |
8024 | <CODE>${#name[</CODE><VAR>subscript</VAR><CODE>]}</CODE> expands to the length of | |
8025 | <CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>. | |
8026 | If <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or | |
8027 | <SAMP>`*'</SAMP>, the expansion is the number of elements in the array. | |
8028 | Referencing an array variable without a subscript is equivalent to | |
8029 | referencing with a subscript of 0. | |
8030 | </P><P> | |
8031 | ||
0001803f CR |
8032 | An array variable is considered set if a subscript has been assigned a |
8033 | value. The null string is a valid value. | |
8034 | </P><P> | |
8035 | ||
17345e5a JA |
8036 | The <CODE>unset</CODE> builtin is used to destroy arrays. |
8037 | <CODE>unset</CODE> <VAR>name</VAR>[<VAR>subscript</VAR>] | |
8038 | destroys the array element at index <VAR>subscript</VAR>. | |
8039 | Care must be taken to avoid unwanted side effects caused by filename | |
0001803f | 8040 | expansion. |
17345e5a JA |
8041 | <CODE>unset</CODE> <VAR>name</VAR>, where <VAR>name</VAR> is an array, removes the |
8042 | entire array. A subscript of <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP> also removes the | |
8043 | entire array. | |
8044 | </P><P> | |
8045 | ||
8046 | The <CODE>declare</CODE>, <CODE>local</CODE>, and <CODE>readonly</CODE> | |
8047 | builtins each accept a <SAMP>`-a'</SAMP> option to specify an indexed | |
8048 | array and a <SAMP>`-A'</SAMP> option to specify an associative array. | |
8049 | The <CODE>read</CODE> builtin accepts a <SAMP>`-a'</SAMP> | |
8050 | option to assign a list of words read from the standard input | |
8051 | to an array, and can read values from the standard input into | |
8052 | individual array elements. The <CODE>set</CODE> and <CODE>declare</CODE> | |
8053 | builtins display array values in a way that allows them to be | |
8054 | reused 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"> < </A>]</TD> | |
8062 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> > </A>]</TD> | |
8063 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> << </A>]</TD> | |
8064 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
8065 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> >> </A>]</TD> | |
8066 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8067 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8068 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8069 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands to manipulate | |
8077 | the directory stack.</TD></TR> | |
8078 | </TABLE></BLOCKQUOTE> | |
8079 | <P> | |
8080 | ||
8081 | The directory stack is a list of recently-visited directories. The | |
8082 | <CODE>pushd</CODE> builtin adds directories to the stack as it changes | |
8083 | the current directory, and the <CODE>popd</CODE> builtin removes specified | |
8084 | directories from the stack and changes the current directory to | |
8085 | the directory removed. The <CODE>dirs</CODE> builtin displays the contents | |
8086 | of the directory stack. | |
8087 | </P><P> | |
8088 | ||
8089 | The contents of the directory stack are also visible | |
8090 | as 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"> < </A>]</TD> | |
8098 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> > </A>]</TD> | |
8099 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> << </A>]</TD> | |
8100 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> Up </A>]</TD> | |
8101 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> >> </A>]</TD> | |
8102 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8103 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8104 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8105 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </td><td class=example><pre>dirs [+<VAR>N</VAR> | -<VAR>N</VAR>] [-clpv] |
8116 | </pre></td></tr></table>Display the list of currently remembered directories. Directories | |
8117 | are added to the list with the <CODE>pushd</CODE> command; the | |
8118 | <CODE>popd</CODE> command removes directories from the list. | |
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 | |
8122 | list printed by <CODE>dirs</CODE> when invoked without options), starting | |
8123 | with zero. | |
8124 | <DT><CODE>-<VAR>N</VAR></CODE> | |
8125 | <DD>Displays the <VAR>N</VAR>th directory (counting from the right of the | |
8126 | list printed by <CODE>dirs</CODE> when invoked without options), starting | |
8127 | with 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 | |
8132 | tilde 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 | |
8135 | line. | |
8136 | <DT><CODE>-v</CODE> | |
8137 | <DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per | |
8138 | line, prefixing each entry with its index in the stack. | |
8139 | </DL> | |
8140 | <P> | |
8141 | ||
8142 | <DT><CODE>popd</CODE> | |
0001803f | 8143 | <DD><A NAME="IDX291"></A> |
17345e5a JA |
8144 | <TABLE><tr><td> </td><td class=example><pre>popd [+<VAR>N</VAR> | -<VAR>N</VAR>] [-n] |
8145 | </pre></td></tr></table><P> | |
8146 | ||
8147 | Remove the top entry from the directory stack, and <CODE>cd</CODE> | |
8148 | to the new top directory. | |
8149 | When no arguments are given, <CODE>popd</CODE> | |
8150 | removes the top directory from the stack and | |
8151 | performs a <CODE>cd</CODE> to the new top directory. The | |
8152 | elements are numbered from 0 starting at the first directory listed with | |
8153 | <CODE>dirs</CODE>; i.e., <CODE>popd</CODE> is equivalent to <CODE>popd +0</CODE>. | |
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 | |
8157 | list printed by <CODE>dirs</CODE>), starting with zero. | |
8158 | <DT><CODE>-<VAR>N</VAR></CODE> | |
8159 | <DD>Removes the <VAR>N</VAR>th directory (counting from the right of the | |
8160 | list printed by <CODE>dirs</CODE>), starting with zero. | |
8161 | <DT><CODE>-n</CODE> | |
8162 | <DD>Suppresses the normal change of directory when removing directories | |
8163 | from 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> </td><td class=example><pre>pushd [-n] [<VAR>+N</VAR> | <VAR>-N</VAR> | <VAR>dir</VAR> ] | |
8170 | </pre></td></tr></table><P> | |
8171 | ||
8172 | Save the current directory on the top of the directory stack | |
8173 | and then <CODE>cd</CODE> to <VAR>dir</VAR>. | |
8174 | With no arguments, <CODE>pushd</CODE> exchanges the top two directories. | |
8175 | </P><P> | |
8176 | ||
8177 | <DL COMPACT> | |
8178 | <DT><CODE>-n</CODE> | |
8179 | <DD>Suppresses the normal change of directory when adding directories | |
8180 | to the stack, so that only the stack is manipulated. | |
8181 | <DT><CODE>+<VAR>N</VAR></CODE> | |
8182 | <DD>Brings the <VAR>N</VAR>th directory (counting from the left of the | |
8183 | list printed by <CODE>dirs</CODE>, starting with zero) to the top of | |
8184 | the list by rotating the stack. | |
8185 | <DT><CODE>-<VAR>N</VAR></CODE> | |
8186 | <DD>Brings the <VAR>N</VAR>th directory (counting from the right of the | |
8187 | list printed by <CODE>dirs</CODE>, starting with zero) to the top of | |
8188 | the list by rotating the stack. | |
8189 | <DT><CODE><VAR>dir</VAR></CODE> | |
8190 | <DD>Makes the current working directory be the top of the stack, and then | |
8191 | executes the equivalent of `<CODE>cd</CODE> <VAR>dir</VAR>'. | |
8192 | <CODE>cd</CODE>s to <VAR>dir</VAR>. | |
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"> < </A>]</TD> | |
8204 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> > </A>]</TD> | |
8205 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> << </A>]</TD> | |
8206 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
8207 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
8208 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8209 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8210 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8211 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8212 | </TR></TABLE> | |
8213 | <H2> 6.9 Controlling the Prompt </H2> | |
8214 | <!--docid::SEC88::--> | |
8215 | <P> | |
8216 | ||
8217 | The value of the variable <CODE>PROMPT_COMMAND</CODE> is examined just before | |
8218 | Bash prints each primary prompt. If <CODE>PROMPT_COMMAND</CODE> is set and | |
8219 | has a non-null value, then the | |
8220 | value is executed just as if it had been typed on the command line. | |
8221 | </P><P> | |
8222 | ||
8223 | In addition, the following table describes the special characters which | |
8224 | can 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 | |
8234 | into the prompt string; an empty <VAR>format</VAR> results in a locale-specific | |
8235 | time 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 | |
8252 | following 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 | |
8284 | embed 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 | ||
8290 | The command number and the history number are usually different: | |
8291 | the history number of a command is its position in the history | |
8292 | list, which may include commands restored from the history file | |
8293 | (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>), while the command number is | |
8294 | the position in the sequence of commands executed during the current | |
8295 | shell session. | |
8296 | </P><P> | |
8297 | ||
8298 | After the string is decoded, it is expanded via | |
8299 | parameter expansion, command substitution, arithmetic | |
8300 | expansion, and quote removal, subject to the value of the | |
8301 | <CODE>promptvars</CODE> shell option (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
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"> < </A>]</TD> | |
8309 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> > </A>]</TD> | |
8310 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> << </A>]</TD> | |
8311 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
8312 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
8313 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8314 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8315 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8316 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8317 | </TR></TABLE> | |
8318 | <H2> 6.10 The Restricted Shell </H2> | |
8319 | <!--docid::SEC89::--> | |
8320 | <P> | |
8321 | ||
8322 | If Bash is started with the name <CODE>rbash</CODE>, or the | |
8323 | <SAMP>`--restricted'</SAMP> | |
8324 | or | |
8325 | <SAMP>`-r'</SAMP> | |
8326 | option is supplied at invocation, the shell becomes restricted. | |
8327 | A restricted shell is used to | |
8328 | set up an environment more controlled than the standard shell. | |
8329 | A restricted shell behaves identically to <CODE>bash</CODE> | |
8330 | with the exception that the following are disallowed or not performed: | |
8331 | </P><P> | |
8332 | ||
8333 | <UL> | |
8334 | <LI> | |
8335 | Changing directories with the <CODE>cd</CODE> builtin. | |
8336 | <LI> | |
8337 | Setting or unsetting the values of the <CODE>SHELL</CODE>, <CODE>PATH</CODE>, | |
8338 | <CODE>ENV</CODE>, or <CODE>BASH_ENV</CODE> variables. | |
8339 | <LI> | |
8340 | Specifying command names containing slashes. | |
8341 | <LI> | |
8342 | Specifying a filename containing a slash as an argument to the <CODE>.</CODE> | |
8343 | builtin command. | |
8344 | <LI> | |
8345 | Specifying a filename containing a slash as an argument to the <SAMP>`-p'</SAMP> | |
8346 | option to the <CODE>hash</CODE> builtin command. | |
8347 | <LI> | |
8348 | Importing function definitions from the shell environment at startup. | |
8349 | <LI> | |
8350 | Parsing the value of <CODE>SHELLOPTS</CODE> from the shell environment at startup. | |
8351 | <LI> | |
8352 | Redirecting output using the <SAMP>`>'</SAMP>, <SAMP>`>|'</SAMP>, <SAMP>`<>'</SAMP>, <SAMP>`>&'</SAMP>, | |
8353 | <SAMP>`&>'</SAMP>, and <SAMP>`>>'</SAMP> redirection operators. | |
8354 | <LI> | |
8355 | Using the <CODE>exec</CODE> builtin to replace the shell with another command. | |
8356 | <LI> | |
8357 | Adding or deleting builtin commands with the | |
8358 | <SAMP>`-f'</SAMP> and <SAMP>`-d'</SAMP> options to the <CODE>enable</CODE> builtin. | |
8359 | <LI> | |
8360 | Using the <CODE>enable</CODE> builtin command to enable disabled shell builtins. | |
8361 | <LI> | |
8362 | Specifying the <SAMP>`-p'</SAMP> option to the <CODE>command</CODE> builtin. | |
8363 | <LI> | |
8364 | Turning off restricted mode with <SAMP>`set +r'</SAMP> or <SAMP>`set +o restricted'</SAMP>. | |
8365 | </UL> | |
8366 | <P> | |
8367 | ||
8368 | These restrictions are enforced after any startup files are read. | |
8369 | </P><P> | |
8370 | ||
8371 | When a command that is found to be a shell script is executed | |
8372 | (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>rbash</CODE> turns off any restrictions in | |
8373 | the shell spawned to execute the script. | |
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"> < </A>]</TD> | |
8381 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> > </A>]</TD> | |
8382 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> << </A>]</TD> | |
8383 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
8384 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
8385 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8386 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8387 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8388 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8389 | </TR></TABLE> | |
8390 | <H2> 6.11 Bash POSIX Mode </H2> | |
8391 | <!--docid::SEC90::--> | |
8392 | <P> | |
8393 | ||
8394 | Starting Bash with the <SAMP>`--posix'</SAMP> command-line option or executing | |
8395 | <SAMP>`set -o posix'</SAMP> while Bash is running will cause Bash to conform more | |
8396 | closely to the POSIX standard by changing the behavior to | |
8397 | match that specified by POSIX in areas where the Bash default differs. | |
8398 | </P><P> | |
8399 | ||
8400 | When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after reading the | |
8401 | startup files. | |
8402 | </P><P> | |
8403 | ||
8404 | The following list is what's changed when `POSIX mode' is in effect: | |
8405 | </P><P> | |
8406 | ||
8407 | <OL> | |
8408 | <LI> | |
8409 | When a command in the hash table no longer exists, Bash will re-search | |
8410 | <CODE>$PATH</CODE> to find the new location. This is also available with | |
8411 | <SAMP>`shopt -s checkhash'</SAMP>. | |
8412 | <P> | |
8413 | ||
8414 | <LI> | |
8415 | The message printed by the job control code and builtins when a job | |
8416 | exits with a non-zero status is `Done(status)'. | |
8417 | <P> | |
8418 | ||
8419 | <LI> | |
8420 | The message printed by the job control code and builtins when a job | |
8421 | is stopped is `Stopped(<VAR>signame</VAR>)', where <VAR>signame</VAR> is, for | |
8422 | example, <CODE>SIGTSTP</CODE>. | |
8423 | <P> | |
8424 | ||
8425 | <LI> | |
8426 | The <CODE>bg</CODE> builtin uses the required format to describe each job placed | |
8427 | in the background, which does not include an indication of whether the job | |
8428 | is the current or previous job. | |
8429 | <P> | |
8430 | ||
8431 | <LI> | |
8432 | Reserved words appearing in a context where reserved words are recognized | |
8433 | do not undergo alias expansion. | |
8434 | <P> | |
8435 | ||
8436 | <LI> | |
8437 | The POSIX <CODE>PS1</CODE> and <CODE>PS2</CODE> expansions of <SAMP>`!'</SAMP> to | |
8438 | the history number and <SAMP>`!!'</SAMP> to <SAMP>`!'</SAMP> are enabled, | |
8439 | and parameter expansion is performed on the values of <CODE>PS1</CODE> and | |
8440 | <CODE>PS2</CODE> regardless of the setting of the <CODE>promptvars</CODE> option. | |
8441 | <P> | |
8442 | ||
8443 | <LI> | |
8444 | The POSIX startup files are executed (<CODE>$ENV</CODE>) rather than | |
8445 | the normal Bash files. | |
8446 | <P> | |
8447 | ||
8448 | <LI> | |
8449 | Tilde expansion is only performed on assignments preceding a command | |
8450 | name, rather than on all assignment statements on the line. | |
8451 | <P> | |
8452 | ||
8453 | <LI> | |
8454 | The default history file is <TT>`~/.sh_history'</TT> (this is the | |
8455 | default value of <CODE>$HISTFILE</CODE>). | |
8456 | <P> | |
8457 | ||
8458 | <LI> | |
8459 | The output of <SAMP>`kill -l'</SAMP> prints all the signal names on a single line, | |
8460 | separated by spaces, without the <SAMP>`SIG'</SAMP> prefix. | |
8461 | <P> | |
8462 | ||
8463 | <LI> | |
8464 | The <CODE>kill</CODE> builtin does not accept signal names with a <SAMP>`SIG'</SAMP> | |
8465 | prefix. | |
8466 | <P> | |
8467 | ||
8468 | <LI> | |
8469 | Non-interactive shells exit if <VAR>filename</VAR> in <CODE>.</CODE> <VAR>filename</VAR> | |
8470 | is not found. | |
8471 | <P> | |
8472 | ||
8473 | <LI> | |
8474 | Non-interactive shells exit if a syntax error in an arithmetic expansion | |
8475 | results in an invalid expression. | |
8476 | <P> | |
8477 | ||
8478 | <LI> | |
8479 | Redirection operators do not perform filename expansion on the word | |
8480 | in the redirection unless the shell is interactive. | |
8481 | <P> | |
8482 | ||
8483 | <LI> | |
8484 | Redirection operators do not perform word splitting on the word in the | |
8485 | redirection. | |
8486 | <P> | |
8487 | ||
8488 | <LI> | |
8489 | Function names must be valid shell <CODE>name</CODE>s. That is, they may not | |
8490 | contain characters other than letters, digits, and underscores, and | |
8491 | may not start with a digit. Declaring a function with an invalid name | |
8492 | causes a fatal syntax error in non-interactive shells. | |
8493 | <P> | |
8494 | ||
8495 | <LI> | |
8496 | POSIX special builtins are found before shell functions | |
8497 | during command lookup. | |
8498 | <P> | |
8499 | ||
8500 | <LI> | |
8501 | If a POSIX special builtin returns an error status, a | |
8502 | non-interactive shell exits. The fatal errors are those listed in | |
8503 | the POSIX standard, and include things like passing incorrect options, | |
8504 | redirection errors, variable assignment errors for assignments preceding | |
8505 | the command name, and so on. | |
8506 | <P> | |
8507 | ||
8508 | <LI> | |
8509 | If <CODE>CDPATH</CODE> is set, the <CODE>cd</CODE> builtin will not implicitly | |
8510 | append the current directory to it. This means that <CODE>cd</CODE> will | |
8511 | fail if no valid directory name can be constructed from | |
8512 | any of the entries in <CODE>$CDPATH</CODE>, even if the a directory with | |
8513 | the same name as the name given as an argument to <CODE>cd</CODE> exists | |
8514 | in the current directory. | |
8515 | <P> | |
8516 | ||
8517 | <LI> | |
8518 | A non-interactive shell exits with an error status if a variable | |
8519 | assignment error occurs when no command name follows the assignment | |
8520 | statements. | |
8521 | A variable assignment error occurs, for example, when trying to assign | |
8522 | a value to a readonly variable. | |
8523 | <P> | |
8524 | ||
8525 | <LI> | |
8526 | A non-interactive shell exits with an error status if the iteration | |
8527 | variable in a <CODE>for</CODE> statement or the selection variable in a | |
8528 | <CODE>select</CODE> statement is a readonly variable. | |
8529 | <P> | |
8530 | ||
8531 | <LI> | |
8532 | Process substitution is not available. | |
8533 | <P> | |
8534 | ||
8535 | <LI> | |
8536 | Assignment statements preceding POSIX special builtins | |
8537 | persist in the shell environment after the builtin completes. | |
8538 | <P> | |
8539 | ||
8540 | <LI> | |
8541 | Assignment statements preceding shell function calls persist in the | |
8542 | shell environment after the function returns, as if a POSIX | |
8543 | special builtin command had been executed. | |
8544 | <P> | |
8545 | ||
8546 | <LI> | |
8547 | The <CODE>export</CODE> and <CODE>readonly</CODE> builtin commands display their | |
8548 | output in the format required by POSIX. | |
8549 | <P> | |
8550 | ||
8551 | <LI> | |
8552 | The <CODE>trap</CODE> builtin displays signal names without the leading | |
8553 | <CODE>SIG</CODE>. | |
8554 | <P> | |
8555 | ||
8556 | <LI> | |
8557 | The <CODE>trap</CODE> builtin doesn't check the first argument for a possible | |
8558 | signal specification and revert the signal handling to the original | |
8559 | disposition if it is, unless that argument consists solely of digits and | |
8560 | is a valid signal number. If users want to reset the handler for a given | |
8561 | signal to the original disposition, they should use <SAMP>`-'</SAMP> as the | |
8562 | first argument. | |
8563 | <P> | |
8564 | ||
8565 | <LI> | |
8566 | The <CODE>.</CODE> and <CODE>source</CODE> builtins do not search the current directory | |
8567 | for the filename argument if it is not found by searching <CODE>PATH</CODE>. | |
8568 | <P> | |
8569 | ||
8570 | <LI> | |
8571 | Subshells spawned to execute command substitutions inherit the value of | |
8572 | the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode, | |
8573 | Bash clears the <SAMP>`-e'</SAMP> option in such subshells. | |
8574 | <P> | |
8575 | ||
8576 | <LI> | |
8577 | Alias expansion is always enabled, even in non-interactive shells. | |
8578 | <P> | |
8579 | ||
8580 | <LI> | |
8581 | When the <CODE>alias</CODE> builtin displays alias definitions, it does not | |
8582 | display them with a leading <SAMP>`alias '</SAMP> unless the <SAMP>`-p'</SAMP> option | |
8583 | is supplied. | |
8584 | <P> | |
8585 | ||
8586 | <LI> | |
8587 | When the <CODE>set</CODE> builtin is invoked without options, it does not display | |
8588 | shell function names and definitions. | |
8589 | <P> | |
8590 | ||
8591 | <LI> | |
8592 | When the <CODE>set</CODE> builtin is invoked without options, it displays | |
8593 | variable values without quotes, unless they contain shell metacharacters, | |
8594 | even if the result contains nonprinting characters. | |
8595 | <P> | |
8596 | ||
8597 | <LI> | |
8598 | When the <CODE>cd</CODE> builtin is invoked in <VAR>logical</VAR> mode, and the pathname | |
8599 | constructed from <CODE>$PWD</CODE> and the directory name supplied as an argument | |
8600 | does not refer to an existing directory, <CODE>cd</CODE> will fail instead of | |
8601 | falling back to <VAR>physical</VAR> mode. | |
8602 | <P> | |
8603 | ||
8604 | <LI> | |
8605 | When the <CODE>pwd</CODE> builtin is supplied the <SAMP>`-P'</SAMP> option, it resets | |
8606 | <CODE>$PWD</CODE> to a pathname containing no symlinks. | |
8607 | <P> | |
8608 | ||
8609 | <LI> | |
8610 | The <CODE>pwd</CODE> builtin verifies that the value it prints is the same as the | |
8611 | current directory, even if it is not asked to check the file system with the | |
8612 | <SAMP>`-P'</SAMP> option. | |
8613 | <P> | |
8614 | ||
8615 | <LI> | |
8616 | When listing the history, the <CODE>fc</CODE> builtin does not include an | |
8617 | indication of whether or not a history entry has been modified. | |
8618 | <P> | |
8619 | ||
8620 | <LI> | |
8621 | The default editor used by <CODE>fc</CODE> is <CODE>ed</CODE>. | |
8622 | <P> | |
8623 | ||
8624 | <LI> | |
8625 | The <CODE>type</CODE> and <CODE>command</CODE> builtins will not report a non-executable | |
8626 | file as having been found, though the shell will attempt to execute such a | |
8627 | file if it is the only so-named file found in <CODE>$PATH</CODE>. | |
8628 | <P> | |
8629 | ||
8630 | <LI> | |
8631 | The <CODE>vi</CODE> editing mode will invoke the <CODE>vi</CODE> editor directly when | |
8632 | the <SAMP>`v'</SAMP> command is run, instead of checking <CODE>$VISUAL</CODE> and | |
8633 | <CODE>$EDITOR</CODE>. | |
8634 | <P> | |
8635 | ||
8636 | <LI> | |
8637 | When the <CODE>xpg_echo</CODE> option is enabled, Bash does not attempt to interpret | |
8638 | any arguments to <CODE>echo</CODE> as options. Each argument is displayed, after | |
8639 | escape characters are converted. | |
8640 | <P> | |
8641 | ||
8642 | <LI> | |
8643 | The <CODE>ulimit</CODE> builtin uses a block size of 512 bytes for the <SAMP>`-c'</SAMP> | |
8644 | and <SAMP>`-f'</SAMP> options. | |
8645 | <P> | |
8646 | ||
0001803f CR |
8647 | <LI> |
8648 | The arrival of <CODE>SIGCHLD</CODE> when a trap is set on <CODE>SIGCHLD</CODE> does | |
8649 | not interrupt the <CODE>wait</CODE> builtin and cause it to return immediately. | |
8650 | The trap command is run once for each child that exits. | |
8651 | <P> | |
8652 | ||
17345e5a JA |
8653 | </OL> |
8654 | <P> | |
8655 | ||
8656 | There is other POSIX behavior that Bash does not implement by | |
8657 | default even when in POSIX mode. | |
8658 | Specifically: | |
8659 | </P><P> | |
8660 | ||
8661 | <OL> | |
8662 | ||
8663 | <LI> | |
8664 | The <CODE>fc</CODE> builtin checks <CODE>$EDITOR</CODE> as a program to edit history | |
8665 | entries if <CODE>FCEDIT</CODE> is unset, rather than defaulting directly to | |
8666 | <CODE>ed</CODE>. <CODE>fc</CODE> uses <CODE>ed</CODE> if <CODE>EDITOR</CODE> is unset. | |
8667 | <P> | |
8668 | ||
8669 | <LI> | |
8670 | As noted above, Bash requires the <CODE>xpg_echo</CODE> option to be enabled for | |
8671 | the <CODE>echo</CODE> builtin to be fully conformant. | |
8672 | <P> | |
8673 | ||
8674 | </OL> | |
8675 | <P> | |
8676 | ||
8677 | Bash can be configured to be POSIX-conformant by default, by specifying | |
8678 | the <SAMP>`--enable-strict-posix-default'</SAMP> to <CODE>configure</CODE> when building | |
8679 | (see section <A HREF="bashref.html#SEC134">10.8 Optional Features</A>). | |
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"> < </A>]</TD> | |
8687 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> > </A>]</TD> | |
8688 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD> | |
8689 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
8690 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD> | |
8691 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8692 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8693 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8694 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8695 | </TR></TABLE> | |
8696 | <H1> 7. Job Control </H1> | |
8697 | <!--docid::SEC91::--> | |
8698 | <P> | |
8699 | ||
8700 | This chapter discusses what job control is, how it works, and how | |
8701 | Bash 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> </TD><TD ALIGN="left" VALIGN="TOP">How job control works.</TD></TR> | |
8706 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands used to interact | |
8707 | with job control.</TD></TR> | |
8708 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables Bash uses to customize job | |
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"> < </A>]</TD> | |
8718 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> > </A>]</TD> | |
8719 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD> | |
8720 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> | |
8721 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD> | |
8722 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8723 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8724 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8725 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8726 | </TR></TABLE> | |
8727 | <H2> 7.1 Job Control Basics </H2> | |
8728 | <!--docid::SEC92::--> | |
8729 | <P> | |
8730 | ||
8731 | Job control | |
8732 | refers to the ability to selectively stop (suspend) | |
8733 | the execution of processes and continue (resume) | |
8734 | their execution at a later point. A user typically employs | |
8735 | this facility via an interactive interface supplied jointly | |
0001803f | 8736 | by the operating system kernel's terminal driver and Bash. |
17345e5a JA |
8737 | </P><P> |
8738 | ||
8739 | The shell associates a <VAR>job</VAR> with each pipeline. It keeps a | |
8740 | table of currently executing jobs, which may be listed with the | |
8741 | <CODE>jobs</CODE> command. When Bash starts a job | |
8742 | asynchronously, it prints a line that looks | |
8743 | like: | |
8744 | <TABLE><tr><td> </td><td class=example><pre>[1] 25647 | |
8745 | </pre></td></tr></table>indicating that this job is job number 1 and that the process ID | |
8746 | of the last process in the pipeline associated with this job is | |
8747 | 25647. All of the processes in a single pipeline are members of | |
8748 | the same job. Bash uses the <VAR>job</VAR> abstraction as the | |
8749 | basis for job control. | |
8750 | </P><P> | |
8751 | ||
8752 | To facilitate the implementation of the user interface to job | |
8753 | control, the operating system maintains the notion of a current terminal | |
8754 | process group ID. Members of this process group (processes whose | |
8755 | process group ID is equal to the current terminal process group | |
8756 | ID) receive keyboard-generated signals such as <CODE>SIGINT</CODE>. | |
8757 | These processes are said to be in the foreground. Background | |
8758 | processes are those whose process group ID differs from the | |
8759 | terminal's; such processes are immune to keyboard-generated | |
0001803f CR |
8760 | signals. Only foreground processes are allowed to read from or, if |
8761 | the user so specifies with <CODE>stty tostop</CODE>, write to the terminal. | |
8762 | Background processes which attempt to | |
8763 | read from (write to when <CODE>stty tostop</CODE> is in effect) the | |
8764 | terminal are sent a <CODE>SIGTTIN</CODE> (<CODE>SIGTTOU</CODE>) | |
8765 | signal by the kernel's terminal driver, | |
8766 | which, unless caught, suspends the process. | |
17345e5a JA |
8767 | </P><P> |
8768 | ||
8769 | If the operating system on which Bash is running supports | |
8770 | job control, Bash contains facilities to use it. Typing the | |
8771 | <VAR>suspend</VAR> character (typically <SAMP>`^Z'</SAMP>, Control-Z) while a | |
8772 | process is running causes that process to be stopped and returns | |
8773 | control to Bash. Typing the <VAR>delayed suspend</VAR> character | |
8774 | (typically <SAMP>`^Y'</SAMP>, Control-Y) causes the process to be stopped | |
8775 | when it attempts to read input from the terminal, and control to | |
8776 | be returned to Bash. The user then manipulates the state of | |
8777 | this job, using the <CODE>bg</CODE> command to continue it in the | |
8778 | background, the <CODE>fg</CODE> command to continue it in the | |
8779 | foreground, or the <CODE>kill</CODE> command to kill it. A <SAMP>`^Z'</SAMP> | |
8780 | takes effect immediately, and has the additional side effect of | |
8781 | causing pending output and typeahead to be discarded. | |
8782 | </P><P> | |
8783 | ||
8784 | There are a number of ways to refer to a job in the shell. The | |
8785 | character <SAMP>`%'</SAMP> introduces a job specification (<VAR>jobspec</VAR>). | |
8786 | </P><P> | |
8787 | ||
8788 | Job number <CODE>n</CODE> may be referred to as <SAMP>`%n'</SAMP>. | |
8789 | The symbols <SAMP>`%%'</SAMP> and <SAMP>`%+'</SAMP> refer to the shell's notion of the | |
8790 | current job, which is the last job stopped while it was in the foreground | |
8791 | or started in the background. | |
8792 | A single <SAMP>`%'</SAMP> (with no accompanying job specification) also refers | |
8793 | to the current job. | |
8794 | The previous job may be referenced using <SAMP>`%-'</SAMP>. | |
8795 | If there is only a single job, <SAMP>`%+'</SAMP> and <SAMP>`%-'</SAMP> can both be used | |
8796 | to refer to that job. | |
8797 | In output pertaining to jobs (e.g., the output of the <CODE>jobs</CODE> | |
8798 | command), the current job is always flagged with a <SAMP>`+'</SAMP>, and the | |
8799 | previous job with a <SAMP>`-'</SAMP>. | |
8800 | </P><P> | |
8801 | ||
8802 | A job may also be referred to | |
8803 | using a prefix of the name used to start it, or using a substring | |
8804 | that appears in its command line. For example, <SAMP>`%ce'</SAMP> refers | |
8805 | to a stopped <CODE>ce</CODE> job. Using <SAMP>`%?ce'</SAMP>, on the | |
8806 | other hand, refers to any job containing the string <SAMP>`ce'</SAMP> in | |
8807 | its command line. If the prefix or substring matches more than one job, | |
8808 | Bash reports an error. | |
8809 | </P><P> | |
8810 | ||
8811 | Simply naming a job can be used to bring it into the foreground: | |
8812 | <SAMP>`%1'</SAMP> is a synonym for <SAMP>`fg %1'</SAMP>, bringing job 1 from the | |
8813 | background into the foreground. Similarly, <SAMP>`%1 &'</SAMP> resumes | |
8814 | job 1 in the background, equivalent to <SAMP>`bg %1'</SAMP> | |
8815 | </P><P> | |
8816 | ||
8817 | The shell learns immediately whenever a job changes state. | |
8818 | Normally, Bash waits until it is about to print a prompt | |
8819 | before reporting changes in a job's status so as to not interrupt | |
8820 | any other output. | |
8821 | If the <SAMP>`-b'</SAMP> option to the <CODE>set</CODE> builtin is enabled, | |
8822 | Bash reports such changes immediately (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
8823 | Any trap on <CODE>SIGCHLD</CODE> is executed for each child process | |
8824 | that exits. | |
8825 | </P><P> | |
8826 | ||
8827 | If an attempt to exit Bash is made while jobs are stopped, (or running, if | |
8828 | the <CODE>checkjobs</CODE> option is enabled -- see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the | |
8829 | shell prints a warning message, and if the <CODE>checkjobs</CODE> option is | |
8830 | enabled, lists the jobs and their statuses. | |
8831 | The <CODE>jobs</CODE> command may then be used to inspect their status. | |
8832 | If a second attempt to exit is made without an intervening command, | |
8833 | Bash does not print another warning, and any stopped jobs are terminated. | |
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"> < </A>]</TD> | |
8841 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> > </A>]</TD> | |
8842 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> << </A>]</TD> | |
8843 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> | |
8844 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD> | |
8845 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8846 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8847 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8848 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </td><td class=example><pre>bg [<VAR>jobspec</VAR> <small>...</small>] |
8859 | </pre></td></tr></table>Resume each suspended job <VAR>jobspec</VAR> in the background, as if it | |
8860 | had been started with <SAMP>`&'</SAMP>. | |
8861 | If <VAR>jobspec</VAR> is not supplied, the current job is used. | |
8862 | The return status is zero unless it is run when job control is not | |
8863 | enabled, or, when run with job control enabled, any | |
8864 | <VAR>jobspec</VAR> was not found or specifies a job | |
8865 | that was started without job control. | |
8866 | <P> | |
8867 | ||
8868 | <DT><CODE>fg</CODE> | |
0001803f | 8869 | <DD><A NAME="IDX294"></A> |
17345e5a JA |
8870 | <TABLE><tr><td> </td><td class=example><pre>fg [<VAR>jobspec</VAR>] |
8871 | </pre></td></tr></table>Resume the job <VAR>jobspec</VAR> in the foreground and make it the current job. | |
8872 | If <VAR>jobspec</VAR> is not supplied, the current job is used. | |
8873 | The return status is that of the command placed into the foreground, | |
8874 | or non-zero if run when job control is disabled or, when run with | |
8875 | job control enabled, <VAR>jobspec</VAR> does not specify a valid job or | |
8876 | <VAR>jobspec</VAR> specifies a job that was started without job control. | |
8877 | <P> | |
8878 | ||
8879 | <DT><CODE>jobs</CODE> | |
0001803f | 8880 | <DD><A NAME="IDX295"></A> |
17345e5a JA |
8881 | <TABLE><tr><td> </td><td class=example><pre>jobs [-lnprs] [<VAR>jobspec</VAR>] |
8882 | jobs -x <VAR>command</VAR> [<VAR>arguments</VAR>] | |
8883 | </pre></td></tr></table><P> | |
8884 | ||
8885 | The first form lists the active jobs. The options have the | |
8886 | following 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 | |
8896 | the 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 | ||
8912 | If <VAR>jobspec</VAR> is given, | |
8913 | output is restricted to information about that job. | |
8914 | If <VAR>jobspec</VAR> is not supplied, the status of all jobs is | |
8915 | listed. | |
8916 | </P><P> | |
8917 | ||
8918 | If the <SAMP>`-x'</SAMP> option is supplied, <CODE>jobs</CODE> replaces any | |
8919 | <VAR>jobspec</VAR> found in <VAR>command</VAR> or <VAR>arguments</VAR> with the | |
8920 | corresponding process group ID, and executes <VAR>command</VAR>, | |
8921 | passing it <VAR>argument</VAR>s, returning its exit status. | |
8922 | </P><P> | |
8923 | ||
8924 | <DT><CODE>kill</CODE> | |
0001803f | 8925 | <DD><A NAME="IDX296"></A> |
17345e5a JA |
8926 | <TABLE><tr><td> </td><td class=example><pre>kill [-s <VAR>sigspec</VAR>] [-n <VAR>signum</VAR>] [-<VAR>sigspec</VAR>] <VAR>jobspec</VAR> or <VAR>pid</VAR> |
8927 | kill -l [<VAR>exit_status</VAR>] | |
8928 | </pre></td></tr></table>Send a signal specified by <VAR>sigspec</VAR> or <VAR>signum</VAR> to the process | |
8929 | named by job specification <VAR>jobspec</VAR> or process ID <VAR>pid</VAR>. | |
8930 | <VAR>sigspec</VAR> is either a case-insensitive signal name such as | |
8931 | <CODE>SIGINT</CODE> (with or without the <CODE>SIG</CODE> prefix) | |
8932 | or a signal number; <VAR>signum</VAR> is a signal number. | |
8933 | If <VAR>sigspec</VAR> and <VAR>signum</VAR> are not present, <CODE>SIGTERM</CODE> is used. | |
8934 | The <SAMP>`-l'</SAMP> option lists the signal names. | |
8935 | If any arguments are supplied when <SAMP>`-l'</SAMP> is given, the names of the | |
8936 | signals corresponding to the arguments are listed, and the return status | |
8937 | is zero. | |
8938 | <VAR>exit_status</VAR> is a number specifying a signal number or the exit | |
8939 | status of a process terminated by a signal. | |
8940 | The return status is zero if at least one signal was successfully sent, | |
8941 | or non-zero if an error occurs or an invalid option is encountered. | |
8942 | <P> | |
8943 | ||
8944 | <DT><CODE>wait</CODE> | |
0001803f | 8945 | <DD><A NAME="IDX297"></A> |
17345e5a JA |
8946 | <TABLE><tr><td> </td><td class=example><pre>wait [<VAR>jobspec</VAR> or <VAR>pid</VAR> ...] |
8947 | </pre></td></tr></table>Wait until the child process specified by each process ID <VAR>pid</VAR> | |
8948 | or job specification <VAR>jobspec</VAR> exits and return the exit status of the | |
8949 | last command waited for. | |
8950 | If a job spec is given, all processes in the job are waited for. | |
8951 | If no arguments are given, all currently active child processes are | |
8952 | waited for, and the return status is zero. | |
8953 | If neither <VAR>jobspec</VAR> nor <VAR>pid</VAR> specifies an active child process | |
8954 | of the shell, the return status is 127. | |
8955 | <P> | |
8956 | ||
8957 | <DT><CODE>disown</CODE> | |
0001803f | 8958 | <DD><A NAME="IDX298"></A> |
17345e5a JA |
8959 | <TABLE><tr><td> </td><td class=example><pre>disown [-ar] [-h] [<VAR>jobspec</VAR> <small>...</small>] |
8960 | </pre></td></tr></table>Without options, each <VAR>jobspec</VAR> is removed from the table of | |
8961 | active jobs. | |
8962 | If the <SAMP>`-h'</SAMP> option is given, the job is not removed from the table, | |
8963 | but is marked so that <CODE>SIGHUP</CODE> is not sent to the job if the shell | |
8964 | receives a <CODE>SIGHUP</CODE>. | |
8965 | If <VAR>jobspec</VAR> is not present, and neither the <SAMP>`-a'</SAMP> nor <SAMP>`-r'</SAMP> | |
8966 | option is supplied, the current job is used. | |
8967 | If no <VAR>jobspec</VAR> is supplied, the <SAMP>`-a'</SAMP> option means to remove or | |
8968 | mark all jobs; the <SAMP>`-r'</SAMP> option without a <VAR>jobspec</VAR> | |
8969 | argument restricts operation to running jobs. | |
8970 | <P> | |
8971 | ||
8972 | <DT><CODE>suspend</CODE> | |
0001803f | 8973 | <DD><A NAME="IDX299"></A> |
17345e5a JA |
8974 | <TABLE><tr><td> </td><td class=example><pre>suspend [-f] |
8975 | </pre></td></tr></table>Suspend the execution of this shell until it receives a | |
8976 | <CODE>SIGCONT</CODE> signal. | |
8977 | A login shell cannot be suspended; the <SAMP>`-f'</SAMP> | |
8978 | option can be used to override this and force the suspension. | |
8979 | <P> | |
8980 | ||
8981 | </DL> | |
8982 | <P> | |
8983 | ||
8984 | When job control is not active, the <CODE>kill</CODE> and <CODE>wait</CODE> | |
8985 | builtins do not accept <VAR>jobspec</VAR> arguments. They must be | |
8986 | supplied process IDs. | |
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"> < </A>]</TD> | |
8994 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> > </A>]</TD> | |
8995 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD> | |
8996 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> | |
8997 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD> | |
8998 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8999 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9000 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9001 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 |
9012 | This variable controls how the shell interacts with the user and |
9013 | job control. If this variable exists then single word simple | |
9014 | commands without redirections are treated as candidates for resumption | |
9015 | of an existing job. There is no ambiguity allowed; if there is | |
9016 | more than one job beginning with the string typed, then | |
9017 | the most recently accessed job will be selected. | |
9018 | The name of a stopped job, in this context, is the command line | |
9019 | used to start it. If this variable is set to the value <SAMP>`exact'</SAMP>, | |
9020 | the string supplied must match the name of a stopped job exactly; | |
9021 | if set to <SAMP>`substring'</SAMP>, | |
9022 | the string supplied needs to match a substring of the name of a | |
9023 | stopped job. The <SAMP>`substring'</SAMP> value provides functionality | |
9024 | analogous to the <SAMP>`%?'</SAMP> job ID (see section <A HREF="bashref.html#SEC92">7.1 Job Control Basics</A>). | |
9025 | If set to any other value, the supplied string must | |
9026 | be a prefix of a stopped job's name; this provides functionality | |
9027 | analogous to the <SAMP>`%'</SAMP> job ID. | |
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"> < </A>]</TD> | |
9041 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> > </A>]</TD> | |
9042 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> << </A>]</TD> | |
9043 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
9044 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
9045 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9046 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9047 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9048 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9049 | </TR></TABLE> | |
9050 | <H1> 8. Command Line Editing </H1> | |
9051 | <!--docid::SEC95::--> | |
9052 | <P> | |
9053 | ||
9054 | This chapter describes the basic features of the GNU | |
9055 | command line editing interface. | |
9056 | Command line editing is provided by the Readline library, which is | |
9057 | used by several different programs, including Bash. | |
9058 | Command line editing is enabled by default when using an interactive shell, | |
9059 | unless the <SAMP>`--noediting'</SAMP> option is supplied at shell invocation. | |
9060 | Line editing is also used when using the <SAMP>`-e'</SAMP> option to the | |
9061 | <CODE>read</CODE> builtin command (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
9062 | By default, the line editing commands are similar to those of emacs. | |
9063 | A vi-style line editing interface is also available. | |
9064 | Line editing can be enabled at any time using the <SAMP>`-o emacs'</SAMP> or | |
9065 | <SAMP>`-o vi'</SAMP> options to the <CODE>set</CODE> builtin command | |
9066 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), or disabled using the <SAMP>`+o emacs'</SAMP> or | |
9067 | <SAMP>`+o vi'</SAMP> options to <CODE>set</CODE>. | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Notation used in this text.</TD></TR> | |
9072 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC97">8.2 Readline Interaction</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The minimum set of commands for editing a line.</TD></TR> | |
9073 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC103">8.3 Readline Init File</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Customizing Readline from a user's view.</TD></TR> | |
9074 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A description of most of the Readline commands | |
9075 | available for binding</TD></TR> | |
9076 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC116">8.5 Readline vi Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A short description of how to make Readline | |
9077 | behave like the vi editor.</TD></TR> | |
9078 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC117">8.6 Programmable Completion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify the possible completions for | |
9079 | a specific command.</TD></TR> | |
9080 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands to specify how to | |
9081 | complete arguments for a particular command.</TD></TR> | |
9082 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
9090 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> > </A>]</TD> | |
9091 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD> | |
9092 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
9093 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
9094 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9095 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9096 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9097 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9098 | </TR></TABLE> | |
9099 | <H2> 8.1 Introduction to Line Editing </H2> | |
9100 | <!--docid::SEC96::--> | |
9101 | <P> | |
9102 | ||
9103 | The following paragraphs describe the notation used to represent | |
9104 | keystrokes. | |
9105 | </P><P> | |
9106 | ||
9107 | The text <KBD>C-k</KBD> is read as `Control-K' and describes the character | |
9108 | produced when the <KBD>k</KBD> key is pressed while the Control key | |
9109 | is depressed. | |
9110 | </P><P> | |
9111 | ||
9112 | The text <KBD>M-k</KBD> is read as `Meta-K' and describes the character | |
9113 | produced when the Meta key (if you have one) is depressed, and the <KBD>k</KBD> | |
9114 | key is pressed. | |
9115 | The Meta key is labeled <KBD>ALT</KBD> on many keyboards. | |
9116 | On keyboards with two keys labeled <KBD>ALT</KBD> (usually to either side of | |
9117 | the space bar), the <KBD>ALT</KBD> on the left side is generally set to | |
9118 | work as a Meta key. | |
9119 | The <KBD>ALT</KBD> key on the right may also be configured to work as a | |
9120 | Meta key or may be configured as some other modifier, such as a | |
9121 | Compose key for typing accented characters. | |
9122 | </P><P> | |
9123 | ||
9124 | If you do not have a Meta or <KBD>ALT</KBD> key, or another key working as | |
9125 | a Meta key, the identical keystroke can be generated by typing <KBD>ESC</KBD> | |
9126 | <EM>first</EM>, and then typing <KBD>k</KBD>. | |
9127 | Either process is known as <EM>metafying</EM> the <KBD>k</KBD> key. | |
9128 | </P><P> | |
9129 | ||
9130 | The text <KBD>M-C-k</KBD> is read as `Meta-Control-k' and describes the | |
9131 | character produced by <EM>metafying</EM> <KBD>C-k</KBD>. | |
9132 | </P><P> | |
9133 | ||
9134 | In addition, several keys have their own names. Specifically, | |
9135 | <KBD>DEL</KBD>, <KBD>ESC</KBD>, <KBD>LFD</KBD>, <KBD>SPC</KBD>, <KBD>RET</KBD>, and <KBD>TAB</KBD> all | |
9136 | stand for themselves when seen in this text, or in an init file | |
9137 | (see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>). | |
9138 | If your keyboard lacks a <KBD>LFD</KBD> key, typing <KBD>C-j</KBD> will | |
9139 | produce the desired character. | |
9140 | The <KBD>RET</KBD> key may be labeled <KBD>Return</KBD> or <KBD>Enter</KBD> on | |
9141 | some 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"> < </A>]</TD> | |
9149 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> > </A>]</TD> | |
9150 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD> | |
9151 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
9152 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9153 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9154 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9155 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9156 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9157 | </TR></TABLE> | |
9158 | <H2> 8.2 Readline Interaction </H2> | |
9159 | <!--docid::SEC97::--> | |
9160 | <P> | |
9161 | ||
9162 | Often during an interactive session you type in a long line of text, | |
9163 | only to notice that the first word on the line is misspelled. The | |
9164 | Readline library gives you a set of commands for manipulating the text | |
9165 | as you type it in, allowing you to just fix your typo, and not forcing | |
9166 | you to retype the majority of the line. Using these editing commands, | |
9167 | you move the cursor to the place that needs correction, and delete or | |
9168 | insert the text of the corrections. Then, when you are satisfied with | |
9169 | the line, you simply press <KBD>RET</KBD>. You do not have to be at the | |
9170 | end of the line to press <KBD>RET</KBD>; the entire line is accepted | |
9171 | regardless of the location of the cursor within the line. | |
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> </TD><TD ALIGN="left" VALIGN="TOP">The least you need to know about Readline.</TD></TR> | |
9176 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC99">8.2.2 Readline Movement Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the input line.</TD></TR> | |
9177 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to delete text, and how to get it back!</TD></TR> | |
9178 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC101">8.2.4 Readline Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Giving numeric arguments to commands.</TD></TR> | |
9179 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Searching through previous lines.</TD></TR> | |
9180 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
9188 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> > </A>]</TD> | |
9189 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD> | |
9190 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9191 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9192 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9193 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9194 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9195 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9196 | </TR></TABLE> | |
9197 | <H3> 8.2.1 Readline Bare Essentials </H3> | |
9198 | <!--docid::SEC98::--> | |
9199 | <P> | |
9200 | ||
9201 | In order to enter characters into the line, simply type them. The typed | |
9202 | character appears where the cursor was, and then the cursor moves one | |
9203 | space to the right. If you mistype a character, you can use your | |
9204 | erase character to back up and delete the mistyped character. | |
9205 | </P><P> | |
9206 | ||
9207 | Sometimes you may mistype a character, and | |
9208 | not notice the error until you have typed several other characters. In | |
9209 | that case, you can type <KBD>C-b</KBD> to move the cursor to the left, and then | |
9210 | correct your mistake. Afterwards, you can move the cursor to the right | |
9211 | with <KBD>C-f</KBD>. | |
9212 | </P><P> | |
9213 | ||
9214 | When you add text in the middle of a line, you will notice that characters | |
9215 | to the right of the cursor are `pushed over' to make room for the text | |
9216 | that you have inserted. Likewise, when you delete text behind the cursor, | |
9217 | characters to the right of the cursor are `pulled back' to fill in the | |
9218 | blank space created by the removal of the text. A list of the bare | |
9219 | essentials for editing the text of an input line follows. | |
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 | |
9235 | empty line. | |
9236 | </DL> | |
9237 | <P> | |
9238 | ||
9239 | (Depending on your configuration, the <KBD>Backspace</KBD> key be set to | |
9240 | delete the character to the left of the cursor and the <KBD>DEL</KBD> key set | |
9241 | to delete the character underneath the cursor, like <KBD>C-d</KBD>, rather | |
9242 | than the character to the left of the cursor.) | |
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"> < </A>]</TD> | |
9250 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> > </A>]</TD> | |
9251 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> << </A>]</TD> | |
9252 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9253 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9254 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9255 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9256 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9257 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9258 | </TR></TABLE> | |
9259 | <H3> 8.2.2 Readline Movement Commands </H3> | |
9260 | <!--docid::SEC99::--> | |
9261 | <P> | |
9262 | ||
9263 | The above table describes the most basic keystrokes that you need | |
9264 | in order to do editing of the input line. For your convenience, many | |
9265 | other commands have been added in addition to <KBD>C-b</KBD>, <KBD>C-f</KBD>, | |
9266 | <KBD>C-d</KBD>, and <KBD>DEL</KBD>. Here are some commands for moving more rapidly | |
9267 | about 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 | ||
9284 | Notice how <KBD>C-f</KBD> moves forward a character, while <KBD>M-f</KBD> moves | |
9285 | forward a word. It is a loose convention that control keystrokes | |
9286 | operate on characters while meta keystrokes operate on words. | |
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"> < </A>]</TD> | |
9294 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> > </A>]</TD> | |
9295 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> << </A>]</TD> | |
9296 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9297 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9298 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9299 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9300 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9301 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 | |
9312 | it away for later use, usually by <EM>yanking</EM> (re-inserting) | |
9313 | it back into the line. | |
9314 | (`Cut' and `paste' are more recent jargon for `kill' and `yank'.) | |
9315 | </P><P> | |
9316 | ||
9317 | If the description for a command says that it `kills' text, then you can | |
9318 | be sure that you can get the text back in a different (or the same) | |
9319 | place later. | |
9320 | </P><P> | |
9321 | ||
9322 | When you use a kill command, the text is saved in a <EM>kill-ring</EM>. | |
9323 | Any number of consecutive kills save all of the killed text together, so | |
9324 | that when you yank it back, you get it all. The kill | |
9325 | ring is not line specific; the text that you killed on a previously | |
9326 | typed line is available to be yanked back later, when you are typing | |
9327 | another line. | |
0001803f | 9328 | <A NAME="IDX305"></A> |
17345e5a JA |
9329 | </P><P> |
9330 | ||
9331 | Here 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 | |
9341 | words, to the end of the next word. | |
9342 | Word 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 | |
9347 | words, to the start of the previous word. | |
9348 | Word 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 | ||
9359 | Here is how to <EM>yank</EM> the text back into the line. Yanking | |
9360 | means to copy the most-recently-killed text from the kill buffer. | |
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 | |
9370 | the 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"> < </A>]</TD> | |
9379 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> > </A>]</TD> | |
9380 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> << </A>]</TD> | |
9381 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9382 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9383 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9384 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9385 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9386 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9387 | </TR></TABLE> | |
9388 | <H3> 8.2.4 Readline Arguments </H3> | |
9389 | <!--docid::SEC101::--> | |
9390 | <P> | |
9391 | ||
9392 | You can pass numeric arguments to Readline commands. Sometimes the | |
9393 | argument acts as a repeat count, other times it is the <I>sign</I> of the | |
9394 | argument that is significant. If you pass a negative argument to a | |
9395 | command which normally acts in a forward direction, that command will | |
9396 | act in a backward direction. For example, to kill text back to the | |
9397 | start of the line, you might type <SAMP>`M-- C-k'</SAMP>. | |
9398 | </P><P> | |
9399 | ||
9400 | The general way to pass numeric arguments to a command is to type meta | |
9401 | digits before the command. If the first `digit' typed is a minus | |
9402 | sign (<SAMP>`-'</SAMP>), then the sign of the argument will be negative. Once | |
9403 | you have typed one meta digit to get the argument started, you can type | |
9404 | the remainder of the digits, and then the command. For example, to give | |
9405 | the <KBD>C-d</KBD> command an argument of 10, you could type <SAMP>`M-1 0 C-d'</SAMP>, | |
9406 | which will delete the next ten characters on the input line. | |
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"> < </A>]</TD> | |
9414 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> > </A>]</TD> | |
9415 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD> | |
9416 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9417 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9418 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9419 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9420 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9421 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9422 | </TR></TABLE> | |
9423 | <H3> 8.2.5 Searching for Commands in the History </H3> | |
9424 | <!--docid::SEC102::--> | |
9425 | <P> | |
9426 | ||
9427 | Readline provides commands for searching through the command history | |
9428 | (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>) | |
9429 | for lines containing a specified string. | |
9430 | There are two search modes: <EM>incremental</EM> and <EM>non-incremental</EM>. | |
9431 | </P><P> | |
9432 | ||
9433 | Incremental searches begin before the user has finished typing the | |
9434 | search string. | |
9435 | As each character of the search string is typed, Readline displays | |
9436 | the next entry from the history matching the string typed so far. | |
9437 | An incremental search requires only as many characters as needed to | |
9438 | find the desired history entry. | |
9439 | To search backward in the history for a particular string, type | |
9440 | <KBD>C-r</KBD>. Typing <KBD>C-s</KBD> searches forward through the history. | |
9441 | The characters present in the value of the <CODE>isearch-terminators</CODE> variable | |
9442 | are used to terminate an incremental search. | |
9443 | If that variable has not been assigned a value, the <KBD>ESC</KBD> and | |
9444 | <KBD>C-J</KBD> characters will terminate an incremental search. | |
9445 | <KBD>C-g</KBD> will abort an incremental search and restore the original line. | |
9446 | When the search is terminated, the history entry containing the | |
9447 | search string becomes the current line. | |
9448 | </P><P> | |
9449 | ||
9450 | To find other matching entries in the history list, type <KBD>C-r</KBD> or | |
9451 | <KBD>C-s</KBD> as appropriate. | |
9452 | This will search backward or forward in the history for the next | |
9453 | entry matching the search string typed so far. | |
9454 | Any other key sequence bound to a Readline command will terminate | |
9455 | the search and execute that command. | |
9456 | For instance, a <KBD>RET</KBD> will terminate the search and accept | |
9457 | the line, thereby executing the command from the history list. | |
9458 | A movement command will terminate the search, make the last line found | |
9459 | the current line, and begin editing. | |
9460 | </P><P> | |
9461 | ||
9462 | Readline remembers the last incremental search string. If two | |
9463 | <KBD>C-r</KBD>s are typed without any intervening characters defining a new | |
9464 | search string, any remembered search string is used. | |
9465 | </P><P> | |
9466 | ||
9467 | Non-incremental searches read the entire search string before starting | |
9468 | to search for matching history lines. The search string may be | |
9469 | typed by the user or be part of the contents of the current line. | |
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"> < </A>]</TD> | |
9477 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> > </A>]</TD> | |
9478 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD> | |
9479 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
9480 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD> | |
9481 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9482 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9483 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9484 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9485 | </TR></TABLE> | |
9486 | <H2> 8.3 Readline Init File </H2> | |
9487 | <!--docid::SEC103::--> | |
9488 | <P> | |
9489 | ||
9490 | Although the Readline library comes with a set of Emacs-like | |
9491 | keybindings installed by default, it is possible to use a different set | |
9492 | of keybindings. | |
9493 | Any user can customize programs that use Readline by putting | |
9494 | commands in an <EM>inputrc</EM> file, conventionally in his home directory. | |
9495 | The name of this | |
9496 | file is taken from the value of the shell variable <CODE>INPUTRC</CODE>. If | |
9497 | that variable is unset, the default is <TT>`~/.inputrc'</TT>. If that | |
9498 | file does not exist or cannot be read, the ultimate default is | |
9499 | <TT>`/etc/inputrc'</TT>. | |
9500 | </P><P> | |
9501 | ||
9502 | When a program which uses the Readline library starts up, the | |
9503 | init file is read, and the key bindings are set. | |
9504 | </P><P> | |
9505 | ||
9506 | In addition, the <CODE>C-x C-r</CODE> command re-reads this init file, thus | |
9507 | incorporating any changes that you might have made to it. | |
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> </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> </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> </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"> < </A>]</TD> | |
9530 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> > </A>]</TD> | |
9531 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD> | |
9532 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> | |
9533 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD> | |
9534 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9535 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9536 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9537 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9538 | </TR></TABLE> | |
9539 | <H3> 8.3.1 Readline Init File Syntax </H3> | |
9540 | <!--docid::SEC104::--> | |
9541 | <P> | |
9542 | ||
9543 | There are only a few basic constructs allowed in the | |
9544 | Readline init file. Blank lines are ignored. | |
9545 | Lines beginning with a <SAMP>`#'</SAMP> are comments. | |
9546 | Lines beginning with a <SAMP>`$'</SAMP> indicate conditional | |
9547 | constructs (see section <A HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A>). Other lines | |
9548 | denote variable settings and key bindings. | |
9549 | </P><P> | |
9550 | ||
9551 | <DL COMPACT> | |
9552 | <DT>Variable Settings | |
9553 | <DD>You can modify the run-time behavior of Readline by | |
9554 | altering the values of variables in Readline | |
9555 | using the <CODE>set</CODE> command within the init file. | |
9556 | The syntax is simple: | |
9557 | <P> | |
9558 | ||
9559 | <TABLE><tr><td> </td><td class=example><pre>set <VAR>variable</VAR> <VAR>value</VAR> | |
9560 | </pre></td></tr></table></P><P> | |
9561 | ||
9562 | Here, for example, is how to | |
9563 | change from the default Emacs-like key binding to use | |
9564 | <CODE>vi</CODE> line editing commands: | |
9565 | </P><P> | |
9566 | ||
9567 | <TABLE><tr><td> </td><td class=example><pre>set editing-mode vi | |
9568 | </pre></td></tr></table></P><P> | |
9569 | ||
9570 | Variable names and values, where appropriate, are recognized without regard | |
9571 | to case. Unrecognized variable names are ignored. | |
9572 | </P><P> | |
9573 | ||
9574 | Boolean variables (those that can be set to on or off) are set to on if | |
9575 | the value is null or empty, <VAR>on</VAR> (case-insensitive), or 1. Any other | |
9576 | value results in the variable being set to off. | |
9577 | </P><P> | |
9578 | ||
9579 | The <CODE>bind -V</CODE> command lists the current Readline variable names | |
9580 | and values. See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>. | |
9581 | </P><P> | |
9582 | ||
9583 | A great deal of run-time behavior is changeable with the following | |
9584 | variables. | |
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 |
9592 | Controls what happens when Readline wants to ring the terminal bell. |
9593 | If set to <SAMP>`none'</SAMP>, Readline never rings the bell. If set to | |
9594 | <SAMP>`visible'</SAMP>, Readline uses a visible bell if one is available. | |
9595 | If set to <SAMP>`audible'</SAMP> (the default), Readline attempts to ring | |
9596 | the terminal's bell. | |
9597 | <P> | |
9598 | ||
9599 | <DT><CODE>bind-tty-special-chars</CODE> | |
0001803f | 9600 | <DD><A NAME="IDX308"></A> |
17345e5a JA |
9601 | If set to <SAMP>`on'</SAMP>, Readline attempts to bind the control characters |
9602 | treated specially by the kernel's terminal driver to their Readline | |
9603 | equivalents. | |
9604 | <P> | |
9605 | ||
9606 | <DT><CODE>comment-begin</CODE> | |
0001803f | 9607 | <DD><A NAME="IDX309"></A> |
17345e5a JA |
9608 | The string to insert at the beginning of the line when the |
9609 | <CODE>insert-comment</CODE> command is executed. The default value | |
9610 | is <CODE>"#"</CODE>. | |
9611 | <P> | |
9612 | ||
9613 | <DT><CODE>completion-ignore-case</CODE> | |
9614 | <DD>If set to <SAMP>`on'</SAMP>, Readline performs filename matching and completion | |
9615 | in a case-insensitive fashion. | |
9616 | The default value is <SAMP>`off'</SAMP>. | |
9617 | <P> | |
9618 | ||
9619 | <DT><CODE>completion-prefix-display-length</CODE> | |
0001803f | 9620 | <DD><A NAME="IDX310"></A> |
17345e5a JA |
9621 | The length in characters of the common prefix of a list of possible |
9622 | completions that is displayed without modification. When set to a | |
9623 | value greater than zero, common prefixes longer than this value are | |
9624 | replaced with an ellipsis when displaying possible completions. | |
9625 | <P> | |
9626 | ||
9627 | <DT><CODE>completion-query-items</CODE> | |
0001803f | 9628 | <DD><A NAME="IDX311"></A> |
17345e5a JA |
9629 | The number of possible completions that determines when the user is |
9630 | asked whether the list of possibilities should be displayed. | |
9631 | If the number of possible completions is greater than this value, | |
9632 | Readline will ask the user whether or not he wishes to view | |
9633 | them; otherwise, they are simply listed. | |
9634 | This variable must be set to an integer value greater than or equal to 0. | |
9635 | A negative value means Readline should never ask. | |
9636 | The default limit is <CODE>100</CODE>. | |
9637 | <P> | |
9638 | ||
9639 | <DT><CODE>convert-meta</CODE> | |
0001803f | 9640 | <DD><A NAME="IDX312"></A> |
17345e5a JA |
9641 | If set to <SAMP>`on'</SAMP>, Readline will convert characters with the |
9642 | eighth bit set to an ASCII key sequence by stripping the eighth | |
9643 | bit and prefixing an <KBD>ESC</KBD> character, converting them to a | |
9644 | meta-prefixed key sequence. The default value is <SAMP>`on'</SAMP>. | |
9645 | <P> | |
9646 | ||
9647 | <DT><CODE>disable-completion</CODE> | |
0001803f | 9648 | <DD><A NAME="IDX313"></A> |
17345e5a JA |
9649 | If set to <SAMP>`On'</SAMP>, Readline will inhibit word completion. |
9650 | Completion characters will be inserted into the line as if they had | |
9651 | been mapped to <CODE>self-insert</CODE>. The default is <SAMP>`off'</SAMP>. | |
9652 | <P> | |
9653 | ||
9654 | <DT><CODE>editing-mode</CODE> | |
0001803f | 9655 | <DD><A NAME="IDX314"></A> |
17345e5a JA |
9656 | The <CODE>editing-mode</CODE> variable controls which default set of |
9657 | key bindings is used. By default, Readline starts up in Emacs editing | |
9658 | mode, where the keystrokes are most similar to Emacs. This variable can be | |
9659 | set to either <SAMP>`emacs'</SAMP> or <SAMP>`vi'</SAMP>. | |
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, | |
9664 | readline echoes a character corresponding to a signal generated from the | |
9665 | keyboard. 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 |
9670 | When set to <SAMP>`on'</SAMP>, Readline will try to enable the application |
9671 | keypad when it is called. Some systems need this to enable the | |
9672 | arrow keys. The default is <SAMP>`off'</SAMP>. | |
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 | |
9677 | key the terminal claims to support when it is called. On many terminals, | |
9678 | the meta key is used to send eight-bit characters. | |
9679 | The default is <SAMP>`on'</SAMP>. | |
9680 | <P> | |
9681 | ||
17345e5a | 9682 | <DT><CODE>expand-tilde</CODE> |
0001803f | 9683 | <DD><A NAME="IDX316"></A> |
17345e5a JA |
9684 | If set to <SAMP>`on'</SAMP>, tilde expansion is performed when Readline |
9685 | attempts 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 |
9690 | If set to <SAMP>`on'</SAMP>, the history code attempts to place the point (the |
9691 | current cursor position) at the | |
9692 | same location on each history line retrieved with <CODE>previous-history</CODE> | |
9693 | or <CODE>next-history</CODE>. The default is <SAMP>`off'</SAMP>. | |
9694 | <P> | |
9695 | ||
9696 | <DT><CODE>history-size</CODE> | |
0001803f | 9697 | <DD><A NAME="IDX318"></A> |
17345e5a JA |
9698 | Set the maximum number of history entries saved in the history list. If |
9699 | set to zero, the number of entries in the history list is not limited. | |
9700 | <P> | |
9701 | ||
9702 | <DT><CODE>horizontal-scroll-mode</CODE> | |
0001803f | 9703 | <DD><A NAME="IDX319"></A> |
17345e5a JA |
9704 | This variable can be set to either <SAMP>`on'</SAMP> or <SAMP>`off'</SAMP>. Setting it |
9705 | to <SAMP>`on'</SAMP> means that the text of the lines being edited will scroll | |
9706 | horizontally on a single screen line when they are longer than the width | |
9707 | of the screen, instead of wrapping onto a new screen line. By default, | |
9708 | this variable is set to <SAMP>`off'</SAMP>. | |
9709 | <P> | |
9710 | ||
9711 | <DT><CODE>input-meta</CODE> | |
0001803f CR |
9712 | <DD><A NAME="IDX320"></A> |
9713 | <A NAME="IDX321"></A> | |
17345e5a JA |
9714 | If set to <SAMP>`on'</SAMP>, Readline will enable eight-bit input (it |
9715 | will not clear the eighth bit in the characters it reads), | |
9716 | regardless of what the terminal claims it can support. The | |
9717 | default value is <SAMP>`off'</SAMP>. The name <CODE>meta-flag</CODE> is a | |
9718 | synonym for this variable. | |
9719 | <P> | |
9720 | ||
9721 | <DT><CODE>isearch-terminators</CODE> | |
0001803f | 9722 | <DD><A NAME="IDX322"></A> |
17345e5a JA |
9723 | The string of characters that should terminate an incremental search without |
9724 | subsequently executing the character as a command (see section <A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A>). | |
9725 | If this variable has not been given a value, the characters <KBD>ESC</KBD> and | |
9726 | <KBD>C-J</KBD> will terminate an incremental search. | |
9727 | <P> | |
9728 | ||
9729 | <DT><CODE>keymap</CODE> | |
0001803f | 9730 | <DD><A NAME="IDX323"></A> |
17345e5a JA |
9731 | Sets Readline's idea of the current keymap for key binding commands. |
9732 | Acceptable <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 | |
9742 | equivalent to <CODE>emacs-standard</CODE>. The default value is <CODE>emacs</CODE>. | |
9743 | The value of the <CODE>editing-mode</CODE> variable also affects the | |
9744 | default keymap. | |
9745 | <P> | |
9746 | ||
9747 | <DT><CODE>mark-directories</CODE> | |
9748 | <DD>If set to <SAMP>`on'</SAMP>, completed directory names have a slash | |
9749 | appended. The default is <SAMP>`on'</SAMP>. | |
9750 | <P> | |
9751 | ||
9752 | <DT><CODE>mark-modified-lines</CODE> | |
0001803f | 9753 | <DD><A NAME="IDX324"></A> |
17345e5a JA |
9754 | This variable, when set to <SAMP>`on'</SAMP>, causes Readline to display an |
9755 | asterisk (<SAMP>`*'</SAMP>) at the start of history lines which have been modified. | |
9756 | This variable is <SAMP>`off'</SAMP> by default. | |
9757 | <P> | |
9758 | ||
9759 | <DT><CODE>mark-symlinked-directories</CODE> | |
0001803f | 9760 | <DD><A NAME="IDX325"></A> |
17345e5a JA |
9761 | If set to <SAMP>`on'</SAMP>, completed names which are symbolic links |
9762 | to directories have a slash appended (subject to the value of | |
9763 | <CODE>mark-directories</CODE>). | |
9764 | The default is <SAMP>`off'</SAMP>. | |
9765 | <P> | |
9766 | ||
9767 | <DT><CODE>match-hidden-files</CODE> | |
0001803f | 9768 | <DD><A NAME="IDX326"></A> |
17345e5a JA |
9769 | This variable, when set to <SAMP>`on'</SAMP>, causes Readline to match files whose |
9770 | names begin with a <SAMP>`.'</SAMP> (hidden files) when performing filename | |
9771 | completion, unless the leading <SAMP>`.'</SAMP> is | |
9772 | supplied by the user in the filename to be completed. | |
9773 | This variable is <SAMP>`on'</SAMP> by default. | |
9774 | <P> | |
9775 | ||
9776 | <DT><CODE>output-meta</CODE> | |
0001803f | 9777 | <DD><A NAME="IDX327"></A> |
17345e5a JA |
9778 | If set to <SAMP>`on'</SAMP>, Readline will display characters with the |
9779 | eighth bit set directly rather than as a meta-prefixed escape | |
9780 | sequence. The default is <SAMP>`off'</SAMP>. | |
9781 | <P> | |
9782 | ||
9783 | <DT><CODE>page-completions</CODE> | |
0001803f | 9784 | <DD><A NAME="IDX328"></A> |
17345e5a JA |
9785 | If set to <SAMP>`on'</SAMP>, Readline uses an internal <CODE>more</CODE>-like pager |
9786 | to display a screenful of possible completions at a time. | |
9787 | This variable is <SAMP>`on'</SAMP> by default. | |
9788 | <P> | |
9789 | ||
9790 | <DT><CODE>print-completions-horizontally</CODE> | |
9791 | <DD>If set to <SAMP>`on'</SAMP>, Readline will display completions with matches | |
9792 | sorted horizontally in alphabetical order, rather than down the screen. | |
9793 | The default is <SAMP>`off'</SAMP>. | |
9794 | <P> | |
9795 | ||
9796 | <DT><CODE>revert-all-at-newline</CODE> | |
0001803f | 9797 | <DD><A NAME="IDX329"></A> |
17345e5a JA |
9798 | If set to <SAMP>`on'</SAMP>, Readline will undo all changes to history lines |
9799 | before returning when <CODE>accept-line</CODE> is executed. By default, | |
9800 | history lines may be modified and retain individual undo lists across | |
9801 | calls to <CODE>readline</CODE>. The default is <SAMP>`off'</SAMP>. | |
9802 | <P> | |
9803 | ||
9804 | <DT><CODE>show-all-if-ambiguous</CODE> | |
0001803f | 9805 | <DD><A NAME="IDX330"></A> |
17345e5a JA |
9806 | This alters the default behavior of the completion functions. If |
9807 | set to <SAMP>`on'</SAMP>, | |
9808 | words which have more than one possible completion cause the | |
9809 | matches to be listed immediately instead of ringing the bell. | |
9810 | The default value is <SAMP>`off'</SAMP>. | |
9811 | <P> | |
9812 | ||
9813 | <DT><CODE>show-all-if-unmodified</CODE> | |
0001803f | 9814 | <DD><A NAME="IDX331"></A> |
17345e5a JA |
9815 | This alters the default behavior of the completion functions in |
9816 | a fashion similar to <VAR>show-all-if-ambiguous</VAR>. | |
9817 | If set to <SAMP>`on'</SAMP>, | |
9818 | words which have more than one possible completion without any | |
9819 | possible partial completion (the possible completions don't share | |
9820 | a common prefix) cause the matches to be listed immediately instead | |
9821 | of ringing the bell. | |
9822 | The default value is <SAMP>`off'</SAMP>. | |
9823 | <P> | |
9824 | ||
0001803f CR |
9825 | <DT><CODE>skip-completed-text</CODE> |
9826 | <DD><A NAME="IDX332"></A> | |
9827 | If set to <SAMP>`on'</SAMP>, this alters the default completion behavior when | |
9828 | inserting a single match into the line. It's only active when | |
9829 | performing completion in the middle of a word. If enabled, readline | |
9830 | does not insert characters from the completion that match characters | |
9831 | after point in the word being completed, so portions of the word | |
9832 | following the cursor are not duplicated. | |
9833 | For instance, if this is enabled, attempting completion when the cursor | |
9834 | is after the <SAMP>`e'</SAMP> in <SAMP>`Makefile'</SAMP> will result in <SAMP>`Makefile'</SAMP> | |
9835 | rather than <SAMP>`Makefilefile'</SAMP>, assuming there is a single possible | |
9836 | completion. | |
9837 | The 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 |
9842 | If set to <SAMP>`on'</SAMP>, a character denoting a file's type |
9843 | is appended to the filename when listing possible | |
9844 | completions. The default is <SAMP>`off'</SAMP>. | |
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 | |
9852 | simple. First you need to find the name of the command that you | |
9853 | want to change. The following sections contain tables of the command | |
9854 | name, the default keybinding, if any, and a short description of what | |
9855 | the command does. | |
9856 | <P> | |
9857 | ||
9858 | Once you know the name of the command, simply place on a line | |
9859 | in the init file the name of the key | |
9860 | you wish to bind the command to, a colon, and then the name of the | |
9861 | command. | |
9862 | There can be no space between the key name and the colon -- that will be | |
9863 | interpreted as part of the key name. | |
9864 | The name of the key can be expressed in different ways, depending on | |
9865 | what you find most comfortable. | |
9866 | </P><P> | |
9867 | ||
9868 | In addition to command names, readline allows keys to be bound | |
9869 | to a string that is inserted when the key is pressed (a <VAR>macro</VAR>). | |
9870 | </P><P> | |
9871 | ||
9872 | The <CODE>bind -p</CODE> command displays Readline function names and | |
9873 | bindings in a format that can put directly into an initialization file. | |
9874 | See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>. | |
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> </td><td class=example><pre>Control-u: universal-argument | |
9881 | Meta-Rubout: backward-kill-word | |
9882 | Control-o: "> output" | |
9883 | </pre></td></tr></table><P> | |
9884 | ||
9885 | In the above example, <KBD>C-u</KBD> is bound to the function | |
9886 | <CODE>universal-argument</CODE>, | |
9887 | <KBD>M-DEL</KBD> is bound to the function <CODE>backward-kill-word</CODE>, and | |
9888 | <KBD>C-o</KBD> is bound to run the macro | |
9889 | expressed on the right hand side (that is, to insert the text | |
9890 | <SAMP>`> output'</SAMP> into the line). | |
9891 | </P><P> | |
9892 | ||
9893 | A number of symbolic character names are recognized while | |
9894 | processing 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>, | |
9905 | and | |
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 | |
9911 | denoting an entire key sequence can be specified, by placing | |
9912 | the key sequence in double quotes. Some GNU Emacs style key | |
9913 | escapes can be used, as in the following example, but the | |
9914 | special character names are not recognized. | |
9915 | <P> | |
9916 | ||
9917 | <TABLE><tr><td> </td><td class=example><pre>"\C-u": universal-argument | |
9918 | "\C-x\C-r": re-read-init-file | |
9919 | "\e[11~": "Function Key 1" | |
9920 | </pre></td></tr></table></P><P> | |
9921 | ||
9922 | In the above example, <KBD>C-u</KBD> is again bound to the function | |
9923 | <CODE>universal-argument</CODE> (just as it was in the first example), | |
9924 | <SAMP>`<KBD>C-x</KBD> <KBD>C-r</KBD>'</SAMP> is bound to the function <CODE>re-read-init-file</CODE>, | |
9925 | and <SAMP>`<KBD>ESC</KBD> <KBD>[</KBD> <KBD>1</KBD> <KBD>1</KBD> <KBD>~</KBD>'</SAMP> is bound to insert | |
9926 | the text <SAMP>`Function Key 1'</SAMP>. | |
9927 | </P><P> | |
9928 | ||
9929 | </DL> | |
9930 | <P> | |
9931 | ||
9932 | The following GNU Emacs style escape sequences are available when | |
9933 | specifying 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 | ||
9952 | In addition to the GNU Emacs style escape sequences, a second | |
9953 | set 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 | ||
9982 | When entering the text of a macro, single or double quotes must | |
9983 | be used to indicate a macro definition. | |
9984 | Unquoted text is assumed to be a function name. | |
9985 | In the macro body, the backslash escapes described above are expanded. | |
9986 | Backslash will quote any other character in the macro text, | |
9987 | including <SAMP>`"'</SAMP> and <SAMP>`''</SAMP>. | |
9988 | For example, the following binding will make <SAMP>`<KBD>C-x</KBD> \'</SAMP> | |
9989 | insert a single <SAMP>`\'</SAMP> into the line: | |
9990 | <TABLE><tr><td> </td><td class=example><pre>"\C-x\\": "\\" | |
9991 | </pre></td></tr></table></P><P> | |
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"> < </A>]</TD> | |
10001 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> > </A>]</TD> | |
10002 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> << </A>]</TD> | |
10003 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> | |
10004 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD> | |
10005 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10006 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10007 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10008 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10009 | </TR></TABLE> | |
10010 | <H3> 8.3.2 Conditional Init Constructs </H3> | |
10011 | <!--docid::SEC105::--> | |
10012 | <P> | |
10013 | ||
10014 | Readline implements a facility similar in spirit to the conditional | |
10015 | compilation features of the C preprocessor which allows key | |
10016 | bindings and variable settings to be performed as the result | |
10017 | of tests. There are four parser directives used. | |
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 | |
10023 | editing mode, the terminal being used, or the application using | |
10024 | Readline. The text of the test extends to the end of the line; | |
10025 | no characters are required to isolate it. | |
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 | |
10031 | whether Readline is in <CODE>emacs</CODE> or <CODE>vi</CODE> mode. | |
10032 | This may be used in conjunction | |
10033 | with the <SAMP>`set keymap'</SAMP> command, for instance, to set bindings in | |
10034 | the <CODE>emacs-standard</CODE> and <CODE>emacs-ctlx</CODE> keymaps only if | |
10035 | Readline is starting out in <CODE>emacs</CODE> mode. | |
10036 | <P> | |
10037 | ||
10038 | <DT><CODE>term</CODE> | |
10039 | <DD>The <CODE>term=</CODE> form may be used to include terminal-specific | |
10040 | key bindings, perhaps to bind the key sequences output by the | |
10041 | terminal's function keys. The word on the right side of the | |
10042 | <SAMP>`='</SAMP> is tested against both the full name of the terminal and | |
10043 | the portion of the terminal name before the first <SAMP>`-'</SAMP>. This | |
10044 | allows <CODE>sun</CODE> to match both <CODE>sun</CODE> and <CODE>sun-cmd</CODE>, | |
10045 | for instance. | |
10046 | <P> | |
10047 | ||
10048 | <DT><CODE>application</CODE> | |
10049 | <DD>The <VAR>application</VAR> construct is used to include | |
10050 | application-specific settings. Each program using the Readline | |
10051 | library sets the <VAR>application name</VAR>, and you can test for | |
10052 | a particular value. | |
10053 | This could be used to bind key sequences to functions useful for | |
10054 | a specific program. For instance, the following command adds a | |
10055 | key sequence that quotes the current or previous word in Bash: | |
10056 | <TABLE><tr><td> </td><td class=example><pre>$if Bash | |
10057 | # Quote the current or previous word | |
10058 | "\C-xq": "\eb\"\ef\"" | |
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 | |
10070 | the test fails. | |
10071 | <P> | |
10072 | ||
10073 | <DT><CODE>$include</CODE> | |
10074 | <DD>This directive takes a single filename as an argument and reads commands | |
10075 | and bindings from that file. | |
10076 | For example, the following directive reads from <TT>`/etc/inputrc'</TT>: | |
10077 | <TABLE><tr><td> </td><td class=example><pre>$include /etc/inputrc | |
10078 | </pre></td></tr></table></DL> | |
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"> < </A>]</TD> | |
10086 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> > </A>]</TD> | |
10087 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD> | |
10088 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> | |
10089 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD> | |
10090 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10091 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10092 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10093 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10094 | </TR></TABLE> | |
10095 | <H3> 8.3.3 Sample Init File </H3> | |
10096 | <!--docid::SEC106::--> | |
10097 | <P> | |
10098 | ||
10099 | Here is an example of an <VAR>inputrc</VAR> file. This illustrates key | |
10100 | binding, variable assignment, and conditional syntax. | |
10101 | </P><P> | |
10102 | ||
10103 | <TABLE><tr><td> </td><td class=example><pre># This file controls the behaviour of line input editing for | |
10104 | # programs that use the GNU Readline library. Existing | |
10105 | # programs include FTP, Bash, and GDB. | |
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 | ||
10117 | set editing-mode emacs | |
10118 | ||
10119 | $if mode=emacs | |
10120 | ||
10121 | Meta-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 | ||
10152 | C-q: quoted-insert | |
10153 | ||
10154 | $endif | |
10155 | ||
10156 | # An old-style binding. This happens to be the default. | |
10157 | TAB: 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 | |
10179 | set bell-style visible | |
10180 | ||
10181 | # don't strip characters to 7 bits when reading | |
10182 | set input-meta on | |
10183 | ||
10184 | # allow iso-latin1 characters to be inserted rather | |
10185 | # than converted to prefix-meta sequences | |
10186 | set convert-meta off | |
10187 | ||
10188 | # display characters with the eighth bit set directly | |
10189 | # rather than as meta-prefixed characters | |
10190 | set 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 | |
10194 | set 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"> < </A>]</TD> | |
10209 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> > </A>]</TD> | |
10210 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD> | |
10211 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
10212 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10213 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10214 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10215 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10216 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the line.</TD></TR> | |
10224 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Getting at previous lines.</TD></TR> | |
10225 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for changing text.</TD></TR> | |
10226 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for killing and yanking.</TD></TR> | |
10227 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying numeric arguments, repeat counts.</TD></TR> | |
10228 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Getting Readline to do the typing for you.</TD></TR> | |
10229 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Saving and re-executing typed characters</TD></TR> | |
10230 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Other miscellaneous commands.</TD></TR> | |
10231 | </TABLE></BLOCKQUOTE> | |
10232 | <P> | |
10233 | ||
10234 | This section describes Readline commands that may be bound to key | |
10235 | sequences. | |
10236 | You can list your key bindings by executing | |
10237 | <CODE>bind -P</CODE> or, for a more terse format, suitable for an | |
10238 | <VAR>inputrc</VAR> file, <CODE>bind -p</CODE>. (See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.) | |
10239 | Command names without an accompanying key sequence are unbound by default. | |
10240 | </P><P> | |
10241 | ||
10242 | In the following descriptions, <EM>point</EM> refers to the current cursor | |
10243 | position, and <EM>mark</EM> refers to a cursor position saved by the | |
10244 | <CODE>set-mark</CODE> command. | |
10245 | The text between the point and mark is referred to as the <EM>region</EM>. | |
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"> < </A>]</TD> | |
10253 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> > </A>]</TD> | |
10254 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD> | |
10255 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10256 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10257 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10258 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10259 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10260 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 |
10268 | Move 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 |
10274 | Move 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 |
10280 | Move 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 |
10286 | Move 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 |
10292 | Move forward to the end of the next word. |
10293 | Words 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 |
10299 | Move back to the start of the current or previous word. |
10300 | Words 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 |
10306 | Move forward to the end of the next word. |
10307 | Words 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 |
10313 | Move back to the start of the current or previous word. |
10314 | Words 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 |
10320 | Clear the screen and redraw the current line, |
10321 | leaving 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 |
10327 | Refresh 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"> < </A>]</TD> | |
10338 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> > </A>]</TD> | |
10339 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> << </A>]</TD> | |
10340 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10341 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10342 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10343 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10344 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10345 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 |
10355 | Accept the line regardless of where the cursor is. |
10356 | If this line is | |
10357 | non-empty, add it to the history list according to the setting of | |
10358 | the <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> variables. | |
10359 | If this line is a modified history line, then restore the history line | |
10360 | to its original state. | |
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 |
10366 | Move `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 |
10372 | Move `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-<)</CODE> |
0001803f | 10377 | <DD><A NAME="IDX361"></A> |
17345e5a JA |
10378 | Move to the first line in the history. |
10379 | <P> | |
10380 | ||
0001803f | 10381 | <A NAME="IDX362"></A> |
17345e5a | 10382 | <DT><CODE>end-of-history (M->)</CODE> |
0001803f | 10383 | <DD><A NAME="IDX363"></A> |
17345e5a JA |
10384 | Move to the end of the input history, i.e., the line currently |
10385 | being 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 |
10391 | Search backward starting at the current line and moving `up' through |
10392 | the 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 |
10398 | Search forward starting at the current line and moving `down' through |
10399 | the 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 |
10405 | Search backward starting at the current line and moving `up' |
10406 | through the history as necessary using a non-incremental search | |
10407 | for a string supplied by the user. | |
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 |
10413 | Search forward starting at the current line and moving `down' |
10414 | through the the history as necessary using a non-incremental search | |
10415 | for a string supplied by the user. | |
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 |
10421 | Search forward through the history for the string of characters |
10422 | between the start of the current line and the point. | |
10423 | This is a non-incremental search. | |
10424 | By default, this command is unbound. | |
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 |
10430 | Search backward through the history for the string of characters |
10431 | between the start of the current line and the point. This | |
10432 | is a non-incremental search. By default, this command is unbound. | |
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 |
10438 | Insert the first argument to the previous command (usually |
10439 | the second word on the previous line) at point. | |
10440 | With an argument <VAR>n</VAR>, | |
10441 | insert the <VAR>n</VAR>th word from the previous command (the words | |
10442 | in the previous command begin with word 0). A negative argument | |
10443 | inserts the <VAR>n</VAR>th word from the end of the previous command. | |
10444 | Once the argument <VAR>n</VAR> is computed, the argument is extracted | |
10445 | as if the <SAMP>`!<VAR>n</VAR>'</SAMP> history expansion had been specified. | |
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 |
10451 | Insert last argument to the previous command (the last word of the |
10452 | previous history entry). With an | |
10453 | argument, behave exactly like <CODE>yank-nth-arg</CODE>. | |
10454 | Successive calls to <CODE>yank-last-arg</CODE> move back through the history | |
10455 | list, inserting the last argument of each line in turn. | |
10456 | The history expansion facilities are used to extract the last argument, | |
10457 | as if the <SAMP>`!$'</SAMP> history expansion had been specified. | |
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"> < </A>]</TD> | |
10468 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> > </A>]</TD> | |
10469 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> << </A>]</TD> | |
10470 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10471 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10472 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10473 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10474 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10475 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 |
10485 | Delete the character at point. If point is at the |
10486 | beginning of the line, there are no characters in the line, and | |
10487 | the last character typed was not bound to <CODE>delete-char</CODE>, then | |
10488 | return 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 |
10494 | Delete the character behind the cursor. A numeric argument means |
10495 | to 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 |
10501 | Delete the character under the cursor, unless the cursor is at the |
10502 | end of the line, in which case the character behind the cursor is | |
10503 | deleted. By default, this is not bound to a key. | |
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 |
10509 | Add the next character typed to the line verbatim. This is |
10510 | how to insert key sequences like <KBD>C-q</KBD>, for example. | |
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 |
10516 | Insert 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 |
10522 | Drag the character before the cursor forward over |
10523 | the character at the cursor, moving the | |
10524 | cursor forward as well. If the insertion point | |
10525 | is at the end of the line, then this | |
10526 | transposes the last two characters of the line. | |
10527 | Negative arguments have no effect. | |
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 |
10533 | Drag the word before point past the word after point, |
10534 | moving point past that word as well. | |
10535 | If the insertion point is at the end of the line, this transposes | |
10536 | the last two words on the line. | |
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 |
10542 | Uppercase the current (or following) word. With a negative argument, |
10543 | uppercase 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 |
10549 | Lowercase the current (or following) word. With a negative argument, |
10550 | lowercase 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 |
10556 | Capitalize the current (or following) word. With a negative argument, |
10557 | capitalize 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 |
10563 | Toggle overwrite mode. With an explicit positive numeric argument, |
10564 | switches to overwrite mode. With an explicit non-positive numeric | |
10565 | argument, switches to insert mode. This command affects only | |
10566 | <CODE>emacs</CODE> mode; <CODE>vi</CODE> mode does overwrite differently. | |
10567 | Each call to <CODE>readline()</CODE> starts in insert mode. | |
10568 | <P> | |
10569 | ||
10570 | In overwrite mode, characters bound to <CODE>self-insert</CODE> replace | |
10571 | the text at point rather than pushing the text to the right. | |
10572 | Characters bound to <CODE>backward-delete-char</CODE> replace the character | |
10573 | before point with a space. | |
10574 | </P><P> | |
10575 | ||
10576 | By 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"> < </A>]</TD> | |
10587 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> > </A>]</TD> | |
10588 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> << </A>]</TD> | |
10589 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10590 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10591 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10592 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10593 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10594 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 |
10605 | Kill 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 |
10611 | Kill 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 |
10617 | Kill 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 |
10623 | Kill all characters on the current line, no matter where point is. |
10624 | By 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 |
10630 | Kill from point to the end of the current word, or if between |
10631 | words, to the end of the next word. | |
10632 | Word boundaries are the same as <CODE>forward-word</CODE>. | |
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 |
10638 | Kill the word behind point. |
10639 | Word 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 |
10645 | Kill from point to the end of the current word, or if between |
10646 | words, to the end of the next word. | |
10647 | Word boundaries are the same as <CODE>shell-forward-word</CODE>. | |
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 |
10653 | Kill the word behind point. |
10654 | Word 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 |
10660 | Kill the word behind point, using white space as a word boundary. |
10661 | The 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 |
10667 | Kill the word behind point, using white space and the slash character |
10668 | as the word boundaries. | |
10669 | The killed text is saved on the kill-ring. | |
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 |
10675 | Delete 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 |
10681 | Kill the text in the current region. |
10682 | By 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 |
10688 | Copy the text in the region to the kill buffer, so it can be yanked |
10689 | right away. By default, this command is unbound. | |
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 |
10695 | Copy the word before point to the kill buffer. |
10696 | The word boundaries are the same as <CODE>backward-word</CODE>. | |
10697 | By default, this command is unbound. | |
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 |
10703 | Copy the word following point to the kill buffer. |
10704 | The word boundaries are the same as <CODE>forward-word</CODE>. | |
10705 | By default, this command is unbound. | |
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 |
10711 | Yank 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 |
10717 | Rotate the kill-ring, and yank the new top. You can only do this if |
10718 | the prior command is <CODE>yank</CODE> or <CODE>yank-pop</CODE>. | |
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"> < </A>]</TD> | |
10727 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> > </A>]</TD> | |
10728 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> << </A>]</TD> | |
10729 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10730 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10731 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10732 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10733 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10734 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 |
10743 | Add this digit to the argument already accumulating, or start a new |
10744 | argument. <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 |
10750 | This is another way to specify an argument. |
10751 | If this command is followed by one or more digits, optionally with a | |
10752 | leading minus sign, those digits define the argument. | |
10753 | If the command is followed by digits, executing <CODE>universal-argument</CODE> | |
10754 | again ends the numeric argument, but is otherwise ignored. | |
10755 | As a special case, if this command is immediately followed by a | |
10756 | character that is neither a digit or minus sign, the argument count | |
10757 | for the next command is multiplied by four. | |
10758 | The argument count is initially one, so executing this function the | |
10759 | first time makes the argument count four, a second time makes the | |
10760 | argument count sixteen, and so on. | |
10761 | By default, this is not bound to a key. | |
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"> < </A>]</TD> | |
10770 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> > </A>]</TD> | |
10771 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> << </A>]</TD> | |
10772 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10773 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10774 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10775 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10776 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10777 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 |
10787 | Attempt to perform completion on the text before point. |
10788 | The actual completion performed is application-specific. | |
10789 | Bash attempts completion treating the text as a variable (if the | |
10790 | text begins with <SAMP>`$'</SAMP>), username (if the text begins with | |
10791 | <SAMP>`~'</SAMP>), hostname (if the text begins with <SAMP>`@'</SAMP>), or | |
10792 | command (including aliases and functions) in turn. If none | |
10793 | of these produces a match, filename completion is attempted. | |
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 |
10799 | List 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 |
10805 | Insert all completions of the text before point that would have |
10806 | been 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 |
10812 | Similar to <CODE>complete</CODE>, but replaces the word to be completed |
10813 | with a single match from the list of possible completions. | |
10814 | Repeated execution of <CODE>menu-complete</CODE> steps through the list | |
10815 | of possible completions, inserting each match in turn. | |
10816 | At the end of the list of completions, the bell is rung | |
10817 | (subject to the setting of <CODE>bell-style</CODE>) | |
10818 | and the original text is restored. | |
10819 | An argument of <VAR>n</VAR> moves <VAR>n</VAR> positions forward in the list | |
10820 | of matches; a negative argument may be used to move backward | |
10821 | through the list. | |
10822 | This command is intended to be bound to <KBD>TAB</KBD>, but is unbound | |
10823 | by default. | |
10824 | <P> | |
10825 | ||
0001803f CR |
10826 | <A NAME="IDX448"></A> |
10827 | <DT><CODE>menu-complete-backward ()</CODE> | |
10828 | <DD><A NAME="IDX449"></A> | |
10829 | Identical to <CODE>menu-complete</CODE>, but moves backward through the list | |
10830 | of possible completions, as if <CODE>menu-complete</CODE> had been given a | |
10831 | negative 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 |
10837 | Deletes the character under the cursor if not at the beginning or |
10838 | end of the line (like <CODE>delete-char</CODE>). | |
10839 | If at the end of the line, behaves identically to | |
10840 | <CODE>possible-completions</CODE>. | |
10841 | This command is unbound by default. | |
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 |
10847 | Attempt 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 |
10853 | List the possible completions of the text before point, |
10854 | treating 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 |
10860 | Attempt completion on the text before point, treating |
10861 | it 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 |
10867 | List the possible completions of the text before point, |
10868 | treating 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 |
10874 | Attempt completion on the text before point, treating |
10875 | it 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 |
10881 | List the possible completions of the text before point, |
10882 | treating 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 |
10888 | Attempt completion on the text before point, treating |
10889 | it 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 |
10895 | List the possible completions of the text before point, |
10896 | treating 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 |
10902 | Attempt completion on the text before point, treating |
10903 | it as a command name. Command completion attempts to | |
10904 | match the text against aliases, reserved words, shell | |
10905 | functions, shell builtins, and finally executable filenames, | |
10906 | in 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 |
10912 | List the possible completions of the text before point, |
10913 | treating 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 |
10919 | Attempt completion on the text before point, comparing |
10920 | the text against lines from the history list for possible | |
10921 | completion 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 |
10927 | Attempt menu completion on the text before point, comparing |
10928 | the text against lines from the history list for possible | |
10929 | completion 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 |
10935 | Perform filename completion and insert the list of possible completions |
10936 | enclosed within braces so the list is available to the shell | |
10937 | (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>). | |
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"> < </A>]</TD> | |
10948 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> > </A>]</TD> | |
10949 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> << </A>]</TD> | |
10950 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10951 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10952 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10953 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10954 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10955 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 |
10964 | Begin 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 |
10970 | Stop saving the characters typed into the current keyboard macro |
10971 | and 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 |
10977 | Re-execute the last keyboard macro defined, by making the characters |
10978 | in 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"> < </A>]</TD> | |
10989 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> > </A>]</TD> | |
10990 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD> | |
10991 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10992 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10993 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10994 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10995 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10996 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 |
11005 | Read in the contents of the <VAR>inputrc</VAR> file, and incorporate |
11006 | any 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 |
11012 | Abort the current editing command and |
11013 | ring 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 |
11020 | If the metafied character <VAR>x</VAR> is lowercase, run the command |
11021 | that 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 |
11027 | Metafy the next character typed. This is for keyboards |
11028 | without a meta key. Typing <SAMP>`<KBD>ESC</KBD> f'</SAMP> is equivalent to typing | |
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 |
11035 | Incremental 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 |
11041 | Undo all changes made to this line. This is like executing the <CODE>undo</CODE> |
11042 | command enough times to get back to the beginning. | |
11043 | <P> | |
11044 | ||
0001803f | 11045 | <A NAME="IDX496"></A> |
17345e5a | 11046 | <DT><CODE>tilde-expand (M-&)</CODE> |
0001803f | 11047 | <DD><A NAME="IDX497"></A> |
17345e5a JA |
11048 | Perform 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 |
11054 | Set the mark to the point. If a |
11055 | numeric 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 |
11061 | Swap the point with the mark. The current cursor position is set to |
11062 | the saved position, and the old cursor position is saved as the mark. | |
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 |
11068 | A character is read and point is moved to the next occurrence of that |
11069 | character. 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 |
11075 | A character is read and point is moved to the previous occurrence |
11076 | of that character. A negative count searches for subsequent | |
11077 | occurrences. | |
11078 | <P> | |
11079 | ||
0001803f CR |
11080 | <A NAME="IDX506"></A> |
11081 | <DT><CODE>skip-csi-sequence ()</CODE> | |
11082 | <DD><A NAME="IDX507"></A> | |
11083 | Read enough characters to consume a multi-key sequence such as those | |
11084 | defined for keys like Home and End. Such sequences begin with a | |
11085 | Control Sequence Indicator (CSI), usually ESC-[. If this sequence is | |
11086 | bound to "\e[", keys producing such sequences will have no effect | |
11087 | unless explicitly bound to a readline command, instead of inserting | |
11088 | stray characters into the editing buffer. This is unbound by default, | |
11089 | but usually bound to ESC-[. | |
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 |
11095 | Without a numeric argument, the value of the <CODE>comment-begin</CODE> |
11096 | variable is inserted at the beginning of the current line. | |
11097 | If a numeric argument is supplied, this command acts as a toggle: if | |
11098 | the characters at the beginning of the line do not match the value | |
11099 | of <CODE>comment-begin</CODE>, the value is inserted, otherwise | |
11100 | the characters in <CODE>comment-begin</CODE> are deleted from the beginning of | |
11101 | the line. | |
11102 | In either case, the line is accepted as if a newline had been typed. | |
11103 | The default value of <CODE>comment-begin</CODE> causes this command | |
11104 | to make the current line a shell comment. | |
11105 | If a numeric argument causes the comment character to be removed, the line | |
11106 | will be executed by the shell. | |
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 |
11112 | Print all of the functions and their key bindings to the |
11113 | Readline output stream. If a numeric argument is supplied, | |
11114 | the output is formatted in such a way that it can be made part | |
11115 | of an <VAR>inputrc</VAR> file. This command is unbound by default. | |
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 |
11121 | Print all of the settable variables and their values to the |
11122 | Readline output stream. If a numeric argument is supplied, | |
11123 | the output is formatted in such a way that it can be made part | |
11124 | of an <VAR>inputrc</VAR> file. This command is unbound by default. | |
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 |
11130 | Print all of the Readline key sequences bound to macros and the |
11131 | strings they output. If a numeric argument is supplied, | |
11132 | the output is formatted in such a way that it can be made part | |
11133 | of an <VAR>inputrc</VAR> file. This command is unbound by default. | |
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 |
11139 | The word before point is treated as a pattern for pathname expansion, |
11140 | with an asterisk implicitly appended. This pattern is used to | |
11141 | generate a list of matching file names for possible completions. | |
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 |
11147 | The word before point is treated as a pattern for pathname expansion, |
11148 | and the list of matching file names is inserted, replacing the word. | |
11149 | If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before | |
11150 | pathname expansion. | |
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 |
11156 | The list of expansions that would have been generated by |
11157 | <CODE>glob-expand-word</CODE> is displayed, and the line is redrawn. | |
11158 | If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before | |
11159 | pathname expansion. | |
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 |
11165 | Display 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 |
11171 | Expand the line as the shell does. |
11172 | This performs alias and history expansion as well as all of the shell | |
11173 | word expansions (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>). | |
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 |
11179 | Perform 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 |
11185 | Perform history expansion on the current line and insert a space |
11186 | (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>). | |
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 |
11192 | Perform 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 |
11198 | Perform 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 |
11204 | A 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 |
11210 | Accept the current line for execution and fetch the next line |
11211 | relative to the current line from the history for editing. Any | |
11212 | argument is ignored. | |
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 |
11218 | Invoke an editor on the current command line, and execute the result as shell |
11219 | commands. | |
11220 | Bash attempts to invoke | |
11221 | <CODE>$VISUAL</CODE>, <CODE>$EDITOR</CODE>, and <CODE>emacs</CODE> | |
11222 | as 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"> < </A>]</TD> | |
11233 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> > </A>]</TD> | |
11234 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> << </A>]</TD> | |
11235 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
11236 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
11237 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11238 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11239 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11240 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11241 | </TR></TABLE> | |
11242 | <H2> 8.5 Readline vi Mode </H2> | |
11243 | <!--docid::SEC116::--> | |
11244 | <P> | |
11245 | ||
11246 | While the Readline library does not have a full set of <CODE>vi</CODE> | |
11247 | editing functions, it does contain enough to allow simple editing | |
11248 | of the line. The Readline <CODE>vi</CODE> mode behaves as specified in | |
11249 | the POSIX 1003.2 standard. | |
11250 | </P><P> | |
11251 | ||
11252 | In order to switch interactively between <CODE>emacs</CODE> and <CODE>vi</CODE> | |
11253 | editing modes, use the <SAMP>`set -o emacs'</SAMP> and <SAMP>`set -o vi'</SAMP> | |
11254 | commands (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
11255 | The Readline default is <CODE>emacs</CODE> mode. | |
11256 | </P><P> | |
11257 | ||
11258 | When you enter a line in <CODE>vi</CODE> mode, you are already placed in | |
11259 | `insertion' mode, as if you had typed an <SAMP>`i'</SAMP>. Pressing <KBD>ESC</KBD> | |
11260 | switches you into `command' mode, where you can edit the text of the | |
11261 | line with the standard <CODE>vi</CODE> movement keys, move to previous | |
11262 | history lines with <SAMP>`k'</SAMP> and subsequent lines with <SAMP>`j'</SAMP>, and | |
11263 | so 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"> < </A>]</TD> | |
11271 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> > </A>]</TD> | |
11272 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> << </A>]</TD> | |
11273 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
11274 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
11275 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11276 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11277 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11278 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11279 | </TR></TABLE> | |
11280 | <H2> 8.6 Programmable Completion </H2> | |
11281 | <!--docid::SEC117::--> | |
11282 | <P> | |
11283 | ||
11284 | When word completion is attempted for an argument to a command for | |
11285 | which a completion specification (a <VAR>compspec</VAR>) has been defined | |
11286 | using the <CODE>complete</CODE> builtin (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>), | |
11287 | the programmable completion facilities are invoked. | |
11288 | </P><P> | |
11289 | ||
11290 | First, the command name is identified. | |
11291 | If a compspec has been defined for that command, the | |
11292 | compspec is used to generate the list of possible completions for the word. | |
0001803f CR |
11293 | If the command word is the empty string (completion attempted at the |
11294 | beginning of an empty line), any compspec defined with | |
11295 | the <SAMP>`-E'</SAMP> option to <CODE>complete</CODE> is used. | |
17345e5a JA |
11296 | If the command word is a full pathname, a compspec for the full |
11297 | pathname is searched for first. | |
11298 | If no compspec is found for the full pathname, an attempt is made to | |
11299 | find a compspec for the portion following the final slash. | |
0001803f CR |
11300 | If those searches do not result in a compspec, any compspec defined with |
11301 | the <SAMP>`-D'</SAMP> option to <CODE>complete</CODE> is used as the default. | |
17345e5a JA |
11302 | </P><P> |
11303 | ||
11304 | Once a compspec has been found, it is used to generate the list of | |
11305 | matching words. | |
11306 | If a compspec is not found, the default Bash completion | |
11307 | described above (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>) is performed. | |
11308 | </P><P> | |
11309 | ||
11310 | First, the actions specified by the compspec are used. | |
11311 | Only matches which are prefixed by the word being completed are | |
11312 | returned. | |
11313 | When the <SAMP>`-f'</SAMP> or <SAMP>`-d'</SAMP> option is used for filename or | |
11314 | directory name completion, the shell variable <CODE>FIGNORE</CODE> is | |
11315 | used to filter the matches. | |
11316 | See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>. | |
11317 | </P><P> | |
11318 | ||
11319 | Any completions specified by a filename expansion pattern to the | |
11320 | <SAMP>`-G'</SAMP> option are generated next. | |
11321 | The words generated by the pattern need not match the word being completed. | |
11322 | The <CODE>GLOBIGNORE</CODE> shell variable is not used to filter the matches, | |
11323 | but the <CODE>FIGNORE</CODE> shell variable is used. | |
11324 | </P><P> | |
11325 | ||
11326 | Next, the string specified as the argument to the <SAMP>`-W'</SAMP> option | |
11327 | is considered. | |
11328 | The string is first split using the characters in the <CODE>IFS</CODE> | |
11329 | special variable as delimiters. | |
11330 | Shell quoting is honored. | |
11331 | Each word is then expanded using | |
11332 | brace expansion, tilde expansion, parameter and variable expansion, | |
11333 | command substitution, and arithmetic expansion, | |
11334 | as described above (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>). | |
11335 | The results are split using the rules described above | |
11336 | (see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>). | |
11337 | The results of the expansion are prefix-matched against the word being | |
11338 | completed, and the matching words become the possible completions. | |
11339 | </P><P> | |
11340 | ||
11341 | After these matches have been generated, any shell function or command | |
11342 | specified with the <SAMP>`-F'</SAMP> and <SAMP>`-C'</SAMP> options is invoked. | |
11343 | When the command or function is invoked, the <CODE>COMP_LINE</CODE>, | |
11344 | <CODE>COMP_POINT</CODE>, <CODE>COMP_KEY</CODE>, and <CODE>COMP_TYPE</CODE> variables are | |
11345 | assigned values as described above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
11346 | If a shell function is being invoked, the <CODE>COMP_WORDS</CODE> and | |
11347 | <CODE>COMP_CWORD</CODE> variables are also set. | |
11348 | When the function or command is invoked, the first argument is the | |
11349 | name of the command whose arguments are being completed, the | |
11350 | second argument is the word being completed, and the third argument | |
11351 | is the word preceding the word being completed on the current command line. | |
11352 | No filtering of the generated completions against the word being completed | |
11353 | is performed; the function or command has complete freedom in generating | |
11354 | the matches. | |
11355 | </P><P> | |
11356 | ||
11357 | Any function specified with <SAMP>`-F'</SAMP> is invoked first. | |
11358 | The function may use any of the shell facilities, including the | |
11359 | <CODE>compgen</CODE> and <CODE>compopt</CODE> builtins described below | |
11360 | (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>), to generate the matches. | |
11361 | It must put the possible completions in the <CODE>COMPREPLY</CODE> array | |
11362 | variable. | |
11363 | </P><P> | |
11364 | ||
11365 | Next, any command specified with the <SAMP>`-C'</SAMP> option is invoked | |
11366 | in an environment equivalent to command substitution. | |
11367 | It should print a list of completions, one per line, to | |
11368 | the standard output. | |
11369 | Backslash may be used to escape a newline, if necessary. | |
11370 | </P><P> | |
11371 | ||
11372 | After all of the possible completions are generated, any filter | |
11373 | specified with the <SAMP>`-X'</SAMP> option is applied to the list. | |
11374 | The filter is a pattern as used for pathname expansion; a <SAMP>`&'</SAMP> | |
11375 | in the pattern is replaced with the text of the word being completed. | |
11376 | A literal <SAMP>`&'</SAMP> may be escaped with a backslash; the backslash | |
11377 | is removed before attempting a match. | |
11378 | Any completion that matches the pattern will be removed from the list. | |
11379 | A leading <SAMP>`!'</SAMP> negates the pattern; in this case any completion | |
11380 | not matching the pattern will be removed. | |
11381 | </P><P> | |
11382 | ||
11383 | Finally, any prefix and suffix specified with the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> | |
11384 | options are added to each member of the completion list, and the result is | |
11385 | returned to the Readline completion code as the list of possible | |
11386 | completions. | |
11387 | </P><P> | |
11388 | ||
11389 | If the previously-applied actions do not generate any matches, and the | |
11390 | <SAMP>`-o dirnames'</SAMP> option was supplied to <CODE>complete</CODE> when the | |
11391 | compspec was defined, directory name completion is attempted. | |
11392 | </P><P> | |
11393 | ||
11394 | If the <SAMP>`-o plusdirs'</SAMP> option was supplied to <CODE>complete</CODE> when | |
11395 | the compspec was defined, directory name completion is attempted and any | |
11396 | matches are added to the results of the other actions. | |
11397 | </P><P> | |
11398 | ||
11399 | By default, if a compspec is found, whatever it generates is returned to | |
11400 | the completion code as the full set of possible completions. | |
11401 | The default Bash completions are not attempted, and the Readline default | |
11402 | of filename completion is disabled. | |
11403 | If the <SAMP>`-o bashdefault'</SAMP> option was supplied to <CODE>complete</CODE> when | |
11404 | the compspec was defined, the default Bash completions are attempted | |
11405 | if the compspec generates no matches. | |
11406 | If the <SAMP>`-o default'</SAMP> option was supplied to <CODE>complete</CODE> when the | |
11407 | compspec was defined, Readline's default completion will be performed | |
11408 | if the compspec (and, if attempted, the default Bash completions) | |
11409 | generate no matches. | |
11410 | </P><P> | |
11411 | ||
11412 | When a compspec indicates that directory name completion is desired, | |
11413 | the programmable completion functions force Readline to append a slash | |
11414 | to completed names which are symbolic links to directories, subject to | |
11415 | the value of the <VAR>mark-directories</VAR> Readline variable, regardless | |
11416 | of the setting of the <VAR>mark-symlinked-directories</VAR> Readline variable. | |
11417 | </P><P> | |
11418 | ||
0001803f CR |
11419 | There is some support for dynamically modifying completions. This is |
11420 | most useful when used in combination with a default completion specified | |
11421 | with <SAMP>`-D'</SAMP>. It's possible for shell functions executed as completion | |
11422 | handlers to indicate that completion should be retried by returning an | |
11423 | exit status of 124. If a shell function returns 124, and changes | |
11424 | the compspec associated with the command on which completion is being | |
11425 | attempted (supplied as the first argument when the function is executed), | |
11426 | programmable completion restarts from the beginning, with an | |
11427 | attempt to find a compspec for that command. This allows a set of | |
11428 | completions to be built dynamically as completion is attempted, rather than | |
11429 | being loaded all at once. | |
11430 | </P><P> | |
11431 | ||
11432 | For instance, assuming that there is a library of compspecs, each kept in a | |
11433 | file corresponding to the name of the command, the following default | |
11434 | completion function would load completions dynamically: | |
11435 | </P><P> | |
11436 | ||
11437 | <TABLE><tr><td> </td><td class=example><pre>_completion_loader() | |
11438 | { | |
11439 | . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 | |
11440 | } | |
11441 | complete -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"> < </A>]</TD> | |
11449 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> > </A>]</TD> | |
11450 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD> | |
11451 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
11452 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
11453 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11454 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11455 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11456 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11457 | </TR></TABLE> | |
11458 | <H2> 8.7 Programmable Completion Builtins </H2> | |
11459 | <!--docid::SEC118::--> | |
11460 | <P> | |
11461 | ||
11462 | Two builtin commands are available to manipulate the programmable completion | |
11463 | facilities. | |
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> </td><td class=example><pre><CODE>compgen [<VAR>option</VAR>] [<VAR>word</VAR>]</CODE> |
11470 | </pre></td></tr></table><P> | |
11471 | ||
11472 | Generate possible completion matches for <VAR>word</VAR> according to | |
11473 | the <VAR>option</VAR>s, which may be any option accepted by the | |
11474 | <CODE>complete</CODE> | |
11475 | builtin with the exception of <SAMP>`-p'</SAMP> and <SAMP>`-r'</SAMP>, and write | |
11476 | the matches to the standard output. | |
11477 | When using the <SAMP>`-F'</SAMP> or <SAMP>`-C'</SAMP> options, the various shell variables | |
11478 | set by the programmable completion facilities, while available, will not | |
11479 | have useful values. | |
11480 | </P><P> | |
11481 | ||
11482 | The matches will be generated in the same way as if the programmable | |
11483 | completion code had generated them directly from a completion specification | |
11484 | with the same flags. | |
11485 | If <VAR>word</VAR> is specified, only those completions matching <VAR>word</VAR> | |
11486 | will be displayed. | |
11487 | </P><P> | |
11488 | ||
11489 | The return value is true unless an invalid option is supplied, or no | |
11490 | matches were generated. | |
11491 | </P><P> | |
11492 | ||
11493 | <DT><CODE>complete</CODE> | |
0001803f CR |
11494 | <DD><A NAME="IDX541"></A> |
11495 | <TABLE><tr><td> </td><td class=example><pre><CODE>complete [-abcdefgjksuv] [-o <VAR>comp-option</VAR>] [-DE] [-A <VAR>action</VAR>] [-G <VAR>globpat</VAR>] [-W <VAR>wordlist</VAR>] | |
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 | ||
11501 | Specify how arguments to each <VAR>name</VAR> should be completed. | |
11502 | If the <SAMP>`-p'</SAMP> option is supplied, or if no options are supplied, existing | |
11503 | completion specifications are printed in a way that allows them to be | |
11504 | reused as input. | |
11505 | The <SAMP>`-r'</SAMP> option removes a completion specification for | |
11506 | each <VAR>name</VAR>, or, if no <VAR>name</VAR>s are supplied, all | |
11507 | completion specifications. | |
0001803f CR |
11508 | The <SAMP>`-D'</SAMP> option indicates that the remaining options and actions should |
11509 | apply to the "default" command completion; that is, completion attempted | |
11510 | on a command for which no completion has previously been defined. | |
17345e5a JA |
11511 | The <SAMP>`-E'</SAMP> option indicates that the remaining options and actions should |
11512 | apply to "empty" command completion; that is, completion attempted on a | |
11513 | blank line. | |
11514 | </P><P> | |
11515 | ||
11516 | The process of applying these completion specifications when word completion | |
0001803f CR |
11517 | is attempted is described above (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). The |
11518 | <SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>. | |
17345e5a JA |
11519 | </P><P> |
11520 | ||
11521 | Other options, if specified, have the following meanings. | |
11522 | The arguments to the <SAMP>`-G'</SAMP>, <SAMP>`-W'</SAMP>, and <SAMP>`-X'</SAMP> options | |
11523 | (and, if necessary, the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> options) | |
11524 | should be quoted to protect them from expansion before the | |
11525 | <CODE>complete</CODE> builtin is invoked. | |
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 | |
11531 | beyond 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 | |
11539 | generates no matches. | |
11540 | <P> | |
11541 | ||
11542 | <DT><CODE>default</CODE> | |
11543 | <DD>Use Readline's default filename completion if the compspec generates | |
11544 | no 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 | |
11553 | filename-specific processing (like adding a slash to directory names | |
11554 | quoting special characters, or suppressing trailing spaces). | |
11555 | This option is intended to be used with shell functions specified | |
11556 | with <SAMP>`-F'</SAMP>. | |
11557 | <P> | |
11558 | ||
11559 | <DT><CODE>nospace</CODE> | |
11560 | <DD>Tell Readline not to append a space (the default) to words completed at | |
11561 | the end of the line. | |
11562 | <P> | |
11563 | ||
11564 | <DT><CODE>plusdirs</CODE> | |
11565 | <DD>After any matches defined by the compspec are generated, | |
11566 | directory name completion is attempted and any | |
11567 | matches are added to the results of the other actions. | |
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 | |
11575 | completions: | |
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 | |
11681 | the 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 | |
11687 | is expanded. | |
11688 | The possible completions are the members of the resultant list which | |
11689 | match 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 | |
11694 | used 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 | |
11699 | environment. | |
11700 | When it finishes, the possible completions are retrieved from the value | |
11701 | of 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. | |
11706 | It is applied to the list of possible completions generated by the | |
11707 | preceding options and arguments, and each completion matching | |
11708 | <VAR>filterpat</VAR> is removed from the list. | |
11709 | A leading <SAMP>`!'</SAMP> in <VAR>filterpat</VAR> negates the pattern; in this | |
11710 | case, any completion not matching <VAR>filterpat</VAR> is removed. | |
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 | |
11715 | after 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 | |
11720 | after all other options have been applied. | |
11721 | </DL> | |
11722 | <P> | |
11723 | ||
11724 | The return value is true unless an invalid option is supplied, an option | |
11725 | other than <SAMP>`-p'</SAMP> or <SAMP>`-r'</SAMP> is supplied without a <VAR>name</VAR> | |
11726 | argument, an attempt is made to remove a completion specification for | |
11727 | a <VAR>name</VAR> for which no specification exists, or | |
11728 | an error occurs adding a completion specification. | |
11729 | </P><P> | |
11730 | ||
11731 | <DT><CODE>compopt</CODE> | |
0001803f CR |
11732 | <DD><A NAME="IDX542"></A> |
11733 | <TABLE><tr><td> </td><td class=example><pre><CODE>compopt</CODE> [-o <VAR>option</VAR>] [-DE] [+o <VAR>option</VAR>] [<VAR>name</VAR>] | |
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 | |
11736 | are supplied. | |
11737 | If no <VAR>option</VAR>s are given, display the completion options for each | |
11738 | <VAR>name</VAR> or the current completion. | |
11739 | The possible values of <VAR>option</VAR> are those valid for the <CODE>complete</CODE> | |
11740 | builtin described above. | |
0001803f CR |
11741 | The <SAMP>`-D'</SAMP> option indicates that the remaining options should |
11742 | apply to the "default" command completion; that is, completion attempted | |
11743 | on a command for which no completion has previously been defined. | |
11744 | The <SAMP>`-E'</SAMP> option indicates that the remaining options should | |
11745 | apply to "empty" command completion; that is, completion attempted on a | |
11746 | blank line. | |
17345e5a JA |
11747 | <P> |
11748 | ||
0001803f CR |
11749 | The <SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>. |
11750 | </P><P> | |
11751 | ||
17345e5a JA |
11752 | The return value is true unless an invalid option is supplied, an attempt |
11753 | is made to modify the options for a <VAR>name</VAR> for which no completion | |
11754 | specification exists, or an output error occurs. | |
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"> < </A>]</TD> | |
11768 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> > </A>]</TD> | |
11769 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
11770 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
11771 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
11772 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11773 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11774 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11775 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11776 | </TR></TABLE> | |
11777 | <H1> 9. Using History Interactively </H1> | |
11778 | <!--docid::SEC119::--> | |
11779 | <P> | |
11780 | ||
11781 | This chapter describes how to use the GNU History Library | |
11782 | interactively, from a user's standpoint. | |
11783 | It should be considered a user's guide. | |
11784 | For information on using the GNU History Library in other programs, | |
11785 | see the GNU Readline Library Manual. | |
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> </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> </TD><TD ALIGN="left" VALIGN="TOP">The Bash builtin commands that manipulate | |
11792 | the command history.</TD></TR> | |
11793 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC122">9.3 History Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What it feels like using History as a user.</TD></TR> | |
11794 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
11802 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> > </A>]</TD> | |
11803 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
11804 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD> | |
11805 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
11806 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11807 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11808 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11809 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11810 | </TR></TABLE> | |
11811 | <H2> 9.1 Bash History Facilities </H2> | |
11812 | <!--docid::SEC120::--> | |
11813 | <P> | |
11814 | ||
11815 | When the <SAMP>`-o history'</SAMP> option to the <CODE>set</CODE> builtin | |
11816 | is enabled (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), | |
11817 | the shell provides access to the <EM>command history</EM>, | |
11818 | the list of commands previously typed. | |
11819 | The value of the <CODE>HISTSIZE</CODE> shell variable is used as the | |
11820 | number of commands to save in a history list. | |
11821 | The text of the last <CODE>$HISTSIZE</CODE> | |
11822 | commands (default 500) is saved. | |
11823 | The shell stores each command in the history list prior to | |
11824 | parameter and variable expansion | |
11825 | but after history expansion is performed, subject to the | |
11826 | values of the shell variables | |
11827 | <CODE>HISTIGNORE</CODE> and <CODE>HISTCONTROL</CODE>. | |
11828 | </P><P> | |
11829 | ||
11830 | When the shell starts up, the history is initialized from the | |
11831 | file named by the <CODE>HISTFILE</CODE> variable (default <TT>`~/.bash_history'</TT>). | |
11832 | The file named by the value of <CODE>HISTFILE</CODE> is truncated, if | |
11833 | necessary, to contain no more than the number of lines specified by | |
11834 | the value of the <CODE>HISTFILESIZE</CODE> variable. | |
11835 | When an interactive shell exits, the last | |
11836 | <CODE>$HISTSIZE</CODE> lines are copied from the history list to the file | |
11837 | named by <CODE>$HISTFILE</CODE>. | |
11838 | If the <CODE>histappend</CODE> shell option is set (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>), | |
11839 | the lines are appended to the history file, | |
11840 | otherwise the history file is overwritten. | |
11841 | If <CODE>HISTFILE</CODE> | |
11842 | is unset, or if the history file is unwritable, the history is | |
11843 | not saved. After saving the history, the history file is truncated | |
11844 | to contain no more than <CODE>$HISTFILESIZE</CODE> | |
11845 | lines. If <CODE>HISTFILESIZE</CODE> is not set, no truncation is performed. | |
11846 | </P><P> | |
11847 | ||
11848 | If the <CODE>HISTTIMEFORMAT</CODE> is set, the time stamp information | |
11849 | associated with each history entry is written to the history file, | |
11850 | marked with the history comment character. | |
11851 | When the history file is read, lines beginning with the history | |
11852 | comment character followed immediately by a digit are interpreted | |
11853 | as timestamps for the previous history line. | |
11854 | </P><P> | |
11855 | ||
11856 | The builtin command <CODE>fc</CODE> may be used to list or edit and re-execute | |
11857 | a portion of the history list. | |
11858 | The <CODE>history</CODE> builtin may be used to display or modify the history | |
11859 | list and manipulate the history file. | |
11860 | When using command-line editing, search commands | |
11861 | are available in each editing mode that provide access to the | |
11862 | history list (see section <A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A>). | |
11863 | </P><P> | |
11864 | ||
11865 | The shell allows control over which commands are saved on the history | |
11866 | list. The <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> | |
11867 | variables may be set to cause the shell to save only a subset of the | |
11868 | commands entered. | |
11869 | The <CODE>cmdhist</CODE> | |
11870 | shell option, if enabled, causes the shell to attempt to save each | |
11871 | line of a multi-line command in the same history entry, adding | |
11872 | semicolons where necessary to preserve syntactic correctness. | |
11873 | The <CODE>lithist</CODE> | |
11874 | shell option causes the shell to save the command with embedded newlines | |
11875 | instead of semicolons. | |
11876 | The <CODE>shopt</CODE> builtin is used to set these options. | |
11877 | See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of <CODE>shopt</CODE>. | |
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"> < </A>]</TD> | |
11885 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> > </A>]</TD> | |
11886 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> << </A>]</TD> | |
11887 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD> | |
11888 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
11889 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11890 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11891 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11892 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11893 | </TR></TABLE> | |
11894 | <H2> 9.2 Bash History Builtins </H2> | |
11895 | <!--docid::SEC121::--> | |
11896 | <P> | |
11897 | ||
11898 | Bash provides two builtin commands which manipulate the | |
11899 | history 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> </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 | ||
11910 | Fix Command. In the first form, a range of commands from <VAR>first</VAR> to | |
11911 | <VAR>last</VAR> is selected from the history list. Both <VAR>first</VAR> and | |
11912 | <VAR>last</VAR> may be specified as a string (to locate the most recent | |
11913 | command beginning with that string) or as a number (an index into the | |
11914 | history list, where a negative number is used as an offset from the | |
11915 | current command number). If <VAR>last</VAR> is not specified it is set to | |
11916 | <VAR>first</VAR>. If <VAR>first</VAR> is not specified it is set to the previous | |
11917 | command for editing and -16 for listing. If the <SAMP>`-l'</SAMP> flag is | |
11918 | given, the commands are listed on standard output. The <SAMP>`-n'</SAMP> flag | |
11919 | suppresses the command numbers when listing. The <SAMP>`-r'</SAMP> flag | |
11920 | reverses the order of the listing. Otherwise, the editor given by | |
11921 | <VAR>ename</VAR> is invoked on a file containing those commands. If | |
11922 | <VAR>ename</VAR> is not given, the value of the following variable expansion | |
11923 | is used: <CODE>${FCEDIT:-${EDITOR:-vi}}</CODE>. This says to use the | |
11924 | value of the <CODE>FCEDIT</CODE> variable if set, or the value of the | |
11925 | <CODE>EDITOR</CODE> variable if that is set, or <CODE>vi</CODE> if neither is set. | |
11926 | When editing is complete, the edited commands are echoed and executed. | |
11927 | </P><P> | |
11928 | ||
11929 | In the second form, <VAR>command</VAR> is re-executed after each instance | |
11930 | of <VAR>pat</VAR> in the selected command is replaced by <VAR>rep</VAR>. | |
11931 | </P><P> | |
11932 | ||
11933 | A useful alias to use with the <CODE>fc</CODE> command is <CODE>r='fc -s'</CODE>, so | |
11934 | that typing <SAMP>`r cc'</SAMP> runs the last command beginning with <CODE>cc</CODE> | |
11935 | and typing <SAMP>`r'</SAMP> re-executes the last command (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>). | |
11936 | </P><P> | |
11937 | ||
11938 | <DT><CODE>history</CODE> | |
0001803f | 11939 | <DD><A NAME="IDX545"></A> |
17345e5a JA |
11940 | <TABLE><tr><td> </td><td class=example><pre>history [<VAR>n</VAR>] |
11941 | history -c | |
11942 | history -d <VAR>offset</VAR> | |
11943 | history [-anrw] [<VAR>filename</VAR>] | |
11944 | history -ps <VAR>arg</VAR> | |
11945 | </pre></td></tr></table><P> | |
11946 | ||
11947 | With no options, display the history list with line numbers. | |
11948 | Lines prefixed with a <SAMP>`*'</SAMP> have been modified. | |
11949 | An argument of <VAR>n</VAR> lists only the last <VAR>n</VAR> lines. | |
11950 | If the shell variable <CODE>HISTTIMEFORMAT</CODE> is set and not null, | |
11951 | it is used as a format string for <VAR>strftime</VAR> to display | |
11952 | the time stamp associated with each displayed history entry. | |
11953 | No intervening blank is printed between the formatted time stamp | |
11954 | and the history line. | |
11955 | </P><P> | |
11956 | ||
11957 | Options, 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 | |
11963 | with 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 | |
11969 | displayed. | |
11970 | <P> | |
11971 | ||
11972 | <DT><CODE>-a</CODE> | |
11973 | <DD>Append the new | |
11974 | history lines (history lines entered since the beginning of the | |
11975 | current 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 | |
11980 | to the current history list. These are lines appended to the history | |
11981 | file 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 | |
11986 | the 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 | |
11995 | on 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 | |
12000 | the history list as a single entry. | |
12001 | <P> | |
12002 | ||
12003 | </DL> | |
12004 | <P> | |
12005 | ||
12006 | When any of the <SAMP>`-w'</SAMP>, <SAMP>`-r'</SAMP>, <SAMP>`-a'</SAMP>, or <SAMP>`-n'</SAMP> options is | |
12007 | used, if <VAR>filename</VAR> | |
12008 | is given, then it is used as the history file. If not, then | |
12009 | the value of the <CODE>HISTFILE</CODE> variable is used. | |
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"> < </A>]</TD> | |
12020 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> > </A>]</TD> | |
12021 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
12022 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD> | |
12023 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
12024 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12025 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12026 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12027 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12028 | </TR></TABLE> | |
12029 | <H2> 9.3 History Expansion </H2> | |
12030 | <!--docid::SEC122::--> | |
12031 | <P> | |
12032 | ||
12033 | The History library provides a history expansion feature that is similar | |
12034 | to the history expansion provided by <CODE>csh</CODE>. This section | |
12035 | describes the syntax used to manipulate the history information. | |
12036 | </P><P> | |
12037 | ||
12038 | History expansions introduce words from the history list into | |
12039 | the input stream, making it easy to repeat commands, insert the | |
12040 | arguments to a previous command into the current input line, or | |
12041 | fix errors in previous commands quickly. | |
12042 | </P><P> | |
12043 | ||
12044 | History expansion takes place in two parts. The first is to determine | |
12045 | which line from the history list should be used during substitution. | |
12046 | The second is to select portions of that line for inclusion into the | |
12047 | current one. The line selected from the history is called the | |
12048 | <EM>event</EM>, and the portions of that line that are acted upon are | |
12049 | called <EM>words</EM>. Various <EM>modifiers</EM> are available to manipulate | |
12050 | the selected words. The line is broken into words in the same fashion | |
12051 | that Bash does, so that several words | |
12052 | surrounded by quotes are considered one word. | |
12053 | History expansions are introduced by the appearance of the | |
12054 | history expansion character, which is <SAMP>`!'</SAMP> by default. | |
12055 | Only <SAMP>`\'</SAMP> and <SAMP>`''</SAMP> may be used to escape the history expansion | |
12056 | character. | |
12057 | </P><P> | |
12058 | ||
12059 | Several shell options settable with the <CODE>shopt</CODE> | |
12060 | builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>) may be used to tailor | |
12061 | the behavior of history expansion. If the | |
12062 | <CODE>histverify</CODE> shell option is enabled, and Readline | |
12063 | is being used, history substitutions are not immediately passed to | |
12064 | the shell parser. | |
12065 | Instead, the expanded line is reloaded into the Readline | |
12066 | editing buffer for further modification. | |
12067 | If Readline is being used, and the <CODE>histreedit</CODE> | |
12068 | shell option is enabled, a failed history expansion will be | |
12069 | reloaded into the Readline editing buffer for correction. | |
12070 | The <SAMP>`-p'</SAMP> option to the <CODE>history</CODE> builtin command | |
12071 | may be used to see what a history expansion will do before using it. | |
12072 | The <SAMP>`-s'</SAMP> option to the <CODE>history</CODE> builtin may be used to | |
12073 | add commands to the end of the history list without actually executing | |
12074 | them, so that they are available for subsequent recall. | |
12075 | This is most useful in conjunction with Readline. | |
12076 | </P><P> | |
12077 | ||
12078 | The shell allows control of the various characters used by the | |
12079 | history expansion mechanism with the <CODE>histchars</CODE> variable, | |
12080 | as explained above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). The shell uses | |
12081 | the history comment character to mark history timestamps when | |
12082 | writing the history file. | |
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> </TD><TD ALIGN="left" VALIGN="TOP">How to specify which history line to use.</TD></TR> | |
12087 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC124">9.3.2 Word Designators</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying which words are of interest.</TD></TR> | |
12088 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC125">9.3.3 Modifiers</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Modifying the results of substitution.</TD></TR> | |
12089 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
12097 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> > </A>]</TD> | |
12098 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
12099 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> | |
12100 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
12101 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12102 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12103 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12104 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12105 | </TR></TABLE> | |
12106 | <H3> 9.3.1 Event Designators </H3> | |
12107 | <!--docid::SEC123::--> | |
12108 | <P> | |
12109 | ||
12110 | An event designator is a reference to a command line entry in the | |
12111 | history 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, | |
12119 | the end of the line, <SAMP>`='</SAMP> or <SAMP>`('</SAMP> (when the | |
12120 | <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> builtin). | |
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 | |
12142 | a 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> | |
12147 | with <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"> < </A>]</TD> | |
12163 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> > </A>]</TD> | |
12164 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> << </A>]</TD> | |
12165 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> | |
12166 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
12167 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12168 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12169 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12170 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12171 | </TR></TABLE> | |
12172 | <H3> 9.3.2 Word Designators </H3> | |
12173 | <!--docid::SEC124::--> | |
12174 | <P> | |
12175 | ||
12176 | Word designators are used to select desired words from the event. | |
12177 | A <SAMP>`:'</SAMP> separates the event specification from the word designator. It | |
12178 | may be omitted if the word designator begins with a <SAMP>`^'</SAMP>, <SAMP>`$'</SAMP>, | |
12179 | <SAMP>`*'</SAMP>, <SAMP>`-'</SAMP>, or <SAMP>`%'</SAMP>. Words are numbered from the beginning | |
12180 | of the line, with the first word being denoted by 0 (zero). Words are | |
12181 | inserted into the current line separated by single spaces. | |
12182 | </P><P> | |
12183 | ||
12184 | For example, | |
12185 | </P><P> | |
12186 | ||
12187 | <DL COMPACT> | |
12188 | <DT><CODE>!!</CODE> | |
12189 | <DD>designates the preceding command. When you type this, the preceding | |
12190 | command is repeated in toto. | |
12191 | <P> | |
12192 | ||
12193 | <DT><CODE>!!:$</CODE> | |
12194 | <DD>designates the last argument of the preceding command. This may be | |
12195 | shortened 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 | |
12200 | the letters <CODE>fi</CODE>. | |
12201 | </DL> | |
12202 | <P> | |
12203 | ||
12204 | Here 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>. | |
12234 | It is not an error to use <SAMP>`*'</SAMP> if there is just one word in the event; | |
12235 | the empty string is returned in that case. | |
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 | ||
12249 | If a word designator is supplied without an event specification, the | |
12250 | previous 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"> < </A>]</TD> | |
12258 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> > </A>]</TD> | |
12259 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
12260 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> | |
12261 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
12262 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12263 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12264 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12265 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12266 | </TR></TABLE> | |
12267 | <H3> 9.3.3 Modifiers </H3> | |
12268 | <!--docid::SEC125::--> | |
12269 | <P> | |
12270 | ||
12271 | After the optional word designator, you can add a sequence of one or more | |
12272 | of the following modifiers, each preceded by a <SAMP>`:'</SAMP>. | |
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 | |
12287 | the 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>, | |
12304 | but 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 | |
12309 | event line. Any delimiter may be used in place of <SAMP>`/'</SAMP>. | |
12310 | The delimiter may be quoted in <VAR>old</VAR> and <VAR>new</VAR> | |
12311 | with a single backslash. If <SAMP>`&'</SAMP> appears in <VAR>new</VAR>, | |
12312 | it is replaced by <VAR>old</VAR>. A single backslash will quote | |
12313 | the <SAMP>`&'</SAMP>. The final delimiter is optional if it is the last | |
12314 | character on the input line. | |
12315 | <P> | |
12316 | ||
12317 | <DT><CODE>&</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 | |
12324 | conjunction with <SAMP>`s'</SAMP>, as in <CODE>gs/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>, | |
12325 | or with <SAMP>`&'</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"> < </A>]</TD> | |
12340 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> > </A>]</TD> | |
12341 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> << </A>]</TD> | |
12342 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
12343 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12344 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12345 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12346 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12347 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12348 | </TR></TABLE> | |
12349 | <H1> 10. Installing Bash </H1> | |
12350 | <!--docid::SEC126::--> | |
12351 | <P> | |
12352 | ||
12353 | This chapter provides basic instructions for installing Bash on | |
12354 | the various supported platforms. The distribution supports the | |
12355 | GNU operating systems, nearly every version of Unix, and several | |
12356 | non-Unix systems such as BeOS and Interix. | |
12357 | Other independent ports exist for | |
12358 | MS-DOS, OS/2, and Windows platforms. | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Installation instructions.</TD></TR> | |
12363 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC128">10.2 Compilers and Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to set special options for various | |
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> </TD><TD ALIGN="left" VALIGN="TOP">How to compile Bash for more | |
12366 | than one kind of system from | |
12367 | the same source tree.</TD></TR> | |
12368 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC130">10.4 Installation Names</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to set the various paths used by the installation.</TD></TR> | |
12369 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC131">10.5 Specifying the System Type</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to configure Bash for a particular system.</TD></TR> | |
12370 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC132">10.6 Sharing Defaults</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to share default configuration values among GNU | |
12371 | programs.</TD></TR> | |
12372 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC133">10.7 Operation Controls</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Options recognized by the configuration program.</TD></TR> | |
12373 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC134">10.8 Optional Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to enable and disable optional features when | |
12374 | building Bash.</TD></TR> | |
12375 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
12383 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> > </A>]</TD> | |
12384 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD> | |
12385 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12386 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12387 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12388 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12389 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12390 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12391 | </TR></TABLE> | |
12392 | <H2> 10.1 Basic Installation </H2> | |
12393 | <!--docid::SEC127::--> | |
12394 | <P> | |
12395 | ||
12396 | These are installation instructions for Bash. | |
12397 | </P><P> | |
12398 | ||
12399 | The 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 | |
12406 | using <CODE>csh</CODE> on an old version of System V, you might need to | |
12407 | type <SAMP>`sh ./configure'</SAMP> instead to prevent <CODE>csh</CODE> from trying | |
12408 | to execute <CODE>configure</CODE> itself. | |
12409 | <P> | |
12410 | ||
12411 | Running <CODE>configure</CODE> takes some time. | |
12412 | While running, it prints messages telling which features it is | |
12413 | checking for. | |
12414 | </P><P> | |
12415 | ||
12416 | <LI> | |
12417 | Type <SAMP>`make'</SAMP> to compile Bash and build the <CODE>bashbug</CODE> bug | |
12418 | reporting script. | |
12419 | <P> | |
12420 | ||
12421 | <LI> | |
12422 | Optionally, type <SAMP>`make tests'</SAMP> to run the Bash test suite. | |
12423 | <P> | |
12424 | ||
12425 | <LI> | |
12426 | Type <SAMP>`make install'</SAMP> to install <CODE>bash</CODE> and <CODE>bashbug</CODE>. | |
12427 | This will also install the manual pages and Info file. | |
12428 | <P> | |
12429 | ||
12430 | </OL> | |
12431 | <P> | |
12432 | ||
12433 | The <CODE>configure</CODE> shell script attempts to guess correct | |
12434 | values for various system-dependent variables used during | |
12435 | compilation. It uses those values to create a <TT>`Makefile'</TT> in | |
12436 | each directory of the package (the top directory, the | |
12437 | <TT>`builtins'</TT>, <TT>`doc'</TT>, and <TT>`support'</TT> directories, | |
12438 | each directory under <TT>`lib'</TT>, and several others). It also creates a | |
12439 | <TT>`config.h'</TT> file containing system-dependent definitions. | |
12440 | Finally, it creates a shell script named <CODE>config.status</CODE> that you | |
12441 | can run in the future to recreate the current configuration, a | |
12442 | file <TT>`config.cache'</TT> that saves the results of its tests to | |
12443 | speed up reconfiguring, and a file <TT>`config.log'</TT> containing | |
12444 | compiler output (useful mainly for debugging <CODE>configure</CODE>). | |
12445 | If at some point | |
12446 | <TT>`config.cache'</TT> contains results you don't want to keep, you | |
12447 | may remove or edit it. | |
12448 | </P><P> | |
12449 | ||
12450 | To 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> </td><td class=example><pre>bash-2.04$ ./configure --help | |
12455 | </pre></td></tr></table></P><P> | |
12456 | ||
12457 | at the Bash prompt in your Bash source directory. | |
12458 | </P><P> | |
12459 | ||
12460 | If you need to do unusual things to compile Bash, please | |
12461 | try to figure out how <CODE>configure</CODE> could check whether or not | |
12462 | to do them, and mail diffs or instructions to | |
12463 | <A HREF="mailto:bash-maintainers@gnu.org">bash-maintainers@gnu.org</A> so they can be | |
12464 | considered for the next release. | |
12465 | </P><P> | |
12466 | ||
12467 | The file <TT>`configure.in'</TT> is used to create <CODE>configure</CODE> | |
12468 | by a program called Autoconf. You only need | |
12469 | <TT>`configure.in'</TT> if you want to change it or regenerate | |
12470 | <CODE>configure</CODE> using a newer version of Autoconf. If | |
12471 | you do this, make sure you are using Autoconf version 2.50 or | |
12472 | newer. | |
12473 | </P><P> | |
12474 | ||
12475 | You can remove the program binaries and object files from the | |
12476 | source code directory by typing <SAMP>`make clean'</SAMP>. To also remove the | |
12477 | files that <CODE>configure</CODE> created (so you can compile Bash for | |
12478 | a different kind of computer), type <SAMP>`make distclean'</SAMP>. | |
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"> < </A>]</TD> | |
12486 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> > </A>]</TD> | |
12487 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> << </A>]</TD> | |
12488 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12489 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12490 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12491 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12492 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12493 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12494 | </TR></TABLE> | |
12495 | <H2> 10.2 Compilers and Options </H2> | |
12496 | <!--docid::SEC128::--> | |
12497 | <P> | |
12498 | ||
12499 | Some systems require unusual options for compilation or linking | |
12500 | that the <CODE>configure</CODE> script does not know about. You can | |
12501 | give <CODE>configure</CODE> initial values for variables by setting | |
12502 | them in the environment. Using a Bourne-compatible shell, you | |
12503 | can do that on the command line like this: | |
12504 | </P><P> | |
12505 | ||
12506 | <TABLE><tr><td> </td><td class=example><pre>CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure | |
12507 | </pre></td></tr></table></P><P> | |
12508 | ||
12509 | On systems that have the <CODE>env</CODE> program, you can do it like this: | |
12510 | </P><P> | |
12511 | ||
12512 | <TABLE><tr><td> </td><td class=example><pre>env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure | |
12513 | </pre></td></tr></table></P><P> | |
12514 | ||
12515 | The configuration process uses GCC to build Bash if it | |
12516 | is 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"> < </A>]</TD> | |
12524 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> > </A>]</TD> | |
12525 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> << </A>]</TD> | |
12526 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12527 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12528 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12529 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12530 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12531 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12532 | </TR></TABLE> | |
12533 | <H2> 10.3 Compiling For Multiple Architectures </H2> | |
12534 | <!--docid::SEC129::--> | |
12535 | <P> | |
12536 | ||
12537 | You can compile Bash for more than one kind of computer at the | |
12538 | same time, by placing the object files for each architecture in their | |
12539 | own directory. To do this, you must use a version of <CODE>make</CODE> that | |
12540 | supports the <CODE>VPATH</CODE> variable, such as GNU <CODE>make</CODE>. | |
12541 | <CODE>cd</CODE> to the | |
12542 | directory where you want the object files and executables to go and run | |
12543 | the <CODE>configure</CODE> script from the source directory. You may need to | |
12544 | supply the <SAMP>`--srcdir=PATH'</SAMP> argument to tell <CODE>configure</CODE> where the | |
12545 | source files are. <CODE>configure</CODE> automatically checks for the | |
12546 | source code in the directory that <CODE>configure</CODE> is in and in `..'. | |
12547 | </P><P> | |
12548 | ||
12549 | If you have to use a <CODE>make</CODE> that does not supports the <CODE>VPATH</CODE> | |
12550 | variable, you can compile Bash for one architecture at a | |
12551 | time in the source code directory. After you have installed | |
12552 | Bash for one architecture, use <SAMP>`make distclean'</SAMP> before | |
12553 | reconfiguring for another architecture. | |
12554 | </P><P> | |
12555 | ||
12556 | Alternatively, if your system supports symbolic links, you can use the | |
12557 | <TT>`support/mkclone'</TT> script to create a build tree which has | |
12558 | symbolic links back to each file in the source directory. Here's an | |
12559 | example that creates a build directory in the current directory from a | |
12560 | source directory <TT>`/usr/gnu/src/bash-2.0'</TT>: | |
12561 | </P><P> | |
12562 | ||
12563 | <TABLE><tr><td> </td><td class=example><pre>bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . | |
12564 | </pre></td></tr></table></P><P> | |
12565 | ||
12566 | The <CODE>mkclone</CODE> script requires Bash, so you must have already built | |
12567 | Bash for at least one architecture before you can create build | |
12568 | directories for other architectures. | |
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"> < </A>]</TD> | |
12576 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> > </A>]</TD> | |
12577 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> << </A>]</TD> | |
12578 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12579 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12580 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12581 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12582 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12583 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12584 | </TR></TABLE> | |
12585 | <H2> 10.4 Installation Names </H2> | |
12586 | <!--docid::SEC130::--> | |
12587 | <P> | |
12588 | ||
12589 | By default, <SAMP>`make install'</SAMP> will install into | |
12590 | <TT>`/usr/local/bin'</TT>, <TT>`/usr/local/man'</TT>, etc. You can | |
12591 | specify an installation prefix other than <TT>`/usr/local'</TT> by | |
12592 | giving <CODE>configure</CODE> the option <SAMP>`--prefix=<VAR>PATH</VAR>'</SAMP>, | |
12593 | or by specifying a value for the <CODE>DESTDIR</CODE> <SAMP>`make'</SAMP> | |
12594 | variable when running <SAMP>`make install'</SAMP>. | |
12595 | </P><P> | |
12596 | ||
12597 | You can specify separate installation prefixes for | |
12598 | architecture-specific files and architecture-independent files. | |
12599 | If you give <CODE>configure</CODE> the option | |
12600 | <SAMP>`--exec-prefix=<VAR>PATH</VAR>'</SAMP>, <SAMP>`make install'</SAMP> will use | |
12601 | <VAR>PATH</VAR> as the prefix for installing programs and libraries. | |
12602 | Documentation and other data files will still use the regular prefix. | |
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"> < </A>]</TD> | |
12610 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> > </A>]</TD> | |
12611 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> << </A>]</TD> | |
12612 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12613 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12614 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12615 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12616 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12617 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12618 | </TR></TABLE> | |
12619 | <H2> 10.5 Specifying the System Type </H2> | |
12620 | <!--docid::SEC131::--> | |
12621 | <P> | |
12622 | ||
12623 | There may be some features <CODE>configure</CODE> can not figure out | |
12624 | automatically, but need to determine by the type of host Bash | |
12625 | will run on. Usually <CODE>configure</CODE> can figure that | |
12626 | out, but if it prints a message saying it can not guess the host | |
12627 | type, give it the <SAMP>`--host=TYPE'</SAMP> option. <SAMP>`TYPE'</SAMP> can | |
12628 | either be a short name for the system type, such as <SAMP>`sun4'</SAMP>, | |
12629 | or a canonical name with three fields: <SAMP>`CPU-COMPANY-SYSTEM'</SAMP> | |
12630 | (e.g., <SAMP>`i386-unknown-freebsd4.2'</SAMP>). | |
12631 | </P><P> | |
12632 | ||
12633 | See the file <TT>`support/config.sub'</TT> for the possible | |
12634 | values 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"> < </A>]</TD> | |
12642 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> > </A>]</TD> | |
12643 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> << </A>]</TD> | |
12644 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12645 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12646 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12647 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12648 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12649 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12650 | </TR></TABLE> | |
12651 | <H2> 10.6 Sharing Defaults </H2> | |
12652 | <!--docid::SEC132::--> | |
12653 | <P> | |
12654 | ||
12655 | If you want to set default values for <CODE>configure</CODE> scripts to | |
12656 | share, you can create a site shell script called | |
12657 | <CODE>config.site</CODE> that gives default values for variables like | |
12658 | <CODE>CC</CODE>, <CODE>cache_file</CODE>, and <CODE>prefix</CODE>. <CODE>configure</CODE> | |
12659 | looks for <TT>`PREFIX/share/config.site'</TT> if it exists, then | |
12660 | <TT>`PREFIX/etc/config.site'</TT> if it exists. Or, you can set the | |
12661 | <CODE>CONFIG_SITE</CODE> environment variable to the location of the site | |
12662 | script. A warning: the Bash <CODE>configure</CODE> looks for a site script, | |
12663 | but not all <CODE>configure</CODE> scripts do. | |
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"> < </A>]</TD> | |
12671 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> > </A>]</TD> | |
12672 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> << </A>]</TD> | |
12673 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12674 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12675 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12676 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12677 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12678 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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 | |
12685 | operates. | |
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> | |
12714 | script, and exit. | |
12715 | </DL> | |
12716 | <P> | |
12717 | ||
12718 | <CODE>configure</CODE> also accepts some other, not widely used, boilerplate | |
12719 | options. <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"> < </A>]</TD> | |
12727 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> > </A>]</TD> | |
12728 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD> | |
12729 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12730 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12731 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12732 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12733 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12734 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12735 | </TR></TABLE> | |
12736 | <H2> 10.8 Optional Features </H2> | |
12737 | <!--docid::SEC134::--> | |
12738 | <P> | |
12739 | ||
12740 | The Bash <CODE>configure</CODE> has a number of <SAMP>`--enable-<VAR>feature</VAR>'</SAMP> | |
12741 | options, where <VAR>feature</VAR> indicates an optional part of Bash. | |
12742 | There are also several <SAMP>`--with-<VAR>package</VAR>'</SAMP> options, | |
12743 | where <VAR>package</VAR> is something like <SAMP>`bash-malloc'</SAMP> or <SAMP>`purify'</SAMP>. | |
12744 | To turn off the default use of a package, use | |
12745 | <SAMP>`--without-<VAR>package</VAR>'</SAMP>. To configure Bash without a feature | |
12746 | that is enabled by default, use <SAMP>`--disable-<VAR>feature</VAR>'</SAMP>. | |
12747 | </P><P> | |
12748 | ||
12749 | Here 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 | |
12762 | originally derived from the 4.2 BSD <CODE>malloc</CODE>. This <CODE>malloc</CODE> | |
12763 | is very fast, but wastes some space on each allocation. | |
12764 | This option is enabled by default. | |
12765 | The <TT>`NOTES'</TT> file contains a list of systems for | |
12766 | which this should be turned off, and <CODE>configure</CODE> disables this | |
12767 | option automatically for a number of systems. | |
12768 | <P> | |
12769 | ||
12770 | <DT><CODE>--with-curses</CODE> | |
12771 | <DD>Use the curses library instead of the termcap library. This should | |
12772 | be supplied if your system has an inadequate or incomplete termcap | |
12773 | database. | |
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 | |
12782 | rather than the version in <TT>`lib/readline'</TT>. This works only with | |
12783 | Readline 5.0 and later versions. If <VAR>PREFIX</VAR> is <CODE>yes</CODE> or not | |
12784 | supplied, <CODE>configure</CODE> uses the values of the make variables | |
12785 | <CODE>includedir</CODE> and <CODE>libdir</CODE>, which are subdirectories of <CODE>prefix</CODE> | |
12786 | by default, to find the installed version of Readline if it is not in | |
12787 | the standard system include and library directories. | |
12788 | If <VAR>PREFIX</VAR> is <CODE>no</CODE>, Bash links with the version in | |
12789 | <TT>`lib/readline'</TT>. | |
12790 | If <VAR>PREFIX</VAR> is set to any other value, <CODE>configure</CODE> treats it as | |
12791 | a directory pathname and looks for | |
12792 | the installed version of Readline in subdirectories of that directory | |
12793 | (include files in <VAR>PREFIX</VAR>/<CODE>include</CODE> and the library in | |
12794 | <VAR>PREFIX</VAR>/<CODE>lib</CODE>). | |
12795 | <P> | |
12796 | ||
12797 | <DT><CODE>--with-purify</CODE> | |
12798 | <DD>Define this to use the Purify memory allocation checker from Rational | |
12799 | Software. | |
12800 | <P> | |
12801 | ||
12802 | <DT><CODE>--enable-minimal-config</CODE> | |
12803 | <DD>This produces a shell with minimal features, close to the historical | |
12804 | Bourne shell. | |
12805 | </DL> | |
12806 | <P> | |
12807 | ||
12808 | There are several <SAMP>`--enable-'</SAMP> options that alter how Bash is | |
12809 | compiled 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 | |
12815 | to build programs which can access large files. This is enabled by | |
12816 | default, 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 | |
12821 | processed 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. | |
12826 | This could be used to build a version to use as root's shell. | |
12827 | </DL> | |
12828 | <P> | |
12829 | ||
12830 | The <SAMP>`minimal-config'</SAMP> option can be used to disable all of | |
12831 | the following options, but it is processed first, so individual | |
12832 | options may be enabled using <SAMP>`enable-<VAR>feature</VAR>'</SAMP>. | |
12833 | </P><P> | |
12834 | ||
12835 | All of the following options except for <SAMP>`disabled-builtins'</SAMP> and | |
12836 | <SAMP>`xpg-echo-default'</SAMP> are | |
12837 | enabled by default, unless the operating system does not provide the | |
12838 | necessary 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> | |
12844 | builtins (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 | |
12849 | that behaves like the C language <CODE>for</CODE> statement | |
12850 | (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>). | |
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> ). | |
12866 | See <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 | |
12871 | and assignment statements. Variables with the <VAR>uppercase</VAR> attribute, | |
12872 | for 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 | |
12881 | displaying timing statistics for the pipeline following <CODE>time</CODE> | |
12882 | (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). | |
12883 | This allows pipelines as well as shell builtins and functions to be timed. | |
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> | |
12914 | even after <CODE>xxx</CODE> has been disabled using <SAMP>`enable -n xxx'</SAMP>. | |
12915 | See <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for details of the <CODE>builtin</CODE> and | |
12916 | <CODE>enable</CODE> builtin commands. | |
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 | |
12926 | above 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 | |
12931 | above 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 | |
12936 | variables (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> | |
12941 | builtin 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>), | |
12946 | if 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 | |
12951 | system 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> | |
12958 | when 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 | |
12963 | the 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>). | |
12969 | If 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 | |
12974 | in the <CODE>$PS1</CODE>, <CODE>$PS2</CODE>, <CODE>$PS3</CODE>, and <CODE>$PS4</CODE> prompt | |
12975 | strings. See <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for a complete list of prompt | |
12976 | string escape sequences. | |
12977 | <P> | |
12978 | ||
12979 | <DT><CODE>--enable-readline</CODE> | |
12980 | <DD>Include support for command-line editing and history with the Bash | |
12981 | version of the Readline library (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>). | |
12982 | <P> | |
12983 | ||
12984 | <DT><CODE>--enable-restricted</CODE> | |
12985 | <DD>Include support for a <EM>restricted shell</EM>. If this is enabled, Bash, | |
12986 | when called as <CODE>rbash</CODE>, enters a restricted mode. See | |
12987 | <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>, for a description of restricted mode. | |
12988 | <P> | |
12989 | ||
12990 | <DT><CODE>--enable-select</CODE> | |
12991 | <DD>Include the <CODE>select</CODE> builtin, which allows the generation of simple | |
12992 | menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). | |
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 | |
12997 | instead 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 | |
13002 | each help topic. This aids in translating the text to different languages. | |
13003 | You may need to disable this if your compiler cannot handle very long string | |
13004 | literals. | |
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, | |
13017 | without requiring the <SAMP>`-e'</SAMP> option. | |
13018 | This sets the default value of the <CODE>xpg_echo</CODE> shell option to <CODE>on</CODE>, | |
13019 | which makes the Bash <CODE>echo</CODE> behave more like the version specified in | |
13020 | the Single Unix Specification, version 3. | |
13021 | See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of the escape sequences that | |
13022 | <CODE>echo</CODE> recognizes. | |
13023 | <P> | |
13024 | ||
13025 | </DL> | |
13026 | <P> | |
13027 | ||
13028 | The file <TT>`config-top.h'</TT> contains C Preprocessor | |
13029 | <SAMP>`#define'</SAMP> statements for options which are not settable from | |
13030 | <CODE>configure</CODE>. | |
13031 | Some of these are not meant to be changed; beware of the consequences if | |
13032 | you do. | |
13033 | Read the comments associated with each definition for more | |
13034 | information 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"> < </A>]</TD> | |
13042 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> > </A>]</TD> | |
13043 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD> | |
13044 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
13045 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD> | |
13046 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
13047 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
13048 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
13049 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
13050 | </TR></TABLE> | |
13051 | <H1> A. Reporting Bugs </H1> | |
13052 | <!--docid::SEC135::--> | |
13053 | <P> | |
13054 | ||
13055 | Please report all bugs you find in Bash. | |
13056 | But first, you should | |
13057 | make sure that it really is a bug, and that it appears in the latest | |
13058 | version of Bash. | |
13059 | The 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 | ||
13063 | Once you have determined that a bug actually exists, use the | |
13064 | <CODE>bashbug</CODE> command to submit a bug report. | |
13065 | If you have a fix, you are encouraged to mail that as well! | |
13066 | Suggestions and `philosophical' bug reports may be mailed | |
13067 | to <A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A> or posted to the Usenet | |
13068 | newsgroup <CODE>gnu.bash.bug</CODE>. | |
13069 | </P><P> | |
13070 | ||
13071 | All bug reports should include: | |
13072 | <UL> | |
13073 | <LI> | |
13074 | The version number of Bash. | |
13075 | <LI> | |
13076 | The hardware and operating system. | |
13077 | <LI> | |
13078 | The compiler used to compile Bash. | |
13079 | <LI> | |
13080 | A description of the bug behaviour. | |
13081 | <LI> | |
13082 | A short script or `recipe' which exercises the bug and may be used | |
13083 | to reproduce it. | |
13084 | </UL> | |
13085 | <P> | |
13086 | ||
13087 | <CODE>bashbug</CODE> inserts the first three items automatically into | |
13088 | the template it provides for filing a bug report. | |
13089 | </P><P> | |
13090 | ||
13091 | Please 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"> < </A>]</TD> | |
13100 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> > </A>]</TD> | |
13101 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> << </A>]</TD> | |
13102 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
13103 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> >> </A>]</TD> | |
13104 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
13105 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
13106 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
13107 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
13108 | </TR></TABLE> | |
13109 | <H1> B. Major Differences From The Bourne Shell </H1> | |
13110 | <!--docid::SEC136::--> | |
13111 | <P> | |
13112 | ||
13113 | Bash implements essentially the same grammar, parameter and | |
13114 | variable expansion, redirection, and quoting as the Bourne Shell. | |
13115 | Bash uses the POSIX standard as the specification of | |
13116 | how these features are to be implemented. There are some | |
13117 | differences between the traditional Bourne shell and Bash; this | |
13118 | section quickly details the differences of significance. A | |
13119 | number of these differences are explained in greater depth in | |
13120 | previous sections. | |
13121 | This section uses the version of <CODE>sh</CODE> included in SVR4.2 (the | |
13122 | last version of the historical Bourne shell) as the baseline reference. | |
13123 | </P><P> | |
13124 | ||
13125 | <UL> | |
13126 | ||
13127 | <LI> | |
13128 | Bash is POSIX-conformant, even where the POSIX specification | |
13129 | differs from traditional <CODE>sh</CODE> behavior (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>). | |
13130 | <P> | |
13131 | ||
13132 | <LI> | |
13133 | Bash has multi-character invocation options (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>). | |
13134 | <P> | |
13135 | ||
13136 | <LI> | |
13137 | Bash has command-line editing (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) and | |
13138 | the <CODE>bind</CODE> builtin. | |
13139 | <P> | |
13140 | ||
13141 | <LI> | |
13142 | Bash provides a programmable word completion mechanism | |
13143 | (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>), and builtin commands | |
13144 | <CODE>complete</CODE>, <CODE>compgen</CODE>, and <CODE>compopt</CODE>, to | |
13145 | manipulate it. | |
13146 | <P> | |
13147 | ||
13148 | <LI> | |
13149 | Bash has command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>) and the | |
13150 | <CODE>history</CODE> and <CODE>fc</CODE> builtins to manipulate it. | |
13151 | The Bash history list maintains timestamp information and uses the | |
13152 | value of the <CODE>HISTTIMEFORMAT</CODE> variable to display it. | |
13153 | <P> | |
13154 | ||
13155 | <LI> | |
13156 | Bash 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> | |
13161 | Bash has one-dimensional array variables (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), and the | |
13162 | appropriate variable expansions and assignment syntax to use them. | |
13163 | Several of the Bash builtins take options to act on arrays. | |
13164 | Bash provides a number of built-in array variables. | |
13165 | <P> | |
13166 | ||
13167 | <LI> | |
13168 | The <CODE>$'<small>...</small>'</CODE> quoting syntax, which expands ANSI-C | |
13169 | backslash-escaped characters in the text between the single quotes, | |
13170 | is supported (see section <A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>). | |
13171 | <P> | |
13172 | ||
13173 | <LI> | |
13174 | Bash supports the <CODE>$"<small>...</small>"</CODE> quoting syntax to do | |
13175 | locale-specific translation of the characters between the double | |
13176 | quotes. The <SAMP>`-D'</SAMP>, <SAMP>`--dump-strings'</SAMP>, and <SAMP>`--dump-po-strings'</SAMP> | |
13177 | invocation options list the translatable strings found in a script | |
13178 | (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>). | |
13179 | <P> | |
13180 | ||
13181 | <LI> | |
13182 | Bash implements the <CODE>!</CODE> keyword to negate the return value of | |
13183 | a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). | |
13184 | Very useful when an <CODE>if</CODE> statement needs to act only if a test fails. | |
13185 | The Bash <SAMP>`-o pipefail'</SAMP> option to <CODE>set</CODE> will cause a pipeline to | |
13186 | return a failure status if any command fails. | |
13187 | <P> | |
13188 | ||
13189 | <LI> | |
13190 | Bash has the <CODE>time</CODE> reserved word and command timing (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). | |
13191 | The display of the timing statistics may be controlled with the | |
13192 | <CODE>TIMEFORMAT</CODE> variable. | |
13193 | <P> | |
13194 | ||
13195 | <LI> | |
13196 | Bash implements the <CODE>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> ))</CODE> | |
13197 | arithmetic for command, similar to the C language (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>). | |
13198 | <P> | |
13199 | ||
13200 | <LI> | |
13201 | Bash includes the <CODE>select</CODE> compound command, which allows the | |
13202 | generation of simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). | |
13203 | <P> | |
13204 | ||
13205 | <LI> | |
13206 | Bash includes the <CODE>[[</CODE> compound command, which makes conditional | |
13207 | testing part of the shell grammar (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), including | |
13208 | optional regular expression matching. | |
13209 | <P> | |
13210 | ||
13211 | <LI> | |
13212 | Bash provides optional case-insensitive matching for the <CODE>case</CODE> and | |
13213 | <CODE>[[</CODE> constructs. | |
13214 | <P> | |
13215 | ||
13216 | <LI> | |
13217 | Bash includes brace expansion (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>) and tilde | |
13218 | expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>). | |
13219 | <P> | |
13220 | ||
13221 | <LI> | |
13222 | Bash implements command aliases and the <CODE>alias</CODE> and <CODE>unalias</CODE> | |
13223 | builtins (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>). | |
13224 | <P> | |
13225 | ||
13226 | <LI> | |
13227 | Bash provides shell arithmetic, the <CODE>((</CODE> compound command | |
13228 | (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), | |
13229 | and arithmetic expansion (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
13230 | <P> | |
13231 | ||
13232 | <LI> | |
13233 | Variables present in the shell's initial environment are automatically | |
13234 | exported to child processes. The Bourne shell does not normally do | |
13235 | this unless the variables are explicitly marked using the <CODE>export</CODE> | |
13236 | command. | |
13237 | <P> | |
13238 | ||
13239 | <LI> | |
13240 | Bash supports the <SAMP>`+='</SAMP> assignment operator, which appends to the value | |
13241 | of the variable named on the left hand side. | |
13242 | <P> | |
13243 | ||
13244 | <LI> | |
13245 | Bash includes the POSIX pattern removal <SAMP>`%'</SAMP>, <SAMP>`#'</SAMP>, <SAMP>`%%'</SAMP> | |
13246 | and <SAMP>`##'</SAMP> expansions to remove leading or trailing substrings from | |
13247 | variable values (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13248 | <P> | |
13249 | ||
13250 | <LI> | |
13251 | The expansion <CODE>${#xx}</CODE>, which returns the length of <CODE>${xx}</CODE>, | |
13252 | is supported (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13253 | <P> | |
13254 | ||
13255 | <LI> | |
13256 | The expansion <CODE>${var:</CODE><VAR>offset</VAR><CODE>[:</CODE><VAR>length</VAR><CODE>]}</CODE>, | |
13257 | which expands to the substring of <CODE>var</CODE>'s value of length | |
13258 | <VAR>length</VAR>, beginning at <VAR>offset</VAR>, is present | |
13259 | (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13260 | <P> | |
13261 | ||
13262 | <LI> | |
13263 | The expansion | |
13264 | <CODE>${var/[/]</CODE><VAR>pattern</VAR><CODE>[/</CODE><VAR>replacement</VAR><CODE>]}</CODE>, | |
13265 | which matches <VAR>pattern</VAR> and replaces it with <VAR>replacement</VAR> in | |
13266 | the value of <CODE>var</CODE>, is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13267 | <P> | |
13268 | ||
13269 | <LI> | |
13270 | The expansion <CODE>${!<VAR>prefix}*</VAR></CODE> expansion, which expands to | |
13271 | the names of all shell variables whose names begin with <VAR>prefix</VAR>, | |
13272 | is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13273 | <P> | |
13274 | ||
13275 | <LI> | |
13276 | Bash has <VAR>indirect</VAR> variable expansion using <CODE>${!word}</CODE> | |
13277 | (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13278 | <P> | |
13279 | ||
13280 | <LI> | |
13281 | Bash can expand positional parameters beyond <CODE>$9</CODE> using | |
13282 | <CODE>${<VAR>num</VAR>}</CODE>. | |
13283 | <P> | |
13284 | ||
13285 | <LI> | |
13286 | The POSIX <CODE>$()</CODE> form of command substitution | |
13287 | is implemented (see section <A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A>), | |
13288 | and preferred to the Bourne shell's <CODE>"</CODE> (which | |
13289 | is also implemented for backwards compatibility). | |
13290 | <P> | |
13291 | ||
13292 | <LI> | |
13293 | Bash has process substitution (see section <A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>). | |
13294 | <P> | |
13295 | ||
13296 | <LI> | |
13297 | Bash automatically assigns variables that provide information about the | |
13298 | current user (<CODE>UID</CODE>, <CODE>EUID</CODE>, and <CODE>GROUPS</CODE>), the current host | |
13299 | (<CODE>HOSTTYPE</CODE>, <CODE>OSTYPE</CODE>, <CODE>MACHTYPE</CODE>, and <CODE>HOSTNAME</CODE>), | |
13300 | and the instance of Bash that is running (<CODE>BASH</CODE>, | |
13301 | <CODE>BASH_VERSION</CODE>, and <CODE>BASH_VERSINFO</CODE>). See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, | |
13302 | for details. | |
13303 | <P> | |
13304 | ||
13305 | <LI> | |
13306 | The <CODE>IFS</CODE> variable is used to split only the results of expansion, | |
13307 | not all words (see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>). | |
13308 | This closes a longstanding shell security hole. | |
13309 | <P> | |
13310 | ||
13311 | <LI> | |
13312 | Bash implements the full set of POSIX filename expansion operators, | |
13313 | including <VAR>character classes</VAR>, <VAR>equivalence classes</VAR>, and | |
13314 | <VAR>collating symbols</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). | |
13315 | <P> | |
13316 | ||
13317 | <LI> | |
13318 | Bash implements extended pattern matching features when the <CODE>extglob</CODE> | |
13319 | shell option is enabled (see section <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>). | |
13320 | <P> | |
13321 | ||
13322 | <LI> | |
13323 | It is possible to have a variable and a function with the same name; | |
13324 | <CODE>sh</CODE> does not separate the two name spaces. | |
13325 | <P> | |
13326 | ||
13327 | <LI> | |
13328 | Bash functions are permitted to have local variables using the | |
13329 | <CODE>local</CODE> builtin, and thus useful recursive functions may be written | |
13330 | (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13331 | <P> | |
13332 | ||
13333 | <LI> | |
13334 | Variable assignments preceding commands affect only that command, even | |
13335 | builtins and functions (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>). | |
13336 | In <CODE>sh</CODE>, all variable assignments | |
13337 | preceding commands are global unless the command is executed from the | |
13338 | file system. | |
13339 | <P> | |
13340 | ||
13341 | <LI> | |
13342 | Bash performs filename expansion on filenames specified as operands | |
13343 | to input and output redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
13344 | <P> | |
13345 | ||
13346 | <LI> | |
13347 | Bash contains the <SAMP>`<>'</SAMP> redirection operator, allowing a file to be | |
13348 | opened for both reading and writing, and the <SAMP>`&>'</SAMP> redirection | |
13349 | operator, for directing standard output and standard error to the same | |
13350 | file (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
13351 | <P> | |
13352 | ||
13353 | <LI> | |
13354 | Bash includes the <SAMP>`<<<'</SAMP> redirection operator, allowing a string to | |
13355 | be used as the standard input to a command. | |
13356 | <P> | |
13357 | ||
13358 | <LI> | |
13359 | Bash implements the <SAMP>`[n]<&<VAR>word</VAR>'</SAMP> and <SAMP>`[n]>&<VAR>word</VAR>'</SAMP> | |
13360 | redirection operators, which move one file descriptor to another. | |
13361 | <P> | |
13362 | ||
13363 | <LI> | |
13364 | Bash treats a number of filenames specially when they are | |
13365 | used in redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
13366 | <P> | |
13367 | ||
13368 | <LI> | |
13369 | Bash can open network connections to arbitrary machines and services | |
13370 | with the redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
13371 | <P> | |
13372 | ||
13373 | <LI> | |
13374 | The <CODE>noclobber</CODE> option is available to avoid overwriting existing | |
13375 | files with output redirection (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
13376 | The <SAMP>`>|'</SAMP> redirection operator may be used to override <CODE>noclobber</CODE>. | |
13377 | <P> | |
13378 | ||
13379 | <LI> | |
13380 | The Bash <CODE>cd</CODE> and <CODE>pwd</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) | |
13381 | each take <SAMP>`-L'</SAMP> and <SAMP>`-P'</SAMP> options to switch between logical and | |
13382 | physical modes. | |
13383 | <P> | |
13384 | ||
13385 | <LI> | |
13386 | Bash allows a function to override a builtin with the same name, and provides | |
13387 | access to that builtin's functionality within the function via the | |
13388 | <CODE>builtin</CODE> and <CODE>command</CODE> builtins (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13389 | <P> | |
13390 | ||
13391 | <LI> | |
13392 | The <CODE>command</CODE> builtin allows selective disabling of functions | |
13393 | when command lookup is performed (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13394 | <P> | |
13395 | ||
13396 | <LI> | |
13397 | Individual builtins may be enabled or disabled using the <CODE>enable</CODE> | |
13398 | builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13399 | <P> | |
13400 | ||
13401 | <LI> | |
13402 | The Bash <CODE>exec</CODE> builtin takes additional options that allow users | |
13403 | to control the contents of the environment passed to the executed | |
13404 | command, and what the zeroth argument to the command is to be | |
13405 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
13406 | <P> | |
13407 | ||
13408 | <LI> | |
13409 | Shell functions may be exported to children via the environment | |
13410 | using <CODE>export -f</CODE> (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>). | |
13411 | <P> | |
13412 | ||
13413 | <LI> | |
13414 | The Bash <CODE>export</CODE>, <CODE>readonly</CODE>, and <CODE>declare</CODE> builtins can | |
13415 | take a <SAMP>`-f'</SAMP> option to act on shell functions, a <SAMP>`-p'</SAMP> option to | |
13416 | display variables with various attributes set in a format that can be | |
13417 | used as shell input, a <SAMP>`-n'</SAMP> option to remove various variable | |
13418 | attributes, and <SAMP>`name=value'</SAMP> arguments to set variable attributes | |
13419 | and values simultaneously. | |
13420 | <P> | |
13421 | ||
13422 | <LI> | |
13423 | The Bash <CODE>hash</CODE> builtin allows a name to be associated with | |
13424 | an arbitrary filename, even when that filename cannot be found by | |
13425 | searching the <CODE>$PATH</CODE>, using <SAMP>`hash -p'</SAMP> | |
13426 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
13427 | <P> | |
13428 | ||
13429 | <LI> | |
13430 | Bash includes a <CODE>help</CODE> builtin for quick reference to shell | |
13431 | facilities (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13432 | <P> | |
13433 | ||
13434 | <LI> | |
13435 | The <CODE>printf</CODE> builtin is available to display formatted output | |
13436 | (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13437 | <P> | |
13438 | ||
13439 | <LI> | |
13440 | The Bash <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>) | |
13441 | will read a line ending in <SAMP>`\'</SAMP> with | |
13442 | the <SAMP>`-r'</SAMP> option, and will use the <CODE>REPLY</CODE> variable as a | |
13443 | default if no non-option arguments are supplied. | |
13444 | The Bash <CODE>read</CODE> builtin | |
13445 | also accepts a prompt string with the <SAMP>`-p'</SAMP> option and will use | |
13446 | Readline to obtain the line when given the <SAMP>`-e'</SAMP> option. | |
13447 | The <CODE>read</CODE> builtin also has additional options to control input: | |
13448 | the <SAMP>`-s'</SAMP> option will turn off echoing of input characters as | |
13449 | they are read, the <SAMP>`-t'</SAMP> option will allow <CODE>read</CODE> to time out | |
13450 | if input does not arrive within a specified number of seconds, the | |
13451 | <SAMP>`-n'</SAMP> option will allow reading only a specified number of | |
13452 | characters rather than a full line, and the <SAMP>`-d'</SAMP> option will read | |
13453 | until a particular character rather than newline. | |
13454 | <P> | |
13455 | ||
13456 | <LI> | |
13457 | The <CODE>return</CODE> builtin may be used to abort execution of scripts | |
13458 | executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins | |
13459 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
13460 | <P> | |
13461 | ||
13462 | <LI> | |
13463 | Bash includes the <CODE>shopt</CODE> builtin, for finer control of shell | |
13464 | optional capabilities (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), and allows these options | |
13465 | to be set and unset at shell invocation (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>). | |
13466 | <P> | |
13467 | ||
13468 | <LI> | |
13469 | Bash has much more optional behavior controllable with the <CODE>set</CODE> | |
13470 | builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
13471 | <P> | |
13472 | ||
13473 | <LI> | |
13474 | The <SAMP>`-x'</SAMP> (<CODE>xtrace</CODE>) option displays commands other than | |
13475 | simple commands when performing an execution trace | |
13476 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
13477 | <P> | |
13478 | ||
13479 | <LI> | |
13480 | The <CODE>test</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) | |
13481 | is slightly different, as it implements the POSIX algorithm, | |
13482 | which specifies the behavior based on the number of arguments. | |
13483 | <P> | |
13484 | ||
13485 | <LI> | |
13486 | Bash includes the <CODE>caller</CODE> builtin, which displays the context of | |
13487 | any active subroutine call (a shell function or a script executed with | |
13488 | the <CODE>.</CODE> or <CODE>source</CODE> builtins). This supports the bash | |
13489 | debugger. | |
13490 | <P> | |
13491 | ||
13492 | <LI> | |
13493 | The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a | |
13494 | <CODE>DEBUG</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE>. | |
13495 | Commands specified with a <CODE>DEBUG</CODE> trap are executed before every | |
13496 | simple command, <CODE>for</CODE> command, <CODE>case</CODE> command, | |
13497 | <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before | |
13498 | the first command executes in a shell function. | |
13499 | The <CODE>DEBUG</CODE> trap is not inherited by shell functions unless the | |
13500 | function has been given the <CODE>trace</CODE> attribute or the | |
13501 | <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin. | |
13502 | The <CODE>extdebug</CODE> shell option has additional effects on the | |
13503 | <CODE>DEBUG</CODE> trap. | |
13504 | <P> | |
13505 | ||
13506 | The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows an | |
13507 | <CODE>ERR</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>. | |
13508 | Commands specified with an <CODE>ERR</CODE> trap are executed after a simple | |
13509 | command fails, with a few exceptions. | |
13510 | The <CODE>ERR</CODE> trap is not inherited by shell functions unless the | |
13511 | <CODE>-o errtrace</CODE> option to the <CODE>set</CODE> builtin is enabled. | |
13512 | </P><P> | |
13513 | ||
13514 | The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a | |
13515 | <CODE>RETURN</CODE> pseudo-signal specification, similar to | |
13516 | <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>. | |
13517 | Commands specified with an <CODE>RETURN</CODE> trap are executed before | |
13518 | execution resumes after a shell function or a shell script executed with | |
13519 | <CODE>.</CODE> or <CODE>source</CODE> returns. | |
13520 | The <CODE>RETURN</CODE> trap is not inherited by shell functions unless the | |
13521 | function has been given the <CODE>trace</CODE> attribute or the | |
13522 | <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin. | |
13523 | </P><P> | |
13524 | ||
13525 | <LI> | |
13526 | The Bash <CODE>type</CODE> builtin is more extensive and gives more information | |
13527 | about the names it finds (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13528 | <P> | |
13529 | ||
13530 | <LI> | |
13531 | The Bash <CODE>umask</CODE> builtin permits a <SAMP>`-p'</SAMP> option to cause | |
13532 | the output to be displayed in the form of a <CODE>umask</CODE> command | |
13533 | that may be reused as input (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
13534 | <P> | |
13535 | ||
13536 | <LI> | |
13537 | Bash implements a <CODE>csh</CODE>-like directory stack, and provides the | |
13538 | <CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins to manipulate it | |
13539 | (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>). | |
13540 | Bash also makes the directory stack visible as the value of the | |
13541 | <CODE>DIRSTACK</CODE> shell variable. | |
13542 | <P> | |
13543 | ||
13544 | <LI> | |
13545 | Bash interprets special backslash-escaped characters in the prompt | |
13546 | strings when interactive (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>). | |
13547 | <P> | |
13548 | ||
13549 | <LI> | |
13550 | The Bash restricted mode is more useful (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>); | |
13551 | the SVR4.2 shell restricted mode is too limited. | |
13552 | <P> | |
13553 | ||
13554 | <LI> | |
13555 | The <CODE>disown</CODE> builtin can remove a job from the internal shell | |
13556 | job table (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or suppress the sending | |
13557 | of <CODE>SIGHUP</CODE> to a job when the shell exits as the result of a | |
13558 | <CODE>SIGHUP</CODE>. | |
13559 | <P> | |
13560 | ||
13561 | <LI> | |
13562 | Bash includes a number of features to support a separate debugger for | |
13563 | shell scripts. | |
13564 | <P> | |
13565 | ||
13566 | <LI> | |
13567 | The 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> | |
13572 | Bash does not have the <CODE>stop</CODE> or <CODE>newgrp</CODE> builtins. | |
13573 | <P> | |
13574 | ||
13575 | <LI> | |
13576 | Bash does not use the <CODE>SHACCT</CODE> variable or perform shell accounting. | |
13577 | <P> | |
13578 | ||
13579 | <LI> | |
13580 | The 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 | ||
13587 | More 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"> < </A>]</TD> | |
13594 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> > </A>]</TD> | |
13595 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> << </A>]</TD> | |
13596 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> Up </A>]</TD> | |
13597 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> >> </A>]</TD> | |
13598 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
13599 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
13600 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
13601 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
13602 | </TR></TABLE> | |
13603 | <H2> B.1 Implementation Differences From The SVR4.2 Shell </H2> | |
13604 | <!--docid::SEC137::--> | |
13605 | <P> | |
13606 | ||
13607 | Since Bash is a completely new implementation, it does not suffer from | |
13608 | many of the limitations of the SVR4.2 shell. For instance: | |
13609 | </P><P> | |
13610 | ||
13611 | <UL> | |
13612 | ||
13613 | <LI> | |
13614 | Bash does not fork a subshell when redirecting into or out of | |
13615 | a shell control structure such as an <CODE>if</CODE> or <CODE>while</CODE> | |
13616 | statement. | |
13617 | <P> | |
13618 | ||
13619 | <LI> | |
13620 | Bash does not allow unbalanced quotes. The SVR4.2 shell will silently | |
13621 | insert a needed closing quote at <CODE>EOF</CODE> under certain circumstances. | |
13622 | This can be the cause of some hard-to-find errors. | |
13623 | <P> | |
13624 | ||
13625 | <LI> | |
13626 | The SVR4.2 shell uses a baroque memory management scheme based on | |
13627 | trapping <CODE>SIGSEGV</CODE>. If the shell is started from a process with | |
13628 | <CODE>SIGSEGV</CODE> blocked (e.g., by using the <CODE>system()</CODE> C library | |
13629 | function call), it misbehaves badly. | |
13630 | <P> | |
13631 | ||
13632 | <LI> | |
13633 | In a questionable attempt at security, the SVR4.2 shell, | |
13634 | when invoked without the <SAMP>`-p'</SAMP> option, will alter its real | |
13635 | and effective UID and GID if they are less than some | |
13636 | magic threshold value, commonly 100. | |
13637 | This can lead to unexpected results. | |
13638 | <P> | |
13639 | ||
13640 | <LI> | |
13641 | The 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> | |
13646 | The SVR4.2 shell does not allow the <CODE>IFS</CODE>, <CODE>MAILCHECK</CODE>, | |
13647 | <CODE>PATH</CODE>, <CODE>PS1</CODE>, or <CODE>PS2</CODE> variables to be unset. | |
13648 | <P> | |
13649 | ||
13650 | <LI> | |
13651 | The SVR4.2 shell treats <SAMP>`^'</SAMP> as the undocumented equivalent of | |
13652 | <SAMP>`|'</SAMP>. | |
13653 | <P> | |
13654 | ||
13655 | <LI> | |
13656 | Bash allows multiple option arguments when it is invoked (<CODE>-x -v</CODE>); | |
13657 | the SVR4.2 shell allows only one option argument (<CODE>-xv</CODE>). In | |
13658 | fact, some versions of the shell dump core if the second argument begins | |
13659 | with a <SAMP>`-'</SAMP>. | |
13660 | <P> | |
13661 | ||
13662 | <LI> | |
13663 | The SVR4.2 shell exits a script if any builtin fails; Bash exits | |
13664 | a script only if one of the POSIX special builtins fails, and | |
13665 | only for certain failures, as enumerated in the POSIX standard. | |
13666 | <P> | |
13667 | ||
13668 | <LI> | |
13669 | The 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"> < </A>]</TD> | |
13679 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> > </A>]</TD> | |
13680 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> << </A>]</TD> | |
13681 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
13682 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> >> </A>]</TD> | |
13683 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
13684 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
13685 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
13686 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </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 | |
13700 | Everyone is permitted to copy and distribute verbatim copies | |
13701 | of this license document, but changing it is not allowed. | |
13702 | </pre></td></tr></table></P><P> | |
13703 | ||
13704 | <OL> | |
13705 | <LI> | |
13706 | PREAMBLE | |
13707 | <P> | |
13708 | ||
13709 | The purpose of this License is to make a manual, textbook, or other | |
13710 | functional and useful document <EM>free</EM> in the sense of freedom: to | |
13711 | assure everyone the effective freedom to copy and redistribute it, | |
13712 | with or without modifying it, either commercially or noncommercially. | |
13713 | Secondarily, this License preserves for the author and publisher a way | |
13714 | to get credit for their work, while not being considered responsible | |
13715 | for modifications made by others. | |
13716 | </P><P> | |
13717 | ||
13718 | This License is a kind of "copyleft", which means that derivative | |
13719 | works of the document must themselves be free in the same sense. It | |
13720 | complements the GNU General Public License, which is a copyleft | |
13721 | license designed for free software. | |
13722 | </P><P> | |
13723 | ||
13724 | We have designed this License in order to use it for manuals for free | |
13725 | software, because free software needs free documentation: a free | |
13726 | program should come with manuals providing the same freedoms that the | |
13727 | software does. But this License is not limited to software manuals; | |
13728 | it can be used for any textual work, regardless of subject matter or | |
13729 | whether it is published as a printed book. We recommend this License | |
13730 | principally for works whose purpose is instruction or reference. | |
13731 | </P><P> | |
13732 | ||
13733 | <LI> | |
13734 | APPLICABILITY AND DEFINITIONS | |
13735 | <P> | |
13736 | ||
13737 | This License applies to any manual or other work, in any medium, that | |
13738 | contains a notice placed by the copyright holder saying it can be | |
13739 | distributed under the terms of this License. Such a notice grants a | |
13740 | world-wide, royalty-free license, unlimited in duration, to use that | |
13741 | work under the conditions stated herein. The "Document", below, | |
13742 | refers to any such manual or work. Any member of the public is a | |
13743 | licensee, and is addressed as "you". You accept the license if you | |
13744 | copy, modify or distribute the work in a way requiring permission | |
13745 | under copyright law. | |
13746 | </P><P> | |
13747 | ||
13748 | A "Modified Version" of the Document means any work containing the | |
13749 | Document or a portion of it, either copied verbatim, or with | |
13750 | modifications and/or translated into another language. | |
13751 | </P><P> | |
13752 | ||
13753 | A "Secondary Section" is a named appendix or a front-matter section | |
13754 | of the Document that deals exclusively with the relationship of the | |
13755 | publishers or authors of the Document to the Document's overall | |
13756 | subject (or to related matters) and contains nothing that could fall | |
13757 | directly within that overall subject. (Thus, if the Document is in | |
13758 | part a textbook of mathematics, a Secondary Section may not explain | |
13759 | any mathematics.) The relationship could be a matter of historical | |
13760 | connection with the subject or with related matters, or of legal, | |
13761 | commercial, philosophical, ethical or political position regarding | |
13762 | them. | |
13763 | </P><P> | |
13764 | ||
13765 | The "Invariant Sections" are certain Secondary Sections whose titles | |
13766 | are designated, as being those of Invariant Sections, in the notice | |
13767 | that says that the Document is released under this License. If a | |
13768 | section does not fit the above definition of Secondary then it is not | |
13769 | allowed to be designated as Invariant. The Document may contain zero | |
13770 | Invariant Sections. If the Document does not identify any Invariant | |
13771 | Sections then there are none. | |
13772 | </P><P> | |
13773 | ||
13774 | The "Cover Texts" are certain short passages of text that are listed, | |
13775 | as Front-Cover Texts or Back-Cover Texts, in the notice that says that | |
13776 | the Document is released under this License. A Front-Cover Text may | |
13777 | be at most 5 words, and a Back-Cover Text may be at most 25 words. | |
13778 | </P><P> | |
13779 | ||
13780 | A "Transparent" copy of the Document means a machine-readable copy, | |
13781 | represented in a format whose specification is available to the | |
13782 | general public, that is suitable for revising the document | |
13783 | straightforwardly with generic text editors or (for images composed of | |
13784 | pixels) generic paint programs or (for drawings) some widely available | |
13785 | drawing editor, and that is suitable for input to text formatters or | |
13786 | for automatic translation to a variety of formats suitable for input | |
13787 | to text formatters. A copy made in an otherwise Transparent file | |
13788 | format whose markup, or absence of markup, has been arranged to thwart | |
13789 | or discourage subsequent modification by readers is not Transparent. | |
13790 | An image format is not Transparent if used for any substantial amount | |
13791 | of text. A copy that is not "Transparent" is called "Opaque". | |
13792 | </P><P> | |
13793 | ||
13794 | Examples of suitable formats for Transparent copies include plain | |
13795 | ASCII without markup, Texinfo input format, LaTeX input | |
13796 | format, <FONT SIZE="-1">SGML</FONT> or <FONT SIZE="-1">XML</FONT> using a publicly available | |
13797 | <FONT SIZE="-1">DTD</FONT>, and standard-conforming simple <FONT SIZE="-1">HTML</FONT>, | |
13798 | PostScript or <FONT SIZE="-1">PDF</FONT> designed for human modification. Examples | |
13799 | of transparent image formats include <FONT SIZE="-1">PNG</FONT>, <FONT SIZE="-1">XCF</FONT> and | |
13800 | <FONT SIZE="-1">JPG</FONT>. Opaque formats include proprietary formats that can be | |
13801 | read and edited only by proprietary word processors, <FONT SIZE="-1">SGML</FONT> or | |
13802 | <FONT SIZE="-1">XML</FONT> for which the <FONT SIZE="-1">DTD</FONT> and/or processing tools are | |
13803 | not generally available, and the machine-generated <FONT SIZE="-1">HTML</FONT>, | |
13804 | PostScript or <FONT SIZE="-1">PDF</FONT> produced by some word processors for | |
13805 | output purposes only. | |
13806 | </P><P> | |
13807 | ||
13808 | The "Title Page" means, for a printed book, the title page itself, | |
13809 | plus such following pages as are needed to hold, legibly, the material | |
13810 | this License requires to appear in the title page. For works in | |
13811 | formats which do not have any title page as such, "Title Page" means | |
13812 | the text near the most prominent appearance of the work's title, | |
13813 | preceding the beginning of the body of the text. | |
13814 | </P><P> | |
13815 | ||
0001803f CR |
13816 | The "publisher" means any person or entity that distributes copies |
13817 | of the Document to the public. | |
13818 | </P><P> | |
13819 | ||
17345e5a JA |
13820 | A section "Entitled XYZ" means a named subunit of the Document whose |
13821 | title either is precisely XYZ or contains XYZ in parentheses following | |
13822 | text that translates XYZ in another language. (Here XYZ stands for a | |
13823 | specific section name mentioned below, such as "Acknowledgements", | |
13824 | "Dedications", "Endorsements", or "History".) To "Preserve the Title" | |
13825 | of such a section when you modify the Document means that it remains a | |
13826 | section "Entitled XYZ" according to this definition. | |
13827 | </P><P> | |
13828 | ||
13829 | The Document may include Warranty Disclaimers next to the notice which | |
13830 | states that this License applies to the Document. These Warranty | |
13831 | Disclaimers are considered to be included by reference in this | |
13832 | License, but only as regards disclaiming warranties: any other | |
13833 | implication that these Warranty Disclaimers may have is void and has | |
13834 | no effect on the meaning of this License. | |
13835 | </P><P> | |
13836 | ||
13837 | <LI> | |
13838 | VERBATIM COPYING | |
13839 | <P> | |
13840 | ||
13841 | You may copy and distribute the Document in any medium, either | |
13842 | commercially or noncommercially, provided that this License, the | |
13843 | copyright notices, and the license notice saying this License applies | |
13844 | to the Document are reproduced in all copies, and that you add no other | |
13845 | conditions whatsoever to those of this License. You may not use | |
13846 | technical measures to obstruct or control the reading or further | |
13847 | copying of the copies you make or distribute. However, you may accept | |
13848 | compensation in exchange for copies. If you distribute a large enough | |
13849 | number of copies you must also follow the conditions in section 3. | |
13850 | </P><P> | |
13851 | ||
13852 | You may also lend copies, under the same conditions stated above, and | |
13853 | you may publicly display copies. | |
13854 | </P><P> | |
13855 | ||
13856 | <LI> | |
13857 | COPYING IN QUANTITY | |
13858 | <P> | |
13859 | ||
13860 | If you publish printed copies (or copies in media that commonly have | |
13861 | printed covers) of the Document, numbering more than 100, and the | |
13862 | Document's license notice requires Cover Texts, you must enclose the | |
13863 | copies in covers that carry, clearly and legibly, all these Cover | |
13864 | Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on | |
13865 | the back cover. Both covers must also clearly and legibly identify | |
13866 | you as the publisher of these copies. The front cover must present | |
13867 | the full title with all words of the title equally prominent and | |
13868 | visible. You may add other material on the covers in addition. | |
13869 | Copying with changes limited to the covers, as long as they preserve | |
13870 | the title of the Document and satisfy these conditions, can be treated | |
13871 | as verbatim copying in other respects. | |
13872 | </P><P> | |
13873 | ||
13874 | If the required texts for either cover are too voluminous to fit | |
13875 | legibly, you should put the first ones listed (as many as fit | |
13876 | reasonably) on the actual cover, and continue the rest onto adjacent | |
13877 | pages. | |
13878 | </P><P> | |
13879 | ||
13880 | If you publish or distribute Opaque copies of the Document numbering | |
13881 | more than 100, you must either include a machine-readable Transparent | |
13882 | copy along with each Opaque copy, or state in or with each Opaque copy | |
13883 | a computer-network location from which the general network-using | |
13884 | public has access to download using public-standard network protocols | |
13885 | a complete Transparent copy of the Document, free of added material. | |
13886 | If you use the latter option, you must take reasonably prudent steps, | |
13887 | when you begin distribution of Opaque copies in quantity, to ensure | |
13888 | that this Transparent copy will remain thus accessible at the stated | |
13889 | location until at least one year after the last time you distribute an | |
13890 | Opaque copy (directly or through your agents or retailers) of that | |
13891 | edition to the public. | |
13892 | </P><P> | |
13893 | ||
13894 | It is requested, but not required, that you contact the authors of the | |
13895 | Document well before redistributing any large number of copies, to give | |
13896 | them a chance to provide you with an updated version of the Document. | |
13897 | </P><P> | |
13898 | ||
13899 | <LI> | |
13900 | MODIFICATIONS | |
13901 | <P> | |
13902 | ||
13903 | You may copy and distribute a Modified Version of the Document under | |
13904 | the conditions of sections 2 and 3 above, provided that you release | |
13905 | the Modified Version under precisely this License, with the Modified | |
13906 | Version filling the role of the Document, thus licensing distribution | |
13907 | and modification of the Modified Version to whoever possesses a copy | |
13908 | of it. In addition, you must do these things in the Modified Version: | |
13909 | </P><P> | |
13910 | ||
13911 | <OL> | |
13912 | <LI> | |
13913 | Use in the Title Page (and on the covers, if any) a title distinct | |
13914 | from that of the Document, and from those of previous versions | |
13915 | (which should, if there were any, be listed in the History section | |
13916 | of the Document). You may use the same title as a previous version | |
13917 | if the original publisher of that version gives permission. | |
13918 | <P> | |
13919 | ||
13920 | <LI> | |
13921 | List on the Title Page, as authors, one or more persons or entities | |
13922 | responsible for authorship of the modifications in the Modified | |
13923 | Version, together with at least five of the principal authors of the | |
13924 | Document (all of its principal authors, if it has fewer than five), | |
13925 | unless they release you from this requirement. | |
13926 | <P> | |
13927 | ||
13928 | <LI> | |
13929 | State on the Title page the name of the publisher of the | |
13930 | Modified Version, as the publisher. | |
13931 | <P> | |
13932 | ||
13933 | <LI> | |
13934 | Preserve all the copyright notices of the Document. | |
13935 | <P> | |
13936 | ||
13937 | <LI> | |
13938 | Add an appropriate copyright notice for your modifications | |
13939 | adjacent to the other copyright notices. | |
13940 | <P> | |
13941 | ||
13942 | <LI> | |
13943 | Include, immediately after the copyright notices, a license notice | |
13944 | giving the public permission to use the Modified Version under the | |
13945 | terms of this License, in the form shown in the Addendum below. | |
13946 | <P> | |
13947 | ||
13948 | <LI> | |
13949 | Preserve in that license notice the full lists of Invariant Sections | |
13950 | and required Cover Texts given in the Document's license notice. | |
13951 | <P> | |
13952 | ||
13953 | <LI> | |
13954 | Include an unaltered copy of this License. | |
13955 | <P> | |
13956 | ||
13957 | <LI> | |
13958 | Preserve the section Entitled "History", Preserve its Title, and add | |
13959 | to it an item stating at least the title, year, new authors, and | |
13960 | publisher of the Modified Version as given on the Title Page. If | |
13961 | there is no section Entitled "History" in the Document, create one | |
13962 | stating the title, year, authors, and publisher of the Document as | |
13963 | given on its Title Page, then add an item describing the Modified | |
13964 | Version as stated in the previous sentence. | |
13965 | <P> | |
13966 | ||
13967 | <LI> | |
13968 | Preserve the network location, if any, given in the Document for | |
13969 | public access to a Transparent copy of the Document, and likewise | |
13970 | the network locations given in the Document for previous versions | |
13971 | it was based on. These may be placed in the "History" section. | |
13972 | You may omit a network location for a work that was published at | |
13973 | least four years before the Document itself, or if the original | |
13974 | publisher of the version it refers to gives permission. | |
13975 | <P> | |
13976 | ||
13977 | <LI> | |
13978 | For any section Entitled "Acknowledgements" or "Dedications", Preserve | |
13979 | the Title of the section, and preserve in the section all the | |
13980 | substance and tone of each of the contributor acknowledgements and/or | |
13981 | dedications given therein. | |
13982 | <P> | |
13983 | ||
13984 | <LI> | |
13985 | Preserve all the Invariant Sections of the Document, | |
13986 | unaltered in their text and in their titles. Section numbers | |
13987 | or the equivalent are not considered part of the section titles. | |
13988 | <P> | |
13989 | ||
13990 | <LI> | |
13991 | Delete any section Entitled "Endorsements". Such a section | |
13992 | may not be included in the Modified Version. | |
13993 | <P> | |
13994 | ||
13995 | <LI> | |
13996 | Do not retitle any existing section to be Entitled "Endorsements" or | |
13997 | to conflict in title with any Invariant Section. | |
13998 | <P> | |
13999 | ||
14000 | <LI> | |
14001 | Preserve any Warranty Disclaimers. | |
14002 | </OL> | |
14003 | <P> | |
14004 | ||
14005 | If the Modified Version includes new front-matter sections or | |
14006 | appendices that qualify as Secondary Sections and contain no material | |
14007 | copied from the Document, you may at your option designate some or all | |
14008 | of these sections as invariant. To do this, add their titles to the | |
14009 | list of Invariant Sections in the Modified Version's license notice. | |
14010 | These titles must be distinct from any other section titles. | |
14011 | </P><P> | |
14012 | ||
14013 | You may add a section Entitled "Endorsements", provided it contains | |
14014 | nothing but endorsements of your Modified Version by various | |
14015 | parties--for example, statements of peer review or that the text has | |
14016 | been approved by an organization as the authoritative definition of a | |
14017 | standard. | |
14018 | </P><P> | |
14019 | ||
14020 | You may add a passage of up to five words as a Front-Cover Text, and a | |
14021 | passage of up to 25 words as a Back-Cover Text, to the end of the list | |
14022 | of Cover Texts in the Modified Version. Only one passage of | |
14023 | Front-Cover Text and one of Back-Cover Text may be added by (or | |
14024 | through arrangements made by) any one entity. If the Document already | |
14025 | includes a cover text for the same cover, previously added by you or | |
14026 | by arrangement made by the same entity you are acting on behalf of, | |
14027 | you may not add another; but you may replace the old one, on explicit | |
14028 | permission from the previous publisher that added the old one. | |
14029 | </P><P> | |
14030 | ||
14031 | The author(s) and publisher(s) of the Document do not by this License | |
14032 | give permission to use their names for publicity for or to assert or | |
14033 | imply endorsement of any Modified Version. | |
14034 | </P><P> | |
14035 | ||
14036 | <LI> | |
14037 | COMBINING DOCUMENTS | |
14038 | <P> | |
14039 | ||
14040 | You may combine the Document with other documents released under this | |
14041 | License, under the terms defined in section 4 above for modified | |
14042 | versions, provided that you include in the combination all of the | |
14043 | Invariant Sections of all of the original documents, unmodified, and | |
14044 | list them all as Invariant Sections of your combined work in its | |
14045 | license notice, and that you preserve all their Warranty Disclaimers. | |
14046 | </P><P> | |
14047 | ||
14048 | The combined work need only contain one copy of this License, and | |
14049 | multiple identical Invariant Sections may be replaced with a single | |
14050 | copy. If there are multiple Invariant Sections with the same name but | |
14051 | different contents, make the title of each such section unique by | |
14052 | adding at the end of it, in parentheses, the name of the original | |
14053 | author or publisher of that section if known, or else a unique number. | |
14054 | Make the same adjustment to the section titles in the list of | |
14055 | Invariant Sections in the license notice of the combined work. | |
14056 | </P><P> | |
14057 | ||
14058 | In the combination, you must combine any sections Entitled "History" | |
14059 | in the various original documents, forming one section Entitled | |
14060 | "History"; likewise combine any sections Entitled "Acknowledgements", | |
14061 | and any sections Entitled "Dedications". You must delete all | |
14062 | sections Entitled "Endorsements." | |
14063 | </P><P> | |
14064 | ||
14065 | <LI> | |
14066 | COLLECTIONS OF DOCUMENTS | |
14067 | <P> | |
14068 | ||
14069 | You may make a collection consisting of the Document and other documents | |
14070 | released under this License, and replace the individual copies of this | |
14071 | License in the various documents with a single copy that is included in | |
14072 | the collection, provided that you follow the rules of this License for | |
14073 | verbatim copying of each of the documents in all other respects. | |
14074 | </P><P> | |
14075 | ||
14076 | You may extract a single document from such a collection, and distribute | |
14077 | it individually under this License, provided you insert a copy of this | |
14078 | License into the extracted document, and follow this License in all | |
14079 | other respects regarding verbatim copying of that document. | |
14080 | </P><P> | |
14081 | ||
14082 | <LI> | |
14083 | AGGREGATION WITH INDEPENDENT WORKS | |
14084 | <P> | |
14085 | ||
14086 | A compilation of the Document or its derivatives with other separate | |
14087 | and independent documents or works, in or on a volume of a storage or | |
14088 | distribution medium, is called an "aggregate" if the copyright | |
14089 | resulting from the compilation is not used to limit the legal rights | |
14090 | of the compilation's users beyond what the individual works permit. | |
14091 | When the Document is included in an aggregate, this License does not | |
14092 | apply to the other works in the aggregate which are not themselves | |
14093 | derivative works of the Document. | |
14094 | </P><P> | |
14095 | ||
14096 | If the Cover Text requirement of section 3 is applicable to these | |
14097 | copies of the Document, then if the Document is less than one half of | |
14098 | the entire aggregate, the Document's Cover Texts may be placed on | |
14099 | covers that bracket the Document within the aggregate, or the | |
14100 | electronic equivalent of covers if the Document is in electronic form. | |
14101 | Otherwise they must appear on printed covers that bracket the whole | |
14102 | aggregate. | |
14103 | </P><P> | |
14104 | ||
14105 | <LI> | |
14106 | TRANSLATION | |
14107 | <P> | |
14108 | ||
14109 | Translation is considered a kind of modification, so you may | |
14110 | distribute translations of the Document under the terms of section 4. | |
14111 | Replacing Invariant Sections with translations requires special | |
14112 | permission from their copyright holders, but you may include | |
14113 | translations of some or all Invariant Sections in addition to the | |
14114 | original versions of these Invariant Sections. You may include a | |
14115 | translation of this License, and all the license notices in the | |
14116 | Document, and any Warranty Disclaimers, provided that you also include | |
14117 | the original English version of this License and the original versions | |
14118 | of those notices and disclaimers. In case of a disagreement between | |
14119 | the translation and the original version of this License or a notice | |
14120 | or disclaimer, the original version will prevail. | |
14121 | </P><P> | |
14122 | ||
14123 | If a section in the Document is Entitled "Acknowledgements", | |
14124 | "Dedications", or "History", the requirement (section 4) to Preserve | |
14125 | its Title (section 1) will typically require changing the actual | |
14126 | title. | |
14127 | </P><P> | |
14128 | ||
14129 | <LI> | |
14130 | TERMINATION | |
14131 | <P> | |
14132 | ||
0001803f CR |
14133 | You may not copy, modify, sublicense, or distribute the Document |
14134 | except as expressly provided under this License. Any attempt | |
14135 | otherwise to copy, modify, sublicense, or distribute it is void, and | |
14136 | will automatically terminate your rights under this License. | |
14137 | </P><P> | |
14138 | ||
14139 | However, if you cease all violation of this License, then your license | |
14140 | from a particular copyright holder is reinstated (a) provisionally, | |
14141 | unless and until the copyright holder explicitly and finally | |
14142 | terminates your license, and (b) permanently, if the copyright holder | |
14143 | fails to notify you of the violation by some reasonable means prior to | |
14144 | 60 days after the cessation. | |
14145 | </P><P> | |
14146 | ||
14147 | Moreover, your license from a particular copyright holder is | |
14148 | reinstated permanently if the copyright holder notifies you of the | |
14149 | violation by some reasonable means, this is the first time you have | |
14150 | received notice of violation of this License (for any work) from that | |
14151 | copyright holder, and you cure the violation prior to 30 days after | |
14152 | your receipt of the notice. | |
14153 | </P><P> | |
14154 | ||
14155 | Termination of your rights under this section does not terminate the | |
14156 | licenses of parties who have received copies or rights from you under | |
14157 | this License. If your rights have been terminated and not permanently | |
14158 | reinstated, receipt of a copy of some or all of the same material does | |
14159 | not give you any rights to use it. | |
17345e5a JA |
14160 | </P><P> |
14161 | ||
14162 | <LI> | |
14163 | FUTURE REVISIONS OF THIS LICENSE | |
14164 | <P> | |
14165 | ||
14166 | The Free Software Foundation may publish new, revised versions | |
14167 | of the GNU Free Documentation License from time to time. Such new | |
14168 | versions will be similar in spirit to the present version, but may | |
14169 | differ in detail to address new problems or concerns. See | |
14170 | <A HREF="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</A>. | |
14171 | </P><P> | |
14172 | ||
14173 | Each version of the License is given a distinguishing version number. | |
14174 | If the Document specifies that a particular numbered version of this | |
14175 | License "or any later version" applies to it, you have the option of | |
14176 | following the terms and conditions either of that specified version or | |
14177 | of any later version that has been published (not as a draft) by the | |
14178 | Free Software Foundation. If the Document does not specify a version | |
14179 | number of this License, you may choose any version ever published (not | |
0001803f CR |
14180 | as a draft) by the Free Software Foundation. If the Document |
14181 | specifies that a proxy can decide which future versions of this | |
14182 | License can be used, that proxy's public statement of acceptance of a | |
14183 | version permanently authorizes you to choose that version for the | |
14184 | Document. | |
14185 | </P><P> | |
14186 | ||
14187 | <LI> | |
14188 | RELICENSING | |
14189 | <P> | |
14190 | ||
14191 | "Massive Multiauthor Collaboration Site" (or "MMC Site") means any | |
14192 | World Wide Web server that publishes copyrightable works and also | |
14193 | provides prominent facilities for anybody to edit those works. A | |
14194 | public wiki that anybody can edit is an example of such a server. A | |
14195 | "Massive Multiauthor Collaboration" (or "MMC") contained in the | |
14196 | site means any set of copyrightable works thus published on the MMC | |
14197 | site. | |
14198 | </P><P> | |
14199 | ||
14200 | "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 | |
14201 | license published by Creative Commons Corporation, a not-for-profit | |
14202 | corporation with a principal place of business in San Francisco, | |
14203 | California, as well as future copyleft versions of that license | |
14204 | published by that same organization. | |
14205 | </P><P> | |
14206 | ||
14207 | "Incorporate" means to publish or republish a Document, in whole or | |
14208 | in part, as part of another Document. | |
14209 | </P><P> | |
14210 | ||
14211 | An MMC is "eligible for relicensing" if it is licensed under this | |
14212 | License, and if all works that were first published under this License | |
14213 | somewhere other than this MMC, and subsequently incorporated in whole | |
14214 | or in part into the MMC, (1) had no cover texts or invariant sections, | |
14215 | and (2) were thus incorporated prior to November 1, 2008. | |
14216 | </P><P> | |
14217 | ||
14218 | The operator of an MMC Site may republish an MMC contained in the site | |
14219 | under CC-BY-SA on the same site at any time before August 1, 2009, | |
14220 | provided the MMC is eligible for relicensing. | |
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 | ||
14231 | To use this License in a document you have written, include a copy of | |
14232 | the License in the document and put the following copyright and | |
14233 | license notices just after the title page: | |
14234 | </P><P> | |
14235 | ||
14236 | <TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> Copyright (C) <VAR>year</VAR> <VAR>your name</VAR>. | |
14237 | Permission is granted to copy, distribute and/or modify this document | |
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 | ||
14245 | If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, | |
14246 | replace the "with<small>...</small>Texts." line with this: | |
14247 | </P><P> | |
14248 | ||
14249 | <TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> with the Invariant Sections being <VAR>list their titles</VAR>, with | |
14250 | the Front-Cover Texts being <VAR>list</VAR>, and with the Back-Cover Texts | |
14251 | being <VAR>list</VAR>. | |
14252 | </FONT></pre></td></tr></table></P><P> | |
14253 | ||
14254 | If you have Invariant Sections without Cover Texts, or some other | |
14255 | combination of the three, merge those two alternatives to suit the | |
14256 | situation. | |
14257 | </P><P> | |
14258 | ||
14259 | If your document contains nontrivial examples of program code, we | |
14260 | recommend releasing these examples in parallel under your choice of | |
14261 | free software license, such as the GNU General Public License, | |
14262 | to permit their use in free software. | |
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"> < </A>]</TD> | |
14270 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> > </A>]</TD> | |
14271 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
14272 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
14273 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
14274 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
14275 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
14276 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
14277 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
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> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash builtin commands.</TD></TR> | |
14285 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC142">D.2 Index of Shell Reserved Words</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash reserved words.</TD></TR> | |
14286 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC143">D.3 Parameter and Variable Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Quick reference helps you find the | |
14287 | variable you want.</TD></TR> | |
14288 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC144">D.4 Function Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of bindable Readline functions.</TD></TR> | |
14289 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC145">D.5 Concept Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">General index for concepts described in | |
14290 | this manual.</TD></TR> | |
14291 | </TABLE></BLOCKQUOTE> | |
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"> < </A>]</TD> | |
14299 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> > </A>]</TD> | |
14300 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
14301 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
14302 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
14303 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
14304 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
14305 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
14306 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
14307 | </TR></TABLE> | |
14308 | <H2> D.1 Index of Shell Builtin Commands </H2> | |
14309 | <!--docid::SEC141::--> | |
14310 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A> | |
14311 | | |
14312 | <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A> | |
14313 | | |
14314 | <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A> | |
14315 | | |
14316 | <BR> | |
14317 | <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A> | |
14318 | | |
14319 | <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A> | |
14320 | | |
14321 | <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A> | |
14322 | | |
14323 | <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A> | |
14324 | | |
14325 | <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A> | |
14326 | | |
14327 | <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A> | |
14328 | | |
14329 | <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A> | |
14330 | | |
14331 | <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A> | |
14332 | | |
14333 | <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A> | |
14334 | | |
14335 | <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A> | |
14336 | | |
14337 | <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A> | |
14338 | | |
14339 | <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A> | |
14340 | | |
14341 | <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A> | |
14342 | | |
14343 | <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A> | |
14344 | | |
14345 | <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A> | |
14346 | | |
14347 | <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A> | |
14348 | | |
14349 | <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A> | |
14350 | | |
14351 | <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A> | |
14352 | | |
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: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A> | |
14459 | | |
14460 | <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A> | |
14461 | | |
14462 | <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A> | |
14463 | | |
14464 | <BR> | |
14465 | <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A> | |
14466 | | |
14467 | <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A> | |
14468 | | |
14469 | <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A> | |
14470 | | |
14471 | <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A> | |
14472 | | |
14473 | <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A> | |
14474 | | |
14475 | <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A> | |
14476 | | |
14477 | <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A> | |
14478 | | |
14479 | <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A> | |
14480 | | |
14481 | <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A> | |
14482 | | |
14483 | <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A> | |
14484 | | |
14485 | <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A> | |
14486 | | |
14487 | <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A> | |
14488 | | |
14489 | <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A> | |
14490 | | |
14491 | <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A> | |
14492 | | |
14493 | <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A> | |
14494 | | |
14495 | <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A> | |
14496 | | |
14497 | <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A> | |
14498 | | |
14499 | <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A> | |
14500 | | |
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"> < </A>]</TD> | |
14508 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> > </A>]</TD> | |
14509 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> << </A>]</TD> | |
14510 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
14511 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
14512 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
14513 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
14514 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
14515 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
14516 | </TR></TABLE> | |
14517 | <H2> D.2 Index of Shell Reserved Words </H2> | |
14518 | <!--docid::SEC142::--> | |
14519 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A> | |
14520 | | |
14521 | <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A> | |
14522 | | |
14523 | <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A> | |
14524 | | |
14525 | <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A> | |
14526 | | |
14527 | <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A> | |
14528 | | |
14529 | <BR> | |
14530 | <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A> | |
14531 | | |
14532 | <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A> | |
14533 | | |
14534 | <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A> | |
14535 | | |
14536 | <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A> | |
14537 | | |
14538 | <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A> | |
14539 | | |
14540 | <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A> | |
14541 | | |
14542 | <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A> | |
14543 | | |
14544 | <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A> | |
14545 | | |
14546 | <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A> | |
14547 | | |
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: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A> | |
14602 | | |
14603 | <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A> | |
14604 | | |
14605 | <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A> | |
14606 | | |
14607 | <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A> | |
14608 | | |
14609 | <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A> | |
14610 | | |
14611 | <BR> | |
14612 | <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A> | |
14613 | | |
14614 | <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A> | |
14615 | | |
14616 | <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A> | |
14617 | | |
14618 | <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A> | |
14619 | | |
14620 | <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A> | |
14621 | | |
14622 | <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A> | |
14623 | | |
14624 | <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A> | |
14625 | | |
14626 | <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A> | |
14627 | | |
14628 | <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A> | |
14629 | | |
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"> < </A>]</TD> | |
14637 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> > </A>]</TD> | |
14638 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> << </A>]</TD> | |
14639 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
14640 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
14641 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
14642 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
14643 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
14644 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
14645 | </TR></TABLE> | |
14646 | <H2> D.3 Parameter and Variable Index </H2> | |
14647 | <!--docid::SEC143::--> | |
14648 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A> | |
14649 | | |
14650 | <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A> | |
14651 | | |
14652 | <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A> | |
14653 | | |
14654 | <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A> | |
14655 | | |
14656 | <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A> | |
14657 | | |
14658 | <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A> | |
14659 | | |
14660 | <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A> | |
14661 | | |
14662 | <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A> | |
14663 | | |
14664 | <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A> | |
14665 | | |
14666 | <BR> | |
14667 | <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A> | |
14668 | | |
14669 | <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A> | |
14670 | | |
14671 | <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A> | |
14672 | | |
14673 | <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A> | |
14674 | | |
14675 | <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A> | |
14676 | | |
14677 | <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A> | |
14678 | | |
14679 | <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A> | |
14680 | | |
14681 | <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A> | |
14682 | | |
14683 | <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A> | |
14684 | | |
14685 | <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A> | |
14686 | | |
14687 | <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A> | |
14688 | | |
14689 | <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A> | |
14690 | | |
14691 | <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A> | |
14692 | | |
14693 | <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A> | |
14694 | | |
14695 | <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A> | |
14696 | | |
14697 | <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A> | |
14698 | | |
14699 | <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A> | |
14700 | | |
14701 | <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A> | |
14702 | | |
14703 | <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A> | |
14704 | | |
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: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A> | |
14992 | | |
14993 | <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A> | |
14994 | | |
14995 | <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A> | |
14996 | | |
14997 | <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A> | |
14998 | | |
14999 | <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A> | |
15000 | | |
15001 | <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A> | |
15002 | | |
15003 | <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A> | |
15004 | | |
15005 | <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A> | |
15006 | | |
15007 | <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A> | |
15008 | | |
15009 | <BR> | |
15010 | <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A> | |
15011 | | |
15012 | <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A> | |
15013 | | |
15014 | <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A> | |
15015 | | |
15016 | <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A> | |
15017 | | |
15018 | <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A> | |
15019 | | |
15020 | <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A> | |
15021 | | |
15022 | <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A> | |
15023 | | |
15024 | <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A> | |
15025 | | |
15026 | <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A> | |
15027 | | |
15028 | <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A> | |
15029 | | |
15030 | <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A> | |
15031 | | |
15032 | <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A> | |
15033 | | |
15034 | <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A> | |
15035 | | |
15036 | <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A> | |
15037 | | |
15038 | <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A> | |
15039 | | |
15040 | <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A> | |
15041 | | |
15042 | <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A> | |
15043 | | |
15044 | <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A> | |
15045 | | |
15046 | <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A> | |
15047 | | |
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"> < </A>]</TD> | |
15055 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> > </A>]</TD> | |
15056 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> << </A>]</TD> | |
15057 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
15058 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
15059 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
15060 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
15061 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
15062 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
15063 | </TR></TABLE> | |
15064 | <H2> D.4 Function Index </H2> | |
15065 | <!--docid::SEC144::--> | |
15066 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A> | |
15067 | | |
15068 | <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A> | |
15069 | | |
15070 | <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A> | |
15071 | | |
15072 | <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A> | |
15073 | | |
15074 | <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A> | |
15075 | | |
15076 | <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A> | |
15077 | | |
15078 | <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A> | |
15079 | | |
15080 | <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A> | |
15081 | | |
15082 | <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A> | |
15083 | | |
15084 | <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A> | |
15085 | | |
15086 | <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A> | |
15087 | | |
15088 | <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A> | |
15089 | | |
15090 | <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A> | |
15091 | | |
15092 | <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A> | |
15093 | | |
15094 | <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A> | |
15095 | | |
15096 | <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A> | |
15097 | | |
15098 | <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A> | |
15099 | | |
15100 | <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A> | |
15101 | | |
15102 | <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A> | |
15103 | | |
15104 | <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A> | |
15105 | | |
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-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15132 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX361"><CODE>beginning-of-history (M-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15133 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX334"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15134 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX335"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
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>, <small>...</small> <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR> | |
15178 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX437"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR> | |
15179 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX522"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15180 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX523"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15181 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX488"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15182 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX489"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15183 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX396"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15184 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX397"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15185 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX510"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15186 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX511"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15187 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX514"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15188 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX515"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15189 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX512"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15190 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX513"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15191 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX472"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15192 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX473"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
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-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15200 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX363"><CODE>end-of-history (M-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15201 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX336"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15202 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX337"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15203 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX500"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15204 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX501"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
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, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> |
15308 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX389"><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15309 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX498"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15310 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX499"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15311 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX348"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15312 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX349"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15313 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX524"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15314 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX525"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15315 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX346"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15316 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX347"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15317 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX414"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15318 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX415"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15319 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX506"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15320 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX507"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15321 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX478"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR> | |
15322 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX479"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR> | |
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;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> |
15326 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX497"><CODE>tilde-expand (M-&#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15327 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX390"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15328 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX391"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15329 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX392"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15330 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX393"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
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: </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A> | |
15357 | | |
15358 | <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A> | |
15359 | | |
15360 | <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A> | |
15361 | | |
15362 | <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A> | |
15363 | | |
15364 | <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A> | |
15365 | | |
15366 | <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A> | |
15367 | | |
15368 | <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A> | |
15369 | | |
15370 | <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A> | |
15371 | | |
15372 | <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A> | |
15373 | | |
15374 | <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A> | |
15375 | | |
15376 | <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A> | |
15377 | | |
15378 | <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A> | |
15379 | | |
15380 | <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A> | |
15381 | | |
15382 | <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A> | |
15383 | | |
15384 | <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A> | |
15385 | | |
15386 | <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A> | |
15387 | | |
15388 | <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A> | |
15389 | | |
15390 | <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A> | |
15391 | | |
15392 | <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A> | |
15393 | | |
15394 | <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A> | |
15395 | | |
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"> < </A>]</TD> | |
15403 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ > ]</TD> | |
15404 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
15405 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
15406 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
15407 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
15408 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
15409 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
15410 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
15411 | </TR></TABLE> | |
15412 | <H2> D.5 Concept Index </H2> | |
15413 | <!--docid::SEC145::--> | |
15414 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A> | |
15415 | | |
15416 | <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A> | |
15417 | | |
15418 | <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A> | |
15419 | | |
15420 | <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A> | |
15421 | | |
15422 | <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A> | |
15423 | | |
15424 | <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A> | |
15425 | | |
15426 | <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A> | |
15427 | | |
15428 | <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A> | |
15429 | | |
15430 | <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A> | |
15431 | | |
15432 | <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A> | |
15433 | | |
15434 | <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A> | |
15435 | | |
15436 | <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A> | |
15437 | | |
15438 | <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A> | |
15439 | | |
15440 | <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A> | |
15441 | | |
15442 | <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A> | |
15443 | | |
15444 | <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A> | |
15445 | | |
15446 | <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A> | |
15447 | | |
15448 | <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A> | |
15449 | | |
15450 | <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A> | |
15451 | | |
15452 | <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A> | |
15453 | | |
15454 | <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A> | |
15455 | | |
15456 | <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A> | |
15457 | | |
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: </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A> | |
15625 | | |
15626 | <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A> | |
15627 | | |
15628 | <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A> | |
15629 | | |
15630 | <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A> | |
15631 | | |
15632 | <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A> | |
15633 | | |
15634 | <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A> | |
15635 | | |
15636 | <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A> | |
15637 | | |
15638 | <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A> | |
15639 | | |
15640 | <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A> | |
15641 | | |
15642 | <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A> | |
15643 | | |
15644 | <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A> | |
15645 | | |
15646 | <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A> | |
15647 | | |
15648 | <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A> | |
15649 | | |
15650 | <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A> | |
15651 | | |
15652 | <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A> | |
15653 | | |
15654 | <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A> | |
15655 | | |
15656 | <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A> | |
15657 | | |
15658 | <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A> | |
15659 | | |
15660 | <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A> | |
15661 | | |
15662 | <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A> | |
15663 | | |
15664 | <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A> | |
15665 | | |
15666 | <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A> | |
15667 | | |
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 | 16058 | This document was generated by <I>Chet Ramey</I> on <I>December, 29 2009</I> |
17345e5a JA |
16059 | using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html |
16060 | "><I>texi2html</I></A> | |
16061 | <P></P> | |
16062 | The 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 | [ < ] </TD> | |
16074 | <TD ALIGN="CENTER"> | |
16075 | Back | |
16076 | </TD> | |
16077 | <TD> | |
16078 | previous section in reading order | |
16079 | </TD> | |
16080 | <TD> | |
16081 | 1.2.2 | |
16082 | </TD> | |
16083 | </TR> | |
16084 | <TR> | |
16085 | <TD ALIGN="CENTER"> | |
16086 | [ > ] </TD> | |
16087 | <TD ALIGN="CENTER"> | |
16088 | Forward | |
16089 | </TD> | |
16090 | <TD> | |
16091 | next section in reading order | |
16092 | </TD> | |
16093 | <TD> | |
16094 | 1.2.4 | |
16095 | </TD> | |
16096 | </TR> | |
16097 | <TR> | |
16098 | <TD ALIGN="CENTER"> | |
16099 | [ << ] </TD> | |
16100 | <TD ALIGN="CENTER"> | |
16101 | FastBack | |
16102 | </TD> | |
16103 | <TD> | |
16104 | previous or up-and-previous section | |
16105 | </TD> | |
16106 | <TD> | |
16107 | 1.1 | |
16108 | </TD> | |
16109 | </TR> | |
16110 | <TR> | |
16111 | <TD ALIGN="CENTER"> | |
16112 | [ Up ] </TD> | |
16113 | <TD ALIGN="CENTER"> | |
16114 | Up | |
16115 | </TD> | |
16116 | <TD> | |
16117 | up section | |
16118 | </TD> | |
16119 | <TD> | |
16120 | 1.2 | |
16121 | </TD> | |
16122 | </TR> | |
16123 | <TR> | |
16124 | <TD ALIGN="CENTER"> | |
16125 | [ >> ] </TD> | |
16126 | <TD ALIGN="CENTER"> | |
16127 | FastForward | |
16128 | </TD> | |
16129 | <TD> | |
16130 | next or up-and-next section | |
16131 | </TD> | |
16132 | <TD> | |
16133 | 1.3 | |
16134 | </TD> | |
16135 | </TR> | |
16136 | <TR> | |
16137 | <TD ALIGN="CENTER"> | |
16138 | [Top] </TD> | |
16139 | <TD ALIGN="CENTER"> | |
16140 | Top | |
16141 | </TD> | |
16142 | <TD> | |
16143 | cover (top) of document | |
16144 | </TD> | |
16145 | <TD> | |
16146 | | |
16147 | </TD> | |
16148 | </TR> | |
16149 | <TR> | |
16150 | <TD ALIGN="CENTER"> | |
16151 | [Contents] </TD> | |
16152 | <TD ALIGN="CENTER"> | |
16153 | Contents | |
16154 | </TD> | |
16155 | <TD> | |
16156 | table of contents | |
16157 | </TD> | |
16158 | <TD> | |
16159 | | |
16160 | </TD> | |
16161 | </TR> | |
16162 | <TR> | |
16163 | <TD ALIGN="CENTER"> | |
16164 | [Index] </TD> | |
16165 | <TD ALIGN="CENTER"> | |
16166 | Index | |
16167 | </TD> | |
16168 | <TD> | |
16169 | concept index | |
16170 | </TD> | |
16171 | <TD> | |
16172 | | |
16173 | </TD> | |
16174 | </TR> | |
16175 | <TR> | |
16176 | <TD ALIGN="CENTER"> | |
16177 | [ ? ] </TD> | |
16178 | <TD ALIGN="CENTER"> | |
16179 | About | |
16180 | </TD> | |
16181 | <TD> | |
16182 | this page | |
16183 | </TD> | |
16184 | <TD> | |
16185 | | |
16186 | </TD> | |
16187 | </TR> | |
16188 | </TABLE> | |
16189 | <P></P> | |
16190 | where the <STRONG> Example </STRONG> assumes that the current position | |
16191 | is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of | |
16192 | the following structure: | |
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 <STRONG> | |
16205 | <== 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"> | |
16219 | This document was generated | |
0001803f | 16220 | by <I>Chet Ramey</I> on <I>December, 29 2009</I> |
17345e5a JA |
16221 | using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html |
16222 | "><I>texi2html</I></A> | |
16223 | ||
16224 | </BODY> | |
16225 | </HTML> |