]>
Commit | Line | Data |
---|---|---|
17345e5a JA |
1 | <HTML> |
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
3 | <!-- Created on February, 5 2009 by texi2html 1.64 --> | |
4 | <!-- | |
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 | |
36 | the Bash shell (version 4.0, 29 December 2008). | |
37 | </P><P> | |
38 | ||
39 | This is Edition 4.0, last updated 29 December 2008, | |
40 | of <CITE>The GNU Bash Reference Manual</CITE>, | |
41 | for <CODE>Bash</CODE>, Version 4.0. | |
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> | |
691 | <DD>an escape character (not ANSI C) | |
692 | <DT><CODE>\f</CODE> | |
693 | <DD>form feed | |
694 | <DT><CODE>\n</CODE> | |
695 | <DD>newline | |
696 | <DT><CODE>\r</CODE> | |
697 | <DD>carriage return | |
698 | <DT><CODE>\t</CODE> | |
699 | <DD>horizontal tab | |
700 | <DT><CODE>\v</CODE> | |
701 | <DD>vertical tab | |
702 | <DT><CODE>\\</CODE> | |
703 | <DD>backslash | |
704 | <DT><CODE>\'</CODE> | |
705 | <DD>single quote | |
706 | <DT><CODE>\<VAR>nnn</VAR></CODE> | |
707 | <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR> | |
708 | (one to three digits) | |
709 | <DT><CODE>\x<VAR>HH</VAR></CODE> | |
710 | <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR> | |
711 | (one or two hex digits) | |
712 | <DT><CODE>\c<VAR>x</VAR></CODE> | |
713 | <DD>a control-<VAR>x</VAR> character | |
714 | </DL> | |
715 | <P> | |
716 | ||
717 | The expanded result is single-quoted, as if the dollar sign had not | |
718 | been present. | |
719 | </P><P> | |
720 | ||
721 | <A NAME="Locale Translation"></A> | |
722 | <HR SIZE="6"> | |
723 | <A NAME="SEC13"></A> | |
724 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
725 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> < </A>]</TD> | |
726 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> > </A>]</TD> | |
727 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD> | |
728 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> | |
729 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> | |
730 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
731 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
732 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
733 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
734 | </TR></TABLE> | |
735 | <H4> 3.1.2.5 Locale-Specific Translation </H4> | |
736 | <!--docid::SEC13::--> | |
737 | <P> | |
738 | ||
739 | A double-quoted string preceded by a dollar sign (<SAMP>`$'</SAMP>) will cause | |
740 | the string to be translated according to the current locale. | |
741 | If the current locale is <CODE>C</CODE> or <CODE>POSIX</CODE>, the dollar sign | |
742 | is ignored. | |
743 | If the string is translated and replaced, the replacement is | |
744 | double-quoted. | |
745 | </P><P> | |
746 | ||
747 | <A NAME="IDX21"></A> | |
748 | <A NAME="IDX22"></A> | |
749 | <A NAME="IDX23"></A> | |
750 | Some systems use the message catalog selected by the <CODE>LC_MESSAGES</CODE> | |
751 | shell variable. Others create the name of the message catalog from the | |
752 | value of the <CODE>TEXTDOMAIN</CODE> shell variable, possibly adding a | |
753 | suffix of <SAMP>`.mo'</SAMP>. If you use the <CODE>TEXTDOMAIN</CODE> variable, you | |
754 | may need to set the <CODE>TEXTDOMAINDIR</CODE> variable to the location of | |
755 | the message catalog files. Still others use both variables in this | |
756 | fashion: | |
757 | <CODE>TEXTDOMAINDIR</CODE>/<CODE>LC_MESSAGES</CODE>/LC_MESSAGES/<CODE>TEXTDOMAIN</CODE>.mo. | |
758 | </P><P> | |
759 | ||
760 | <A NAME="Comments"></A> | |
761 | <HR SIZE="6"> | |
762 | <A NAME="SEC14"></A> | |
763 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
764 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> < </A>]</TD> | |
765 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> > </A>]</TD> | |
766 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> | |
767 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD> | |
768 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD> | |
769 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
770 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
771 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
772 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
773 | </TR></TABLE> | |
774 | <H3> 3.1.3 Comments </H3> | |
775 | <!--docid::SEC14::--> | |
776 | <P> | |
777 | ||
778 | In a non-interactive shell, or an interactive shell in which the | |
779 | <CODE>interactive_comments</CODE> option to the <CODE>shopt</CODE> | |
780 | builtin is enabled (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), | |
781 | a word beginning with <SAMP>`#'</SAMP> | |
782 | causes that word and all remaining characters on that line to | |
783 | be ignored. An interactive shell without the <CODE>interactive_comments</CODE> | |
784 | option enabled does not allow comments. The <CODE>interactive_comments</CODE> | |
785 | option is on by default in interactive shells. | |
786 | See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for a description of what makes | |
787 | a shell interactive. | |
788 | </P><P> | |
789 | ||
790 | <A NAME="Shell Commands"></A> | |
791 | <HR SIZE="6"> | |
792 | <A NAME="SEC15"></A> | |
793 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
794 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> < </A>]</TD> | |
795 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> > </A>]</TD> | |
796 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD> | |
797 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
798 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
799 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
800 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
801 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
802 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
803 | </TR></TABLE> | |
804 | <H2> 3.2 Shell Commands </H2> | |
805 | <!--docid::SEC15::--> | |
806 | <P> | |
807 | ||
808 | A simple shell command such as <CODE>echo a b c</CODE> consists of the command | |
809 | itself followed by arguments, separated by spaces. | |
810 | </P><P> | |
811 | ||
812 | More complex shell commands are composed of simple commands arranged together | |
813 | in a variety of ways: in a pipeline in which the output of one command | |
814 | becomes the input of a second, in a loop or conditional construct, or in | |
815 | some other grouping. | |
816 | </P><P> | |
817 | ||
818 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
819 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The most common type of command.</TD></TR> | |
820 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Connecting the input and output of several | |
821 | commands.</TD></TR> | |
822 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to execute commands sequentially.</TD></TR> | |
823 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for control flow.</TD></TR> | |
824 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Two-way communication between commands.</TD></TR> | |
825 | </TABLE></BLOCKQUOTE> | |
826 | <P> | |
827 | ||
828 | <A NAME="Simple Commands"></A> | |
829 | <HR SIZE="6"> | |
830 | <A NAME="SEC16"></A> | |
831 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
832 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> < </A>]</TD> | |
833 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> > </A>]</TD> | |
834 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD> | |
835 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
836 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
837 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
838 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
839 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
840 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
841 | </TR></TABLE> | |
842 | <H3> 3.2.1 Simple Commands </H3> | |
843 | <!--docid::SEC16::--> | |
844 | <P> | |
845 | ||
846 | A simple command is the kind of command encountered most often. | |
847 | It's just a sequence of words separated by <CODE>blank</CODE>s, terminated | |
848 | by one of the shell's control operators (see section <A HREF="bashref.html#SEC4">2. Definitions</A>). The | |
849 | first word generally specifies a command to be executed, with the | |
850 | rest of the words being that command's arguments. | |
851 | </P><P> | |
852 | ||
853 | The return status (see section <A HREF="bashref.html#SEC55">3.7.5 Exit Status</A>) of a simple command is | |
854 | its exit status as provided | |
855 | by the POSIX 1003.1 <CODE>waitpid</CODE> function, or 128+<VAR>n</VAR> if | |
856 | the command was terminated by signal <VAR>n</VAR>. | |
857 | </P><P> | |
858 | ||
859 | <A NAME="Pipelines"></A> | |
860 | <HR SIZE="6"> | |
861 | <A NAME="SEC17"></A> | |
862 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
863 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> < </A>]</TD> | |
864 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> > </A>]</TD> | |
865 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> << </A>]</TD> | |
866 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
867 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
868 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
869 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
870 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
871 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
872 | </TR></TABLE> | |
873 | <H3> 3.2.2 Pipelines </H3> | |
874 | <!--docid::SEC17::--> | |
875 | <P> | |
876 | ||
877 | A <CODE>pipeline</CODE> is a sequence of simple commands separated by one of | |
878 | the control operators <SAMP>`|'</SAMP> or <SAMP>`|&'</SAMP>. | |
879 | </P><P> | |
880 | ||
881 | <A NAME="IDX24"></A> | |
882 | <A NAME="IDX25"></A> | |
883 | <A NAME="IDX26"></A> | |
884 | The format for a pipeline is | |
885 | <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>] | |
886 | </pre></td></tr></table></P><P> | |
887 | ||
888 | The output of each command in the pipeline is connected via a pipe | |
889 | to the input of the next command. | |
890 | That is, each command reads the previous command's output. This | |
891 | connection is performed before any redirections specified by the | |
892 | command. | |
893 | </P><P> | |
894 | ||
895 | If <SAMP>`|&'</SAMP> is used, the standard error of <VAR>command1</VAR> is connected to | |
896 | <VAR>command2</VAR>'s standard input through the pipe; it is shorthand for | |
897 | <CODE>2>&1 |</CODE>. This implicit redirection of the standard error is | |
898 | performed after any redirections specified by the command. | |
899 | </P><P> | |
900 | ||
901 | The reserved word <CODE>time</CODE> causes timing statistics | |
902 | to be printed for the pipeline once it finishes. | |
903 | The statistics currently consist of elapsed (wall-clock) time and | |
904 | user and system time consumed by the command's execution. | |
905 | The <SAMP>`-p'</SAMP> option changes the output format to that specified | |
906 | by POSIX. | |
907 | The <CODE>TIMEFORMAT</CODE> variable may be set to a format string that | |
908 | specifies how the timing information should be displayed. | |
909 | See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of the available formats. | |
910 | The use of <CODE>time</CODE> as a reserved word permits the timing of | |
911 | shell builtins, shell functions, and pipelines. An external | |
912 | <CODE>time</CODE> command cannot time these easily. | |
913 | </P><P> | |
914 | ||
915 | If the pipeline is not executed asynchronously (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the | |
916 | shell waits for all commands in the pipeline to complete. | |
917 | </P><P> | |
918 | ||
919 | Each command in a pipeline is executed in its own subshell | |
920 | (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>). The exit | |
921 | status of a pipeline is the exit status of the last command in the | |
922 | pipeline, unless the <CODE>pipefail</CODE> option is enabled | |
923 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
924 | If <CODE>pipefail</CODE> is enabled, the pipeline's return status is the | |
925 | value of the last (rightmost) command to exit with a non-zero status, | |
926 | or zero if all commands exit successfully. | |
927 | If the reserved word <SAMP>`!'</SAMP> precedes the pipeline, the | |
928 | exit status is the logical negation of the exit status as described | |
929 | above. | |
930 | The shell waits for all commands in the pipeline to terminate before | |
931 | returning a value. | |
932 | </P><P> | |
933 | ||
934 | <A NAME="Lists"></A> | |
935 | <HR SIZE="6"> | |
936 | <A NAME="SEC18"></A> | |
937 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
938 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> < </A>]</TD> | |
939 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> > </A>]</TD> | |
940 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> << </A>]</TD> | |
941 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
942 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
943 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
944 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
945 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
946 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
947 | </TR></TABLE> | |
948 | <H3> 3.2.3 Lists of Commands </H3> | |
949 | <!--docid::SEC18::--> | |
950 | <P> | |
951 | ||
952 | A <CODE>list</CODE> is a sequence of one or more pipelines separated by one | |
953 | of the operators <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`&&'</SAMP>, or <SAMP>`||'</SAMP>, | |
954 | and optionally terminated by one of <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, or a | |
955 | <CODE>newline</CODE>. | |
956 | </P><P> | |
957 | ||
958 | Of these list operators, <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP> | |
959 | have equal precedence, followed by <SAMP>`;'</SAMP> and <SAMP>`&'</SAMP>, | |
960 | which have equal precedence. | |
961 | </P><P> | |
962 | ||
963 | A sequence of one or more newlines may appear in a <CODE>list</CODE> | |
964 | to delimit commands, equivalent to a semicolon. | |
965 | </P><P> | |
966 | ||
967 | If a command is terminated by the control operator <SAMP>`&'</SAMP>, | |
968 | the shell executes the command asynchronously in a subshell. | |
969 | This is known as executing the command in the <VAR>background</VAR>. | |
970 | The shell does not wait for the command to finish, and the return | |
971 | status is 0 (true). | |
972 | When job control is not active (see section <A HREF="bashref.html#SEC91">7. Job Control</A>), | |
973 | the standard input for asynchronous commands, in the absence of any | |
974 | explicit redirections, is redirected from <CODE>/dev/null</CODE>. | |
975 | </P><P> | |
976 | ||
977 | Commands separated by a <SAMP>`;'</SAMP> are executed sequentially; the shell | |
978 | waits for each command to terminate in turn. The return status is the | |
979 | exit status of the last command executed. | |
980 | </P><P> | |
981 | ||
982 | AND and OR lists are sequences of one or more pipelines | |
983 | separated by the control operators <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP>, | |
984 | respectively. AND and OR lists are executed with left | |
985 | associativity. | |
986 | </P><P> | |
987 | ||
988 | An AND list has the form | |
989 | <TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> && <VAR>command2</VAR> | |
990 | </pre></td></tr></table></P><P> | |
991 | ||
992 | <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR> | |
993 | returns an exit status of zero. | |
994 | </P><P> | |
995 | ||
996 | An OR list has the form | |
997 | <TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> || <VAR>command2</VAR> | |
998 | </pre></td></tr></table></P><P> | |
999 | ||
1000 | <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR> | |
1001 | returns a non-zero exit status. | |
1002 | </P><P> | |
1003 | ||
1004 | The return status of | |
1005 | AND and OR lists is the exit status of the last command | |
1006 | executed in the list. | |
1007 | </P><P> | |
1008 | ||
1009 | <A NAME="Compound Commands"></A> | |
1010 | <HR SIZE="6"> | |
1011 | <A NAME="SEC19"></A> | |
1012 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1013 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> < </A>]</TD> | |
1014 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> > </A>]</TD> | |
1015 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> | |
1016 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
1017 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> | |
1018 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1019 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1020 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1021 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1022 | </TR></TABLE> | |
1023 | <H3> 3.2.4 Compound Commands </H3> | |
1024 | <!--docid::SEC19::--> | |
1025 | <P> | |
1026 | ||
1027 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
1028 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for iterative action.</TD></TR> | |
1029 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for conditional execution.</TD></TR> | |
1030 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Ways to group commands.</TD></TR> | |
1031 | </TABLE></BLOCKQUOTE> | |
1032 | <P> | |
1033 | ||
1034 | Compound commands are the shell programming constructs. | |
1035 | Each construct begins with a reserved word or control operator and is | |
1036 | terminated by a corresponding reserved word or operator. | |
1037 | Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with a compound command | |
1038 | apply to all commands within that compound command unless explicitly overridden. | |
1039 | </P><P> | |
1040 | ||
1041 | Bash provides looping constructs, conditional commands, and mechanisms | |
1042 | to group commands and execute them as a unit. | |
1043 | </P><P> | |
1044 | ||
1045 | <A NAME="Looping Constructs"></A> | |
1046 | <HR SIZE="6"> | |
1047 | <A NAME="SEC20"></A> | |
1048 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1049 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> < </A>]</TD> | |
1050 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> > </A>]</TD> | |
1051 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> | |
1052 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD> | |
1053 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> | |
1054 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1055 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1056 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1057 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1058 | </TR></TABLE> | |
1059 | <H4> 3.2.4.1 Looping Constructs </H4> | |
1060 | <!--docid::SEC20::--> | |
1061 | <P> | |
1062 | ||
1063 | Bash supports the following looping constructs. | |
1064 | </P><P> | |
1065 | ||
1066 | Note that wherever a <SAMP>`;'</SAMP> appears in the description of a | |
1067 | command's syntax, it may be replaced with one or more newlines. | |
1068 | </P><P> | |
1069 | ||
1070 | <DL COMPACT> | |
1071 | <DT><CODE>until</CODE> | |
1072 | <DD><A NAME="IDX27"></A> | |
1073 | <A NAME="IDX28"></A> | |
1074 | <A NAME="IDX29"></A> | |
1075 | The syntax of the <CODE>until</CODE> command is: | |
1076 | <TABLE><tr><td> </td><td class=example><pre>until <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done | |
1077 | </pre></td></tr></table>Execute <VAR>consequent-commands</VAR> as long as | |
1078 | <VAR>test-commands</VAR> has an exit status which is not zero. | |
1079 | The return status is the exit status of the last command executed | |
1080 | in <VAR>consequent-commands</VAR>, or zero if none was executed. | |
1081 | <P> | |
1082 | ||
1083 | <DT><CODE>while</CODE> | |
1084 | <DD><A NAME="IDX30"></A> | |
1085 | The syntax of the <CODE>while</CODE> command is: | |
1086 | <TABLE><tr><td> </td><td class=example><pre>while <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done | |
1087 | </pre></td></tr></table><P> | |
1088 | ||
1089 | Execute <VAR>consequent-commands</VAR> as long as | |
1090 | <VAR>test-commands</VAR> has an exit status of zero. | |
1091 | The return status is the exit status of the last command executed | |
1092 | in <VAR>consequent-commands</VAR>, or zero if none was executed. | |
1093 | </P><P> | |
1094 | ||
1095 | <DT><CODE>for</CODE> | |
1096 | <DD><A NAME="IDX31"></A> | |
1097 | The syntax of the <CODE>for</CODE> command is: | |
1098 | <P> | |
1099 | ||
1100 | <TABLE><tr><td> </td><td class=example><pre>for <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done | |
1101 | </pre></td></tr></table>Expand <VAR>words</VAR>, and execute <VAR>commands</VAR> once for each member | |
1102 | in the resultant list, with <VAR>name</VAR> bound to the current member. | |
1103 | If <SAMP>`in <VAR>words</VAR>'</SAMP> is not present, the <CODE>for</CODE> command | |
1104 | executes the <VAR>commands</VAR> once for each positional parameter that is | |
1105 | set, as if <SAMP>`in "$@"'</SAMP> had been specified | |
1106 | (see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>). | |
1107 | The return status is the exit status of the last command that executes. | |
1108 | If there are no items in the expansion of <VAR>words</VAR>, no commands are | |
1109 | executed, and the return status is zero. | |
1110 | </P><P> | |
1111 | ||
1112 | An alternate form of the <CODE>for</CODE> command is also supported: | |
1113 | </P><P> | |
1114 | ||
1115 | <TABLE><tr><td> </td><td class=example><pre>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> )) ; do <VAR>commands</VAR> ; done | |
1116 | </pre></td></tr></table>First, the arithmetic expression <VAR>expr1</VAR> is evaluated according | |
1117 | to the rules described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
1118 | The arithmetic expression <VAR>expr2</VAR> is then evaluated repeatedly | |
1119 | until it evaluates to zero. | |
1120 | Each time <VAR>expr2</VAR> evaluates to a non-zero value, <VAR>commands</VAR> are | |
1121 | executed and the arithmetic expression <VAR>expr3</VAR> is evaluated. | |
1122 | If any expression is omitted, it behaves as if it evaluates to 1. | |
1123 | The return value is the exit status of the last command in <VAR>list</VAR> | |
1124 | that is executed, or false if any of the expressions is invalid. | |
1125 | </P><P> | |
1126 | ||
1127 | </DL> | |
1128 | <P> | |
1129 | ||
1130 | The <CODE>break</CODE> and <CODE>continue</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) | |
1131 | may be used to control loop execution. | |
1132 | </P><P> | |
1133 | ||
1134 | <A NAME="Conditional Constructs"></A> | |
1135 | <HR SIZE="6"> | |
1136 | <A NAME="SEC21"></A> | |
1137 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1138 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> < </A>]</TD> | |
1139 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> > </A>]</TD> | |
1140 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> << </A>]</TD> | |
1141 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD> | |
1142 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> | |
1143 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1144 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1145 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1146 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1147 | </TR></TABLE> | |
1148 | <H4> 3.2.4.2 Conditional Constructs </H4> | |
1149 | <!--docid::SEC21::--> | |
1150 | <P> | |
1151 | ||
1152 | <DL COMPACT> | |
1153 | <DT><CODE>if</CODE> | |
1154 | <DD><A NAME="IDX32"></A> | |
1155 | <A NAME="IDX33"></A> | |
1156 | <A NAME="IDX34"></A> | |
1157 | <A NAME="IDX35"></A> | |
1158 | <A NAME="IDX36"></A> | |
1159 | The syntax of the <CODE>if</CODE> command is: | |
1160 | <P> | |
1161 | ||
1162 | <TABLE><tr><td> </td><td class=example><pre>if <VAR>test-commands</VAR>; then | |
1163 | <VAR>consequent-commands</VAR>; | |
1164 | [elif <VAR>more-test-commands</VAR>; then | |
1165 | <VAR>more-consequents</VAR>;] | |
1166 | [else <VAR>alternate-consequents</VAR>;] | |
1167 | fi | |
1168 | </pre></td></tr></table></P><P> | |
1169 | ||
1170 | The <VAR>test-commands</VAR> list is executed, and if its return status is zero, | |
1171 | the <VAR>consequent-commands</VAR> list is executed. | |
1172 | If <VAR>test-commands</VAR> returns a non-zero status, each <CODE>elif</CODE> list | |
1173 | is executed in turn, and if its exit status is zero, | |
1174 | the corresponding <VAR>more-consequents</VAR> is executed and the | |
1175 | command completes. | |
1176 | If <SAMP>`else <VAR>alternate-consequents</VAR>'</SAMP> is present, and | |
1177 | the final command in the final <CODE>if</CODE> or <CODE>elif</CODE> clause | |
1178 | has a non-zero exit status, then <VAR>alternate-consequents</VAR> is executed. | |
1179 | The return status is the exit status of the last command executed, or | |
1180 | zero if no condition tested true. | |
1181 | </P><P> | |
1182 | ||
1183 | <DT><CODE>case</CODE> | |
1184 | <DD><A NAME="IDX37"></A> | |
1185 | <A NAME="IDX38"></A> | |
1186 | <A NAME="IDX39"></A> | |
1187 | The syntax of the <CODE>case</CODE> command is: | |
1188 | <P> | |
1189 | ||
1190 | <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> | |
1191 | </pre></td></tr></table></P><P> | |
1192 | ||
1193 | <CODE>case</CODE> will selectively execute the <VAR>command-list</VAR> corresponding to | |
1194 | the first <VAR>pattern</VAR> that matches <VAR>word</VAR>. | |
1195 | If the shell option <CODE>nocasematch</CODE> | |
1196 | (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) | |
1197 | is enabled, the match is performed without regard to the case | |
1198 | of alphabetic characters. | |
1199 | The <SAMP>`|'</SAMP> is used to separate multiple patterns, and the <SAMP>`)'</SAMP> | |
1200 | operator terminates a pattern list. | |
1201 | A list of patterns and an associated command-list is known | |
1202 | as a <VAR>clause</VAR>. | |
1203 | </P><P> | |
1204 | ||
1205 | Each clause must be terminated with <SAMP>`;;'</SAMP>, <SAMP>`,&'</SAMP>, or <SAMP>`;;&'</SAMP>. | |
1206 | The <VAR>word</VAR> undergoes tilde expansion, parameter expansion, command | |
1207 | substitution, arithmetic expansion, and quote removal before matching is | |
1208 | attempted. Each <VAR>pattern</VAR> undergoes tilde expansion, parameter | |
1209 | expansion, command substitution, and arithmetic expansion. | |
1210 | </P><P> | |
1211 | ||
1212 | There may be an arbitrary number of <CODE>case</CODE> clauses, each terminated | |
1213 | by a <SAMP>`;;'</SAMP>, <SAMP>`;&'</SAMP>, or <SAMP>`;;&'</SAMP>. | |
1214 | The first pattern that matches determines the | |
1215 | command-list that is executed. | |
1216 | </P><P> | |
1217 | ||
1218 | Here is an example using <CODE>case</CODE> in a script that could be used to | |
1219 | describe one interesting feature of an animal: | |
1220 | </P><P> | |
1221 | ||
1222 | <TABLE><tr><td> </td><td class=example><pre>echo -n "Enter the name of an animal: " | |
1223 | read ANIMAL | |
1224 | echo -n "The $ANIMAL has " | |
1225 | case $ANIMAL in | |
1226 | horse | dog | cat) echo -n "four";; | |
1227 | man | kangaroo ) echo -n "two";; | |
1228 | *) echo -n "an unknown number of";; | |
1229 | esac | |
1230 | echo " legs." | |
1231 | </pre></td></tr></table></P><P> | |
1232 | ||
1233 | </P><P> | |
1234 | ||
1235 | If the <SAMP>`;;'</SAMP> operator is used, no subsequent matches are attempted after | |
1236 | the first pattern match. | |
1237 | Using <SAMP>`;&'</SAMP> in place of <SAMP>`;;'</SAMP> causes execution to continue with | |
1238 | the <VAR>command-list</VAR> associated with the next clause, if any. | |
1239 | Using <SAMP>`;;&'</SAMP> in place of <SAMP>`;;'</SAMP> causes the shell to test the patterns | |
1240 | in the next clause, if any, and execute any associated <VAR>command-list</VAR> | |
1241 | on a successful match. | |
1242 | </P><P> | |
1243 | ||
1244 | The return status is zero if no <VAR>pattern</VAR> is matched. Otherwise, the | |
1245 | return status is the exit status of the <VAR>command-list</VAR> executed. | |
1246 | </P><P> | |
1247 | ||
1248 | <DT><CODE>select</CODE> | |
1249 | <DD><A NAME="IDX40"></A> | |
1250 | <P> | |
1251 | ||
1252 | The <CODE>select</CODE> construct allows the easy generation of menus. | |
1253 | It has almost the same syntax as the <CODE>for</CODE> command: | |
1254 | </P><P> | |
1255 | ||
1256 | <TABLE><tr><td> </td><td class=example><pre>select <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done | |
1257 | </pre></td></tr></table></P><P> | |
1258 | ||
1259 | The list of words following <CODE>in</CODE> is expanded, generating a list | |
1260 | of items. The set of expanded words is printed on the standard | |
1261 | error output stream, each preceded by a number. If the | |
1262 | <SAMP>`in <VAR>words</VAR>'</SAMP> is omitted, the positional parameters are printed, | |
1263 | as if <SAMP>`in "$@"'</SAMP> had been specified. | |
1264 | The <CODE>PS3</CODE> prompt is then displayed and a line is read from the | |
1265 | standard input. | |
1266 | If the line consists of a number corresponding to one of the displayed | |
1267 | words, then the value of <VAR>name</VAR> is set to that word. | |
1268 | If the line is empty, the words and prompt are displayed again. | |
1269 | If <CODE>EOF</CODE> is read, the <CODE>select</CODE> command completes. | |
1270 | Any other value read causes <VAR>name</VAR> to be set to null. | |
1271 | The line read is saved in the variable <CODE>REPLY</CODE>. | |
1272 | </P><P> | |
1273 | ||
1274 | The <VAR>commands</VAR> are executed after each selection until a | |
1275 | <CODE>break</CODE> command is executed, at which | |
1276 | point the <CODE>select</CODE> command completes. | |
1277 | </P><P> | |
1278 | ||
1279 | Here is an example that allows the user to pick a filename from the | |
1280 | current directory, and displays the name and index of the file | |
1281 | selected. | |
1282 | </P><P> | |
1283 | ||
1284 | <TABLE><tr><td> </td><td class=example><pre>select fname in *; | |
1285 | do | |
1286 | echo you picked $fname \($REPLY\) | |
1287 | break; | |
1288 | done | |
1289 | </pre></td></tr></table></P><P> | |
1290 | ||
1291 | <DT><CODE>((<small>...</small>))</CODE> | |
1292 | <DD><TABLE><tr><td> </td><td class=example><pre>(( <VAR>expression</VAR> )) | |
1293 | </pre></td></tr></table><P> | |
1294 | ||
1295 | The arithmetic <VAR>expression</VAR> is evaluated according to the rules | |
1296 | described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
1297 | If the value of the expression is non-zero, the return status is 0; | |
1298 | otherwise the return status is 1. This is exactly equivalent to | |
1299 | <TABLE><tr><td> </td><td class=example><pre>let "<VAR>expression</VAR>" | |
1300 | </pre></td></tr></table>See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a full description of the <CODE>let</CODE> builtin. | |
1301 | </P><P> | |
1302 | ||
1303 | <DT><CODE>[[<small>...</small>]]</CODE> | |
1304 | <DD><A NAME="IDX41"></A> | |
1305 | <A NAME="IDX42"></A> | |
1306 | <TABLE><tr><td> </td><td class=example><pre>[[ <VAR>expression</VAR> ]] | |
1307 | </pre></td></tr></table><P> | |
1308 | ||
1309 | Return a status of 0 or 1 depending on the evaluation of | |
1310 | the conditional expression <VAR>expression</VAR>. | |
1311 | Expressions are composed of the primaries described below in | |
1312 | <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>. | |
1313 | Word splitting and filename expansion are not performed on the words | |
1314 | between the <SAMP>`[['</SAMP> and <SAMP>`]]'</SAMP>; tilde expansion, parameter and | |
1315 | variable expansion, arithmetic expansion, command substitution, process | |
1316 | substitution, and quote removal are performed. | |
1317 | Conditional operators such as <SAMP>`-f'</SAMP> must be unquoted to be recognized | |
1318 | as primaries. | |
1319 | </P><P> | |
1320 | ||
1321 | When the <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP> operators are used, the string to the | |
1322 | right of the operator is considered a pattern and matched according | |
1323 | to the rules described below in <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>. | |
1324 | If the shell option <CODE>nocasematch</CODE> | |
1325 | (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) | |
1326 | is enabled, the match is performed without regard to the case | |
1327 | of alphabetic characters. | |
1328 | The return value is 0 if the string matches (<SAMP>`=='</SAMP>) or does not | |
1329 | match (<SAMP>`!='</SAMP>)the pattern, and 1 otherwise. | |
1330 | Any part of the pattern may be quoted to force it to be matched as a | |
1331 | string. | |
1332 | </P><P> | |
1333 | ||
1334 | An additional binary operator, <SAMP>`=~'</SAMP>, is available, with the same | |
1335 | precedence as <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP>. | |
1336 | When it is used, the string to the right of the operator is considered | |
1337 | an extended regular expression and matched accordingly (as in <I>regex</I>3)). | |
1338 | The return value is 0 if the string matches | |
1339 | the pattern, and 1 otherwise. | |
1340 | If the regular expression is syntactically incorrect, the conditional | |
1341 | expression's return value is 2. | |
1342 | If the shell option <CODE>nocasematch</CODE> | |
1343 | (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) | |
1344 | is enabled, the match is performed without regard to the case | |
1345 | of alphabetic characters. | |
1346 | Any part of the pattern may be quoted to force it to be matched as a | |
1347 | string. | |
1348 | Substrings matched by parenthesized subexpressions within the regular | |
1349 | expression are saved in the array variable <CODE>BASH_REMATCH</CODE>. | |
1350 | The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string | |
1351 | matching the entire regular expression. | |
1352 | The element of <CODE>BASH_REMATCH</CODE> with index <VAR>n</VAR> is the portion of the | |
1353 | string matching the <VAR>n</VAR>th parenthesized subexpression. | |
1354 | </P><P> | |
1355 | ||
1356 | Expressions may be combined using the following operators, listed | |
1357 | in decreasing order of precedence: | |
1358 | </P><P> | |
1359 | ||
1360 | <DL COMPACT> | |
1361 | <DT><CODE>( <VAR>expression</VAR> )</CODE> | |
1362 | <DD>Returns the value of <VAR>expression</VAR>. | |
1363 | This may be used to override the normal precedence of operators. | |
1364 | <P> | |
1365 | ||
1366 | <DT><CODE>! <VAR>expression</VAR></CODE> | |
1367 | <DD>True if <VAR>expression</VAR> is false. | |
1368 | <P> | |
1369 | ||
1370 | <DT><CODE><VAR>expression1</VAR> && <VAR>expression2</VAR></CODE> | |
1371 | <DD>True if both <VAR>expression1</VAR> and <VAR>expression2</VAR> are true. | |
1372 | <P> | |
1373 | ||
1374 | <DT><CODE><VAR>expression1</VAR> || <VAR>expression2</VAR></CODE> | |
1375 | <DD>True if either <VAR>expression1</VAR> or <VAR>expression2</VAR> is true. | |
1376 | </DL> | |
1377 | The <CODE>&&</CODE> and <CODE>||</CODE> operators do not evaluate <VAR>expression2</VAR> if the | |
1378 | value of <VAR>expression1</VAR> is sufficient to determine the return | |
1379 | value of the entire conditional expression. | |
1380 | <P> | |
1381 | ||
1382 | </DL> | |
1383 | <P> | |
1384 | ||
1385 | <A NAME="Command Grouping"></A> | |
1386 | <HR SIZE="6"> | |
1387 | <A NAME="SEC22"></A> | |
1388 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1389 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> < </A>]</TD> | |
1390 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> > </A>]</TD> | |
1391 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> | |
1392 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD> | |
1393 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> | |
1394 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1395 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1396 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1397 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1398 | </TR></TABLE> | |
1399 | <H4> 3.2.4.3 Grouping Commands </H4> | |
1400 | <!--docid::SEC22::--> | |
1401 | <P> | |
1402 | ||
1403 | Bash provides two ways to group a list of commands to be executed | |
1404 | as a unit. When commands are grouped, redirections may be applied | |
1405 | to the entire command list. For example, the output of all the | |
1406 | commands in the list may be redirected to a single stream. | |
1407 | </P><P> | |
1408 | ||
1409 | <DL COMPACT> | |
1410 | <DT><CODE>()</CODE> | |
1411 | <DD><TABLE><tr><td> </td><td class=example><pre>( <VAR>list</VAR> ) | |
1412 | </pre></td></tr></table><P> | |
1413 | ||
1414 | Placing a list of commands between parentheses causes a subshell | |
1415 | environment to be created (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>), and each | |
1416 | of the commands in <VAR>list</VAR> to be executed in that subshell. Since the | |
1417 | <VAR>list</VAR> is executed in a subshell, variable assignments do not remain in | |
1418 | effect after the subshell completes. | |
1419 | </P><P> | |
1420 | ||
1421 | <DT><CODE>{}</CODE> | |
1422 | <DD><A NAME="IDX43"></A> | |
1423 | <A NAME="IDX44"></A> | |
1424 | <TABLE><tr><td> </td><td class=example><pre>{ <VAR>list</VAR>; } | |
1425 | </pre></td></tr></table><P> | |
1426 | ||
1427 | Placing a list of commands between curly braces causes the list to | |
1428 | be executed in the current shell context. No subshell is created. | |
1429 | The semicolon (or newline) following <VAR>list</VAR> is required. | |
1430 | </DL> | |
1431 | <P> | |
1432 | ||
1433 | In addition to the creation of a subshell, there is a subtle difference | |
1434 | between these two constructs due to historical reasons. The braces | |
1435 | are <CODE>reserved words</CODE>, so they must be separated from the <VAR>list</VAR> | |
1436 | by <CODE>blank</CODE>s or other shell metacharacters. | |
1437 | The parentheses are <CODE>operators</CODE>, and are | |
1438 | recognized as separate tokens by the shell even if they are not separated | |
1439 | from the <VAR>list</VAR> by whitespace. | |
1440 | </P><P> | |
1441 | ||
1442 | The exit status of both of these constructs is the exit status of | |
1443 | <VAR>list</VAR>. | |
1444 | </P><P> | |
1445 | ||
1446 | <A NAME="Coprocesses"></A> | |
1447 | <HR SIZE="6"> | |
1448 | <A NAME="SEC23"></A> | |
1449 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1450 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> < </A>]</TD> | |
1451 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> > </A>]</TD> | |
1452 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD> | |
1453 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> | |
1454 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD> | |
1455 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1456 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1457 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1458 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1459 | </TR></TABLE> | |
1460 | <H3> 3.2.5 Coprocesses </H3> | |
1461 | <!--docid::SEC23::--> | |
1462 | <P> | |
1463 | ||
1464 | A <CODE>coprocess</CODE> is a shell command preceded by the <CODE>coproc</CODE> | |
1465 | reserved word. | |
1466 | A coprocess is executed asynchronously in a subshell, as if the command | |
1467 | had been terminated with the <SAMP>`&'</SAMP> control operator, with a two-way pipe | |
1468 | established between the executing shell and the coprocess. | |
1469 | </P><P> | |
1470 | ||
1471 | The format for a coprocess is: | |
1472 | <TABLE><tr><td> </td><td class=example><pre><CODE>coproc</CODE> [<VAR>NAME</VAR>] <VAR>command</VAR> [<VAR>redirections</VAR>] | |
1473 | </pre></td></tr></table></P><P> | |
1474 | ||
1475 | This creates a coprocess named <VAR>NAME</VAR>. | |
1476 | If <VAR>NAME</VAR> is not supplied, the default name is <VAR>COPROC</VAR>. | |
1477 | <VAR>NAME</VAR> must not be supplied if <VAR>command</VAR> is a simple | |
1478 | command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>); otherwise, it is interpreted as | |
1479 | the first word of the simple command. | |
1480 | </P><P> | |
1481 | ||
1482 | When the coproc is executed, the shell creates an array variable | |
1483 | (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>) | |
1484 | named <VAR>NAME</VAR> in the context of the executing shell. | |
1485 | The standard output of <VAR>command</VAR> | |
1486 | is connected via a pipe to a file descriptor in the executing shell, | |
1487 | and that file descriptor is assigned to <VAR>NAME</VAR>[0]. | |
1488 | The standard input of <VAR>command</VAR> | |
1489 | is connected via a pipe to a file descriptor in the executing shell, | |
1490 | and that file descriptor is assigned to <VAR>NAME</VAR>[1]. | |
1491 | This pipe is established before any redirections specified by the | |
1492 | command (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
1493 | The file descriptors can be utilized as arguments to shell commands | |
1494 | and redirections using standard word expansions. | |
1495 | </P><P> | |
1496 | ||
1497 | The process id of the shell spawned to execute the coprocess is | |
1498 | available as the value of the variable <VAR>NAME</VAR>_PID. | |
1499 | The <CODE>wait</CODE> | |
1500 | builtin command may be used to wait for the coprocess to terminate. | |
1501 | </P><P> | |
1502 | ||
1503 | The return status of a coprocess is the exit status of <VAR>command</VAR>. | |
1504 | </P><P> | |
1505 | ||
1506 | <A NAME="Shell Functions"></A> | |
1507 | <HR SIZE="6"> | |
1508 | <A NAME="SEC24"></A> | |
1509 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1510 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> < </A>]</TD> | |
1511 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> > </A>]</TD> | |
1512 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> << </A>]</TD> | |
1513 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
1514 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD> | |
1515 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1516 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1517 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1518 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1519 | </TR></TABLE> | |
1520 | <H2> 3.3 Shell Functions </H2> | |
1521 | <!--docid::SEC24::--> | |
1522 | <P> | |
1523 | ||
1524 | Shell functions are a way to group commands for later execution | |
1525 | using a single name for the group. They are executed just like | |
1526 | a "regular" command. | |
1527 | When the name of a shell function is used as a simple command name, | |
1528 | the list of commands associated with that function name is executed. | |
1529 | Shell functions are executed in the current | |
1530 | shell context; no new process is created to interpret them. | |
1531 | </P><P> | |
1532 | ||
1533 | Functions are declared using this syntax: | |
1534 | <A NAME="IDX45"></A> | |
1535 | <TABLE><tr><td> </td><td class=example><pre>[ <CODE>function</CODE> ] <VAR>name</VAR> () <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ] | |
1536 | </pre></td></tr></table></P><P> | |
1537 | ||
1538 | This defines a shell function named <VAR>name</VAR>. The reserved | |
1539 | word <CODE>function</CODE> is optional. | |
1540 | If the <CODE>function</CODE> reserved | |
1541 | word is supplied, the parentheses are optional. | |
1542 | The <VAR>body</VAR> of the function is the compound command | |
1543 | <VAR>compound-command</VAR> (see section <A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>). | |
1544 | That command is usually a <VAR>list</VAR> enclosed between { and }, but | |
1545 | may be any compound command listed above. | |
1546 | <VAR>compound-command</VAR> is executed whenever <VAR>name</VAR> is specified as the | |
1547 | name of a command. | |
1548 | Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with the shell function | |
1549 | are performed when the function is executed. | |
1550 | </P><P> | |
1551 | ||
1552 | A function definition may be deleted using the <SAMP>`-f'</SAMP> option to the | |
1553 | <CODE>unset</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
1554 | </P><P> | |
1555 | ||
1556 | The exit status of a function definition is zero unless a syntax error | |
1557 | occurs or a readonly function with the same name already exists. | |
1558 | When executed, the exit status of a function is the exit status of the | |
1559 | last command executed in the body. | |
1560 | </P><P> | |
1561 | ||
1562 | Note that for historical reasons, in the most common usage the curly braces | |
1563 | that surround the body of the function must be separated from the body by | |
1564 | <CODE>blank</CODE>s or newlines. | |
1565 | This is because the braces are reserved words and are only recognized | |
1566 | as such when they are separated from the command list | |
1567 | by whitespace or another shell metacharacter. | |
1568 | Also, when using the braces, the <VAR>list</VAR> must be terminated by a semicolon, | |
1569 | a <SAMP>`&'</SAMP>, or a newline. | |
1570 | </P><P> | |
1571 | ||
1572 | When a function is executed, the arguments to the | |
1573 | function become the positional parameters | |
1574 | during its execution (see section <A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A>). | |
1575 | The special parameter <SAMP>`#'</SAMP> that expands to the number of | |
1576 | positional parameters is updated to reflect the change. | |
1577 | Special parameter <CODE>0</CODE> is unchanged. | |
1578 | The first element of the <CODE>FUNCNAME</CODE> variable is set to the | |
1579 | name of the function while the function is executing. | |
1580 | All other aspects of the shell execution | |
1581 | environment are identical between a function and its caller | |
1582 | with the exception that the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps | |
1583 | are not inherited unless the function has been given the | |
1584 | <CODE>trace</CODE> attribute using the <CODE>declare</CODE> builtin or | |
1585 | the <CODE>-o functrace</CODE> option has been enabled with | |
1586 | the <CODE>set</CODE> builtin, | |
1587 | (in which case all functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps). | |
1588 | See section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>, for the description of the | |
1589 | <CODE>trap</CODE> builtin. | |
1590 | </P><P> | |
1591 | ||
1592 | If the builtin command <CODE>return</CODE> | |
1593 | is executed in a function, the function completes and | |
1594 | execution resumes with the next command after the function | |
1595 | call. | |
1596 | Any command associated with the <CODE>RETURN</CODE> trap is executed | |
1597 | before execution resumes. | |
1598 | When a function completes, the values of the | |
1599 | positional parameters and the special parameter <SAMP>`#'</SAMP> | |
1600 | are restored to the values they had prior to the function's | |
1601 | execution. If a numeric argument is given to <CODE>return</CODE>, | |
1602 | that is the function's return status; otherwise the function's | |
1603 | return status is the exit status of the last command executed | |
1604 | before the <CODE>return</CODE>. | |
1605 | </P><P> | |
1606 | ||
1607 | Variables local to the function may be declared with the | |
1608 | <CODE>local</CODE> builtin. These variables are visible only to | |
1609 | the function and the commands it invokes. | |
1610 | </P><P> | |
1611 | ||
1612 | Function names and definitions may be listed with the | |
1613 | <SAMP>`-f'</SAMP> option to the <CODE>declare</CODE> or <CODE>typeset</CODE> | |
1614 | builtin commands (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
1615 | The <SAMP>`-F'</SAMP> option to <CODE>declare</CODE> or <CODE>typeset</CODE> | |
1616 | will list the function names only | |
1617 | (and optionally the source file and line number, if the <CODE>extdebug</CODE> | |
1618 | shell option is enabled). | |
1619 | Functions may be exported so that subshells | |
1620 | automatically have them defined with the | |
1621 | <SAMP>`-f'</SAMP> option to the <CODE>export</CODE> builtin | |
1622 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
1623 | Note that shell functions and variables with the same name may result | |
1624 | in multiple identically-named entries in the environment passed to the | |
1625 | shell's children. | |
1626 | Care should be taken in cases where this may cause a problem. | |
1627 | </P><P> | |
1628 | ||
1629 | Functions may be recursive. No limit is placed on the number of | |
1630 | recursive calls. | |
1631 | </P><P> | |
1632 | ||
1633 | <A NAME="Shell Parameters"></A> | |
1634 | <HR SIZE="6"> | |
1635 | <A NAME="SEC25"></A> | |
1636 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1637 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> < </A>]</TD> | |
1638 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> > </A>]</TD> | |
1639 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> << </A>]</TD> | |
1640 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
1641 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> >> </A>]</TD> | |
1642 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1643 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1644 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1645 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1646 | </TR></TABLE> | |
1647 | <H2> 3.4 Shell Parameters </H2> | |
1648 | <!--docid::SEC25::--> | |
1649 | <P> | |
1650 | ||
1651 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
1652 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The shell's command-line arguments.</TD></TR> | |
1653 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Parameters denoted by special characters.</TD></TR> | |
1654 | </TABLE></BLOCKQUOTE> | |
1655 | <P> | |
1656 | ||
1657 | A <VAR>parameter</VAR> is an entity that stores values. | |
1658 | It can be a <CODE>name</CODE>, a number, or one of the special characters | |
1659 | listed below. | |
1660 | A <VAR>variable</VAR> is a parameter denoted by a <CODE>name</CODE>. | |
1661 | A variable has a <VAR>value</VAR> and zero or more <VAR>attributes</VAR>. | |
1662 | Attributes are assigned using the <CODE>declare</CODE> builtin command | |
1663 | (see the description of the <CODE>declare</CODE> builtin in <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
1664 | </P><P> | |
1665 | ||
1666 | A parameter is set if it has been assigned a value. The null string is | |
1667 | a valid value. Once a variable is set, it may be unset only by using | |
1668 | the <CODE>unset</CODE> builtin command. | |
1669 | </P><P> | |
1670 | ||
1671 | A variable may be assigned to by a statement of the form | |
1672 | <TABLE><tr><td> </td><td class=example><pre><VAR>name</VAR>=[<VAR>value</VAR>] | |
1673 | </pre></td></tr></table>If <VAR>value</VAR> | |
1674 | is not given, the variable is assigned the null string. All | |
1675 | <VAR>value</VAR>s undergo tilde expansion, parameter and variable expansion, | |
1676 | command substitution, arithmetic expansion, and quote | |
1677 | removal (detailed below). If the variable has its <CODE>integer</CODE> | |
1678 | attribute set, then <VAR>value</VAR> | |
1679 | is evaluated as an arithmetic expression even if the <CODE>$((<small>...</small>))</CODE> | |
1680 | expansion is not used (see section <A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A>). | |
1681 | Word splitting is not performed, with the exception | |
1682 | of <CODE>"$@"</CODE> as explained below. | |
1683 | Filename expansion is not performed. | |
1684 | Assignment statements may also appear as arguments to the | |
1685 | <CODE>alias</CODE>, | |
1686 | <CODE>declare</CODE>, <CODE>typeset</CODE>, <CODE>export</CODE>, <CODE>readonly</CODE>, | |
1687 | and <CODE>local</CODE> builtin commands. | |
1688 | </P><P> | |
1689 | ||
1690 | In the context where an assignment statement is assigning a value | |
1691 | to a shell variable or array index (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the <SAMP>`+='</SAMP> | |
1692 | operator can be used to | |
1693 | append to or add to the variable's previous value. | |
1694 | When <SAMP>`+='</SAMP> is applied to a variable for which the integer attribute | |
1695 | has been set, <VAR>value</VAR> is evaluated as an arithmetic expression and | |
1696 | added to the variable's current value, which is also evaluated. | |
1697 | When <SAMP>`+='</SAMP> is applied to an array variable using compound assignment | |
1698 | (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the | |
1699 | variable's value is not unset (as it is when using <SAMP>`='</SAMP>), and new | |
1700 | values are appended to the array beginning at one greater than the array's | |
1701 | maximum index (for indexed arrays), or added as additional key-value pairs | |
1702 | in an associative array. | |
1703 | When applied to a string-valued variable, <VAR>value</VAR> is expanded and | |
1704 | appended to the variable's value. | |
1705 | </P><P> | |
1706 | ||
1707 | <A NAME="Positional Parameters"></A> | |
1708 | <HR SIZE="6"> | |
1709 | <A NAME="SEC26"></A> | |
1710 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1711 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> < </A>]</TD> | |
1712 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> > </A>]</TD> | |
1713 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> << </A>]</TD> | |
1714 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD> | |
1715 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> >> </A>]</TD> | |
1716 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1717 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1718 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1719 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1720 | </TR></TABLE> | |
1721 | <H3> 3.4.1 Positional Parameters </H3> | |
1722 | <!--docid::SEC26::--> | |
1723 | <P> | |
1724 | ||
1725 | A <VAR>positional parameter</VAR> is a parameter denoted by one or more | |
1726 | digits, other than the single digit <CODE>0</CODE>. Positional parameters are | |
1727 | assigned from the shell's arguments when it is invoked, | |
1728 | and may be reassigned using the <CODE>set</CODE> builtin command. | |
1729 | Positional parameter <CODE>N</CODE> may be referenced as <CODE>${N}</CODE>, or | |
1730 | as <CODE>$N</CODE> when <CODE>N</CODE> consists of a single digit. | |
1731 | Positional parameters may not be assigned to with assignment statements. | |
1732 | The <CODE>set</CODE> and <CODE>shift</CODE> builtins are used to set and | |
1733 | unset them (see section <A HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>). | |
1734 | The positional parameters are | |
1735 | temporarily replaced when a shell function is executed | |
1736 | (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>). | |
1737 | </P><P> | |
1738 | ||
1739 | When a positional parameter consisting of more than a single | |
1740 | digit is expanded, it must be enclosed in braces. | |
1741 | </P><P> | |
1742 | ||
1743 | <A NAME="Special Parameters"></A> | |
1744 | <HR SIZE="6"> | |
1745 | <A NAME="SEC27"></A> | |
1746 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1747 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> < </A>]</TD> | |
1748 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> > </A>]</TD> | |
1749 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> << </A>]</TD> | |
1750 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD> | |
1751 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> >> </A>]</TD> | |
1752 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1753 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1754 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1755 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1756 | </TR></TABLE> | |
1757 | <H3> 3.4.2 Special Parameters </H3> | |
1758 | <!--docid::SEC27::--> | |
1759 | <P> | |
1760 | ||
1761 | The shell treats several parameters specially. These parameters may | |
1762 | only be referenced; assignment to them is not allowed. | |
1763 | </P><P> | |
1764 | ||
1765 | <DL COMPACT> | |
1766 | ||
1767 | <A NAME="IDX46"></A> | |
1768 | <DT><CODE>*</CODE> | |
1769 | <DD><A NAME="IDX47"></A> | |
1770 | Expands to the positional parameters, starting from one. When the | |
1771 | expansion occurs within double quotes, it expands to a single word | |
1772 | with the value of each parameter separated by the first character | |
1773 | of the <CODE>IFS</CODE> | |
1774 | special variable. That is, <CODE>"$*"</CODE> is equivalent | |
1775 | to <CODE>"$1<VAR>c</VAR>$2<VAR>c</VAR><small>...</small>"</CODE>, where <VAR>c</VAR> | |
1776 | is the first character of the value of the <CODE>IFS</CODE> | |
1777 | variable. | |
1778 | If <CODE>IFS</CODE> is unset, the parameters are separated by spaces. | |
1779 | If <CODE>IFS</CODE> is null, the parameters are joined without intervening | |
1780 | separators. | |
1781 | <P> | |
1782 | ||
1783 | <A NAME="IDX48"></A> | |
1784 | <DT><CODE>@</CODE> | |
1785 | <DD><A NAME="IDX49"></A> | |
1786 | Expands to the positional parameters, starting from one. When the | |
1787 | expansion occurs within double quotes, each parameter expands to a | |
1788 | separate word. That is, <CODE>"$@"</CODE> is equivalent to | |
1789 | <CODE>"$1" "$2" <small>...</small></CODE>. | |
1790 | If the double-quoted expansion occurs within a word, the expansion of | |
1791 | the first parameter is joined with the beginning part of the original | |
1792 | word, and the expansion of the last parameter is joined with the last | |
1793 | part of the original word. | |
1794 | When there are no positional parameters, <CODE>"$@"</CODE> and | |
1795 | <CODE>$@</CODE> | |
1796 | expand to nothing (i.e., they are removed). | |
1797 | <P> | |
1798 | ||
1799 | <A NAME="IDX50"></A> | |
1800 | <DT><CODE>#</CODE> | |
1801 | <DD><A NAME="IDX51"></A> | |
1802 | Expands to the number of positional parameters in decimal. | |
1803 | <P> | |
1804 | ||
1805 | <A NAME="IDX52"></A> | |
1806 | <DT><CODE>?</CODE> | |
1807 | <DD><A NAME="IDX53"></A> | |
1808 | Expands to the exit status of the most recently executed foreground | |
1809 | pipeline. | |
1810 | <P> | |
1811 | ||
1812 | <A NAME="IDX54"></A> | |
1813 | <DT><CODE>-</CODE> | |
1814 | <DD><A NAME="IDX55"></A> | |
1815 | (A hyphen.) Expands to the current option flags as specified upon | |
1816 | invocation, by the <CODE>set</CODE> | |
1817 | builtin command, or those set by the shell itself | |
1818 | (such as the <SAMP>`-i'</SAMP> option). | |
1819 | <P> | |
1820 | ||
1821 | <A NAME="IDX56"></A> | |
1822 | <DT><CODE>$</CODE> | |
1823 | <DD><A NAME="IDX57"></A> | |
1824 | Expands to the process ID of the shell. In a <CODE>()</CODE> subshell, it | |
1825 | expands to the process ID of the invoking shell, not the subshell. | |
1826 | <P> | |
1827 | ||
1828 | <A NAME="IDX58"></A> | |
1829 | <DT><CODE>!</CODE> | |
1830 | <DD><A NAME="IDX59"></A> | |
1831 | Expands to the process ID of the most recently executed background | |
1832 | (asynchronous) command. | |
1833 | <P> | |
1834 | ||
1835 | <A NAME="IDX60"></A> | |
1836 | <DT><CODE>0</CODE> | |
1837 | <DD><A NAME="IDX61"></A> | |
1838 | Expands to the name of the shell or shell script. This is set at | |
1839 | shell initialization. If Bash is invoked with a file of commands | |
1840 | (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>$0</CODE> is set to the name of that file. | |
1841 | If Bash is started with the <SAMP>`-c'</SAMP> option (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>), | |
1842 | then <CODE>$0</CODE> is set to the first argument after the string to be | |
1843 | executed, if one is present. Otherwise, it is set | |
1844 | to the filename used to invoke Bash, as given by argument zero. | |
1845 | <P> | |
1846 | ||
1847 | <A NAME="IDX62"></A> | |
1848 | <DT><CODE>_</CODE> | |
1849 | <DD><A NAME="IDX63"></A> | |
1850 | (An underscore.) | |
1851 | At shell startup, set to the absolute pathname used to invoke the | |
1852 | shell or shell script being executed as passed in the environment | |
1853 | or argument list. | |
1854 | Subsequently, expands to the last argument to the previous command, | |
1855 | after expansion. | |
1856 | Also set to the full pathname used to invoke each command executed | |
1857 | and placed in the environment exported to that command. | |
1858 | When checking mail, this parameter holds the name of the mail file. | |
1859 | </DL> | |
1860 | <P> | |
1861 | ||
1862 | <A NAME="Shell Expansions"></A> | |
1863 | <HR SIZE="6"> | |
1864 | <A NAME="SEC28"></A> | |
1865 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1866 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> < </A>]</TD> | |
1867 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> > </A>]</TD> | |
1868 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD> | |
1869 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
1870 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
1871 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1872 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1873 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1874 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1875 | </TR></TABLE> | |
1876 | <H2> 3.5 Shell Expansions </H2> | |
1877 | <!--docid::SEC28::--> | |
1878 | <P> | |
1879 | ||
1880 | Expansion is performed on the command line after it has been split into | |
1881 | <CODE>token</CODE>s. There are seven kinds of expansion performed: | |
1882 | <UL> | |
1883 | <LI>brace expansion | |
1884 | <LI>tilde expansion | |
1885 | <LI>parameter and variable expansion | |
1886 | <LI>command substitution | |
1887 | <LI>arithmetic expansion | |
1888 | <LI>word splitting | |
1889 | <LI>filename expansion | |
1890 | </UL> | |
1891 | <P> | |
1892 | ||
1893 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
1894 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of expressions within braces.</TD></TR> | |
1895 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of the ~ character.</TD></TR> | |
1896 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands variables to their values.</TD></TR> | |
1897 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Using the output of a command as an argument.</TD></TR> | |
1898 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to use arithmetic in shell expansions.</TD></TR> | |
1899 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A way to write and read to and from a | |
1900 | command.</TD></TR> | |
1901 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the results of expansion are split into separate | |
1902 | arguments.</TD></TR> | |
1903 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A shorthand for specifying filenames matching patterns.</TD></TR> | |
1904 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC38">3.5.9 Quote Removal</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How and when quote characters are removed from | |
1905 | words.</TD></TR> | |
1906 | </TABLE></BLOCKQUOTE> | |
1907 | <P> | |
1908 | ||
1909 | The order of expansions is: brace expansion, tilde expansion, | |
1910 | parameter, variable, and arithmetic expansion and | |
1911 | command substitution | |
1912 | (done in a left-to-right fashion), word splitting, and filename | |
1913 | expansion. | |
1914 | </P><P> | |
1915 | ||
1916 | On systems that can support it, there is an additional expansion | |
1917 | available: <VAR>process substitution</VAR>. This is performed at the | |
1918 | same time as parameter, variable, and arithmetic expansion and | |
1919 | command substitution. | |
1920 | </P><P> | |
1921 | ||
1922 | Only brace expansion, word splitting, and filename expansion | |
1923 | can change the number of words of the expansion; other expansions | |
1924 | expand a single word to a single word. | |
1925 | The only exceptions to this are the expansions of | |
1926 | <CODE>"$@"</CODE> (see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>) and <CODE>"${<VAR>name</VAR>[@]}"</CODE> | |
1927 | (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>). | |
1928 | </P><P> | |
1929 | ||
1930 | After all expansions, <CODE>quote removal</CODE> (see section <A HREF="bashref.html#SEC38">3.5.9 Quote Removal</A>) | |
1931 | is performed. | |
1932 | </P><P> | |
1933 | ||
1934 | <A NAME="Brace Expansion"></A> | |
1935 | <HR SIZE="6"> | |
1936 | <A NAME="SEC29"></A> | |
1937 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
1938 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> < </A>]</TD> | |
1939 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> > </A>]</TD> | |
1940 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD> | |
1941 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
1942 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
1943 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
1944 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
1945 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
1946 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
1947 | </TR></TABLE> | |
1948 | <H3> 3.5.1 Brace Expansion </H3> | |
1949 | <!--docid::SEC29::--> | |
1950 | <P> | |
1951 | ||
1952 | Brace expansion is a mechanism by which arbitrary strings may be generated. | |
1953 | This mechanism is similar to | |
1954 | <VAR>filename expansion</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>), | |
1955 | but the file names generated need not exist. | |
1956 | Patterns to be brace expanded take the form of an optional <VAR>preamble</VAR>, | |
1957 | followed by either a series of comma-separated strings or a seqeunce expression | |
1958 | between a pair of braces, | |
1959 | followed by an optional <VAR>postscript</VAR>. | |
1960 | The preamble is prefixed to each string contained within the braces, and | |
1961 | the postscript is then appended to each resulting string, expanding left | |
1962 | to right. | |
1963 | </P><P> | |
1964 | ||
1965 | Brace expansions may be nested. | |
1966 | The results of each expanded string are not sorted; left to right order | |
1967 | is preserved. | |
1968 | For example, | |
1969 | <TABLE><tr><td> </td><td class=example><pre>bash$ echo a{d,c,b}e | |
1970 | ade ace abe | |
1971 | </pre></td></tr></table></P><P> | |
1972 | ||
1973 | A sequence expression takes the form <CODE>{<VAR>x</VAR>..<VAR>y</VAR>[<VAR>incr</VAR>]}</CODE>, | |
1974 | where <VAR>x</VAR> and <VAR>y</VAR> are either integers or single characters, | |
1975 | and <VAR>incr</VAR>, an optional increment, is an integer. | |
1976 | When integers are supplied, the expression expands to each number between | |
1977 | <VAR>x</VAR> and <VAR>y</VAR>, inclusive. | |
1978 | Supplied integers may be prefixed with <SAMP>`0'</SAMP> to force each term to have the | |
1979 | same width. When either <VAR>x</VAR> or <VAR>y</VAR> begins with a zero, the shell | |
1980 | attempts to force all generated terms to contain the same number of digits, | |
1981 | zero-padding where necessary. | |
1982 | When characters are supplied, the expression expands to each character | |
1983 | lexicographically between <VAR>x</VAR> and <VAR>y</VAR>, inclusive. Note that | |
1984 | both <VAR>x</VAR> and <VAR>y</VAR> must be of the same type. | |
1985 | When the increment is supplied, it is used as the difference between | |
1986 | each term. The default increment is 1 or -1 as appropriate. | |
1987 | </P><P> | |
1988 | ||
1989 | Brace expansion is performed before any other expansions, | |
1990 | and any characters special to other expansions are preserved | |
1991 | in the result. It is strictly textual. Bash | |
1992 | does not apply any syntactic interpretation to the context of the | |
1993 | expansion or the text between the braces. | |
1994 | To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP> | |
1995 | is not considered eligible for brace expansion. | |
1996 | </P><P> | |
1997 | ||
1998 | A correctly-formed brace expansion must contain unquoted opening | |
1999 | and closing braces, and at least one unquoted comma or a valid | |
2000 | sequence expression. | |
2001 | Any incorrectly formed brace expansion is left unchanged. | |
2002 | </P><P> | |
2003 | ||
2004 | A { or <SAMP>`,'</SAMP> may be quoted with a backslash to prevent its | |
2005 | being considered part of a brace expression. | |
2006 | To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP> | |
2007 | is not considered eligible for brace expansion. | |
2008 | </P><P> | |
2009 | ||
2010 | This construct is typically used as shorthand when the common | |
2011 | prefix of the strings to be generated is longer than in the | |
2012 | above example: | |
2013 | <TABLE><tr><td> </td><td class=example><pre>mkdir /usr/local/src/bash/{old,new,dist,bugs} | |
2014 | </pre></td></tr></table>or | |
2015 | <TABLE><tr><td> </td><td class=example><pre>chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} | |
2016 | </pre></td></tr></table></P><P> | |
2017 | ||
2018 | <A NAME="Tilde Expansion"></A> | |
2019 | <HR SIZE="6"> | |
2020 | <A NAME="SEC30"></A> | |
2021 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2022 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> < </A>]</TD> | |
2023 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> > </A>]</TD> | |
2024 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> << </A>]</TD> | |
2025 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2026 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2027 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2028 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2029 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2030 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2031 | </TR></TABLE> | |
2032 | <H3> 3.5.2 Tilde Expansion </H3> | |
2033 | <!--docid::SEC30::--> | |
2034 | <P> | |
2035 | ||
2036 | If a word begins with an unquoted tilde character (<SAMP>`~'</SAMP>), all of the | |
2037 | characters up to the first unquoted slash (or all characters, | |
2038 | if there is no unquoted slash) are considered a <VAR>tilde-prefix</VAR>. | |
2039 | If none of the characters in the tilde-prefix are quoted, the | |
2040 | characters in the tilde-prefix following the tilde are treated as a | |
2041 | possible <VAR>login name</VAR>. | |
2042 | If this login name is the null string, the tilde is replaced with the | |
2043 | value of the <CODE>HOME</CODE> shell variable. | |
2044 | If <CODE>HOME</CODE> is unset, the home directory of the user executing the | |
2045 | shell is substituted instead. | |
2046 | Otherwise, the tilde-prefix is replaced with the home directory | |
2047 | associated with the specified login name. | |
2048 | </P><P> | |
2049 | ||
2050 | If the tilde-prefix is <SAMP>`~+'</SAMP>, the value of | |
2051 | the shell variable <CODE>PWD</CODE> replaces the tilde-prefix. | |
2052 | If the tilde-prefix is <SAMP>`~-'</SAMP>, the value of the shell variable | |
2053 | <CODE>OLDPWD</CODE>, if it is set, is substituted. | |
2054 | </P><P> | |
2055 | ||
2056 | If the characters following the tilde in the tilde-prefix consist of a | |
2057 | number <VAR>N</VAR>, optionally prefixed by a <SAMP>`+'</SAMP> or a <SAMP>`-'</SAMP>, | |
2058 | the tilde-prefix is replaced with the | |
2059 | corresponding element from the directory stack, as it would be displayed | |
2060 | by the <CODE>dirs</CODE> builtin invoked with the characters following tilde | |
2061 | in the tilde-prefix as an argument (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>). | |
2062 | If the tilde-prefix, sans the tilde, consists of a number without a | |
2063 | leading <SAMP>`+'</SAMP> or <SAMP>`-'</SAMP>, <SAMP>`+'</SAMP> is assumed. | |
2064 | </P><P> | |
2065 | ||
2066 | If the login name is invalid, or the tilde expansion fails, the word is | |
2067 | left unchanged. | |
2068 | </P><P> | |
2069 | ||
2070 | Each variable assignment is checked for unquoted tilde-prefixes immediately | |
2071 | following a <SAMP>`:'</SAMP> or the first <SAMP>`='</SAMP>. | |
2072 | In these cases, tilde expansion is also performed. | |
2073 | Consequently, one may use file names with tildes in assignments to | |
2074 | <CODE>PATH</CODE>, <CODE>MAILPATH</CODE>, and <CODE>CDPATH</CODE>, | |
2075 | and the shell assigns the expanded value. | |
2076 | </P><P> | |
2077 | ||
2078 | The following table shows how Bash treats unquoted tilde-prefixes: | |
2079 | </P><P> | |
2080 | ||
2081 | <DL COMPACT> | |
2082 | <DT><CODE>~</CODE> | |
2083 | <DD>The value of <CODE>$HOME</CODE> | |
2084 | <DT><CODE>~/foo</CODE> | |
2085 | <DD><TT>`$HOME/foo'</TT> | |
2086 | <P> | |
2087 | ||
2088 | <DT><CODE>~fred/foo</CODE> | |
2089 | <DD>The subdirectory <CODE>foo</CODE> of the home directory of the user | |
2090 | <CODE>fred</CODE> | |
2091 | <P> | |
2092 | ||
2093 | <DT><CODE>~+/foo</CODE> | |
2094 | <DD><TT>`$PWD/foo'</TT> | |
2095 | <P> | |
2096 | ||
2097 | <DT><CODE>~-/foo</CODE> | |
2098 | <DD><TT>`${OLDPWD-'~-'}/foo'</TT> | |
2099 | <P> | |
2100 | ||
2101 | <DT><CODE>~<VAR>N</VAR></CODE> | |
2102 | <DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP> | |
2103 | <P> | |
2104 | ||
2105 | <DT><CODE>~+<VAR>N</VAR></CODE> | |
2106 | <DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP> | |
2107 | <P> | |
2108 | ||
2109 | <DT><CODE>~-<VAR>N</VAR></CODE> | |
2110 | <DD>The string that would be displayed by <SAMP>`dirs -<VAR>N</VAR>'</SAMP> | |
2111 | <P> | |
2112 | ||
2113 | </DL> | |
2114 | <P> | |
2115 | ||
2116 | <A NAME="Shell Parameter Expansion"></A> | |
2117 | <HR SIZE="6"> | |
2118 | <A NAME="SEC31"></A> | |
2119 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2120 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> < </A>]</TD> | |
2121 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> > </A>]</TD> | |
2122 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> << </A>]</TD> | |
2123 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2124 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2125 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2126 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2127 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2128 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2129 | </TR></TABLE> | |
2130 | <H3> 3.5.3 Shell Parameter Expansion </H3> | |
2131 | <!--docid::SEC31::--> | |
2132 | <P> | |
2133 | ||
2134 | The <SAMP>`$'</SAMP> character introduces parameter expansion, | |
2135 | command substitution, or arithmetic expansion. The parameter name | |
2136 | or symbol to be expanded may be enclosed in braces, which | |
2137 | are optional but serve to protect the variable to be expanded from | |
2138 | characters immediately following it which could be | |
2139 | interpreted as part of the name. | |
2140 | </P><P> | |
2141 | ||
2142 | When braces are used, the matching ending brace is the first <SAMP>`}'</SAMP> | |
2143 | not escaped by a backslash or within a quoted string, and not within an | |
2144 | embedded arithmetic expansion, command substitution, or parameter | |
2145 | expansion. | |
2146 | </P><P> | |
2147 | ||
2148 | The basic form of parameter expansion is ${<VAR>parameter</VAR>}. | |
2149 | The value of <VAR>parameter</VAR> is substituted. The braces are required | |
2150 | when <VAR>parameter</VAR> | |
2151 | is a positional parameter with more than one digit, | |
2152 | or when <VAR>parameter</VAR> | |
2153 | is followed by a character that is not to be | |
2154 | interpreted as part of its name. | |
2155 | </P><P> | |
2156 | ||
2157 | If the first character of <VAR>parameter</VAR> is an exclamation point, | |
2158 | a level of variable indirection is introduced. | |
2159 | Bash uses the value of the variable formed from the rest of | |
2160 | <VAR>parameter</VAR> as the name of the variable; this variable is then | |
2161 | expanded and that value is used in the rest of the substitution, rather | |
2162 | than the value of <VAR>parameter</VAR> itself. | |
2163 | This is known as <CODE>indirect expansion</CODE>. | |
2164 | The exceptions to this are the expansions of ${!<VAR>prefix*</VAR>} | |
2165 | and ${!<VAR>name</VAR>[@]} | |
2166 | described below. | |
2167 | The exclamation point must immediately follow the left brace in order to | |
2168 | introduce indirection. | |
2169 | </P><P> | |
2170 | ||
2171 | In each of the cases below, <VAR>word</VAR> is subject to tilde expansion, | |
2172 | parameter expansion, command substitution, and arithmetic expansion. | |
2173 | </P><P> | |
2174 | ||
2175 | When not performing substring expansion, using the form described | |
2176 | below, Bash tests for a parameter that is unset or null. | |
2177 | Omitting the colon results in a test only for a parameter that is unset. | |
2178 | Put another way, if the colon is included, | |
2179 | the operator tests for both <VAR>parameter</VAR>'s existence and that its value | |
2180 | is not null; if the colon is omitted, the operator tests only for existence. | |
2181 | </P><P> | |
2182 | ||
2183 | <DL COMPACT> | |
2184 | ||
2185 | <DT><CODE>${<VAR>parameter</VAR>:-<VAR>word</VAR>}</CODE> | |
2186 | <DD>If <VAR>parameter</VAR> is unset or null, the expansion of | |
2187 | <VAR>word</VAR> is substituted. Otherwise, the value of | |
2188 | <VAR>parameter</VAR> is substituted. | |
2189 | <P> | |
2190 | ||
2191 | <DT><CODE>${<VAR>parameter</VAR>:=<VAR>word</VAR>}</CODE> | |
2192 | <DD>If <VAR>parameter</VAR> | |
2193 | is unset or null, the expansion of <VAR>word</VAR> | |
2194 | is assigned to <VAR>parameter</VAR>. | |
2195 | The value of <VAR>parameter</VAR> is then substituted. | |
2196 | Positional parameters and special parameters may not be assigned to | |
2197 | in this way. | |
2198 | <P> | |
2199 | ||
2200 | <DT><CODE>${<VAR>parameter</VAR>:?<VAR>word</VAR>}</CODE> | |
2201 | <DD>If <VAR>parameter</VAR> | |
2202 | is null or unset, the expansion of <VAR>word</VAR> (or a message | |
2203 | to that effect if <VAR>word</VAR> | |
2204 | is not present) is written to the standard error and the shell, if it | |
2205 | is not interactive, exits. Otherwise, the value of <VAR>parameter</VAR> is | |
2206 | substituted. | |
2207 | <P> | |
2208 | ||
2209 | <DT><CODE>${<VAR>parameter</VAR>:+<VAR>word</VAR>}</CODE> | |
2210 | <DD>If <VAR>parameter</VAR> | |
2211 | is null or unset, nothing is substituted, otherwise the expansion of | |
2212 | <VAR>word</VAR> is substituted. | |
2213 | <P> | |
2214 | ||
2215 | <DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>}</CODE> | |
2216 | <DD><DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>:<VAR>length</VAR>}</CODE> | |
2217 | <DD>Expands to up to <VAR>length</VAR> characters of <VAR>parameter</VAR> | |
2218 | starting at the character specified by <VAR>offset</VAR>. | |
2219 | If <VAR>length</VAR> is omitted, expands to the substring of | |
2220 | <VAR>parameter</VAR> starting at the character specified by <VAR>offset</VAR>. | |
2221 | <VAR>length</VAR> and <VAR>offset</VAR> are arithmetic expressions | |
2222 | (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
2223 | This is referred to as Substring Expansion. | |
2224 | <P> | |
2225 | ||
2226 | <VAR>length</VAR> must evaluate to a number greater than or equal to zero. | |
2227 | If <VAR>offset</VAR> evaluates to a number less than zero, the value | |
2228 | is used as an offset from the end of the value of <VAR>parameter</VAR>. | |
2229 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP>, the result is <VAR>length</VAR> positional | |
2230 | parameters beginning at <VAR>offset</VAR>. | |
2231 | If <VAR>parameter</VAR> is an indexed array name subscripted | |
2232 | by <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the result is the <VAR>length</VAR> | |
2233 | members of the array beginning with <CODE>${<VAR>parameter</VAR>[<VAR>offset</VAR>]}</CODE>. | |
2234 | A negative <VAR>offset</VAR> is taken relative to one greater than the maximum | |
2235 | index of the specified array. | |
2236 | Substring expansion applied to an associative array produces undefined | |
2237 | results. | |
2238 | </P><P> | |
2239 | ||
2240 | Note that a negative offset must be separated from the colon by at least | |
2241 | one space to avoid being confused with the <SAMP>`:-'</SAMP> expansion. | |
2242 | Substring indexing is zero-based unless the positional parameters | |
2243 | are used, in which case the indexing starts at 1 by default. | |
2244 | If <VAR>offset</VAR> is 0, and the positional parameters are used, <CODE>$@</CODE> is | |
2245 | prefixed to the list. | |
2246 | </P><P> | |
2247 | ||
2248 | <DT><CODE>${!<VAR>prefix</VAR>*}</CODE> | |
2249 | <DD><DT><CODE>${!<VAR>prefix</VAR>@}</CODE> | |
2250 | <DD>Expands to the names of variables whose names begin with <VAR>prefix</VAR>, | |
2251 | separated by the first character of the <CODE>IFS</CODE> special variable. | |
2252 | When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each | |
2253 | variable name expands to a separate word. | |
2254 | <P> | |
2255 | ||
2256 | <DT><CODE>${!<VAR>name</VAR>[@]}</CODE> | |
2257 | <DD><DT><CODE>${!<VAR>name</VAR>[*]}</CODE> | |
2258 | <DD>If <VAR>name</VAR> is an array variable, expands to the list of array indices | |
2259 | (keys) assigned in <VAR>name</VAR>. | |
2260 | If <VAR>name</VAR> is not an array, expands to 0 if <VAR>name</VAR> is set and null | |
2261 | otherwise. | |
2262 | When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each | |
2263 | key expands to a separate word. | |
2264 | <P> | |
2265 | ||
2266 | <DT><CODE>${#<VAR>parameter</VAR>}</CODE> | |
2267 | <DD>The length in characters of the expanded value of <VAR>parameter</VAR> is | |
2268 | substituted. | |
2269 | If <VAR>parameter</VAR> is <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, the value substituted | |
2270 | is the number of positional parameters. | |
2271 | If <VAR>parameter</VAR> is an array name subscripted by <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, | |
2272 | the value substituted is the number of elements in the array. | |
2273 | <P> | |
2274 | ||
2275 | <DT><CODE>${<VAR>parameter</VAR>#<VAR>word</VAR>}</CODE> | |
2276 | <DD><DT><CODE>${<VAR>parameter</VAR>##<VAR>word</VAR>}</CODE> | |
2277 | <DD>The <VAR>word</VAR> | |
2278 | is expanded to produce a pattern just as in filename | |
2279 | expansion (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). If the pattern matches | |
2280 | the beginning of the expanded value of <VAR>parameter</VAR>, | |
2281 | then the result of the expansion is the expanded value of <VAR>parameter</VAR> | |
2282 | with the shortest matching pattern (the <SAMP>`#'</SAMP> case) or the | |
2283 | longest matching pattern (the <SAMP>`##'</SAMP> case) deleted. | |
2284 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2285 | the pattern removal operation is applied to each positional | |
2286 | parameter in turn, and the expansion is the resultant list. | |
2287 | If <VAR>parameter</VAR> is an array variable subscripted with | |
2288 | <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2289 | the pattern removal operation is applied to each member of the | |
2290 | array in turn, and the expansion is the resultant list. | |
2291 | <P> | |
2292 | ||
2293 | <DT><CODE>${<VAR>parameter</VAR>%<VAR>word</VAR>}</CODE> | |
2294 | <DD><DT><CODE>${<VAR>parameter</VAR>%%<VAR>word</VAR>}</CODE> | |
2295 | <DD>The <VAR>word</VAR> is expanded to produce a pattern just as in | |
2296 | filename expansion. | |
2297 | If the pattern matches a trailing portion of the expanded value of | |
2298 | <VAR>parameter</VAR>, then the result of the expansion is the value of | |
2299 | <VAR>parameter</VAR> with the shortest matching pattern (the <SAMP>`%'</SAMP> case) | |
2300 | or the longest matching pattern (the <SAMP>`%%'</SAMP> case) deleted. | |
2301 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2302 | the pattern removal operation is applied to each positional | |
2303 | parameter in turn, and the expansion is the resultant list. | |
2304 | If <VAR>parameter</VAR> | |
2305 | is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2306 | the pattern removal operation is applied to each member of the | |
2307 | array in turn, and the expansion is the resultant list. | |
2308 | <P> | |
2309 | ||
2310 | <DT><CODE>${<VAR>parameter</VAR>/<VAR>pattern</VAR>/<VAR>string</VAR>}</CODE> | |
2311 | <DD><P> | |
2312 | ||
2313 | The <VAR>pattern</VAR> is expanded to produce a pattern just as in | |
2314 | filename expansion. | |
2315 | <VAR>Parameter</VAR> is expanded and the longest match of <VAR>pattern</VAR> | |
2316 | against its value is replaced with <VAR>string</VAR>. | |
2317 | If <VAR>pattern</VAR> begins with <SAMP>`/'</SAMP>, all matches of <VAR>pattern</VAR> are | |
2318 | replaced with <VAR>string</VAR>. Normally only the first match is replaced. | |
2319 | If <VAR>pattern</VAR> begins with <SAMP>`#'</SAMP>, it must match at the beginning | |
2320 | of the expanded value of <VAR>parameter</VAR>. | |
2321 | If <VAR>pattern</VAR> begins with <SAMP>`%'</SAMP>, it must match at the end | |
2322 | of the expanded value of <VAR>parameter</VAR>. | |
2323 | If <VAR>string</VAR> is null, matches of <VAR>pattern</VAR> are deleted | |
2324 | and the <CODE>/</CODE> following <VAR>pattern</VAR> may be omitted. | |
2325 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2326 | the substitution operation is applied to each positional | |
2327 | parameter in turn, and the expansion is the resultant list. | |
2328 | If <VAR>parameter</VAR> | |
2329 | is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2330 | the substitution operation is applied to each member of the | |
2331 | array in turn, and the expansion is the resultant list. | |
2332 | </P><P> | |
2333 | ||
2334 | <DT><CODE>${<VAR>parameter</VAR>^<VAR>pattern</VAR>}</CODE> | |
2335 | <DD><DT><CODE>${<VAR>parameter</VAR>^^<VAR>pattern</VAR>}</CODE> | |
2336 | <DD><DT><CODE>${<VAR>parameter</VAR>,<VAR>pattern</VAR>}</CODE> | |
2337 | <DD><DT><CODE>${<VAR>parameter</VAR>,,<VAR>pattern</VAR>}</CODE> | |
2338 | <DD>This expansion modifies the case of alphabetic characters in <VAR>parameter</VAR>. | |
2339 | The <VAR>pattern</VAR> is expanded to produce a pattern just as in | |
2340 | pathname expansion. | |
2341 | The <SAMP>`^'</SAMP> operator converts lowercase letters matching <VAR>pattern</VAR> | |
2342 | to uppercase; the <SAMP>`,'</SAMP> operator converts matching uppercase letters | |
2343 | to lowercase. | |
2344 | The <SAMP>`^^'</SAMP> and <SAMP>`,,'</SAMP> expansions convert each matched character in the | |
2345 | expanded value; the <SAMP>`^'</SAMP> and <SAMP>`,'</SAMP> expansions match and convert only | |
2346 | the first character in the expanded value. | |
2347 | If <VAR>pattern</VAR> is omitted, it is treated like a <SAMP>`?'</SAMP>, which matches | |
2348 | every character. | |
2349 | If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2350 | the case modification operation is applied to each positional | |
2351 | parameter in turn, and the expansion is the resultant list. | |
2352 | If <VAR>parameter</VAR> | |
2353 | is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, | |
2354 | the case modification operation is applied to each member of the | |
2355 | array in turn, and the expansion is the resultant list. | |
2356 | <P> | |
2357 | ||
2358 | </DL> | |
2359 | <P> | |
2360 | ||
2361 | <A NAME="Command Substitution"></A> | |
2362 | <HR SIZE="6"> | |
2363 | <A NAME="SEC32"></A> | |
2364 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2365 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> < </A>]</TD> | |
2366 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> > </A>]</TD> | |
2367 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> << </A>]</TD> | |
2368 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2369 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2370 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2371 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2372 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2373 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2374 | </TR></TABLE> | |
2375 | <H3> 3.5.4 Command Substitution </H3> | |
2376 | <!--docid::SEC32::--> | |
2377 | <P> | |
2378 | ||
2379 | Command substitution allows the output of a command to replace | |
2380 | the command itself. | |
2381 | Command substitution occurs when a command is enclosed as follows: | |
2382 | <TABLE><tr><td> </td><td class=example><pre>$(<VAR>command</VAR>) | |
2383 | </pre></td></tr></table>or | |
2384 | <TABLE><tr><td> </td><td class=example><pre>`<VAR>command</VAR>` | |
2385 | </pre></td></tr></table></P><P> | |
2386 | ||
2387 | Bash performs the expansion by executing <VAR>command</VAR> and | |
2388 | replacing the command substitution with the standard output of the | |
2389 | command, with any trailing newlines deleted. | |
2390 | Embedded newlines are not deleted, but they may be removed during | |
2391 | word splitting. | |
2392 | The command substitution <CODE>$(cat <VAR>file</VAR>)</CODE> can be | |
2393 | replaced by the equivalent but faster <CODE>$(< <VAR>file</VAR>)</CODE>. | |
2394 | </P><P> | |
2395 | ||
2396 | When the old-style backquote form of substitution is used, | |
2397 | backslash retains its literal meaning except when followed by | |
2398 | <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, or <SAMP>`\'</SAMP>. | |
2399 | The first backquote not preceded by a backslash terminates the | |
2400 | command substitution. | |
2401 | When using the <CODE>$(<VAR>command</VAR>)</CODE> form, all characters between | |
2402 | the parentheses make up the command; none are treated specially. | |
2403 | </P><P> | |
2404 | ||
2405 | Command substitutions may be nested. To nest when using the backquoted | |
2406 | form, escape the inner backquotes with backslashes. | |
2407 | </P><P> | |
2408 | ||
2409 | If the substitution appears within double quotes, word splitting and | |
2410 | filename expansion are not performed on the results. | |
2411 | </P><P> | |
2412 | ||
2413 | <A NAME="Arithmetic Expansion"></A> | |
2414 | <HR SIZE="6"> | |
2415 | <A NAME="SEC33"></A> | |
2416 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2417 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> < </A>]</TD> | |
2418 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> > </A>]</TD> | |
2419 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> << </A>]</TD> | |
2420 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2421 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2422 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2423 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2424 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2425 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2426 | </TR></TABLE> | |
2427 | <H3> 3.5.5 Arithmetic Expansion </H3> | |
2428 | <!--docid::SEC33::--> | |
2429 | <P> | |
2430 | ||
2431 | Arithmetic expansion allows the evaluation of an arithmetic expression | |
2432 | and the substitution of the result. The format for arithmetic expansion is: | |
2433 | </P><P> | |
2434 | ||
2435 | <TABLE><tr><td> </td><td class=example><pre>$(( <VAR>expression</VAR> )) | |
2436 | </pre></td></tr></table></P><P> | |
2437 | ||
2438 | The expression is treated as if it were within double quotes, but | |
2439 | a double quote inside the parentheses is not treated specially. | |
2440 | All tokens in the expression undergo parameter expansion, command | |
2441 | substitution, and quote removal. | |
2442 | Arithmetic expansions may be nested. | |
2443 | </P><P> | |
2444 | ||
2445 | The evaluation is performed according to the rules listed below | |
2446 | (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
2447 | If the expression is invalid, Bash prints a message indicating | |
2448 | failure to the standard error and no substitution occurs. | |
2449 | </P><P> | |
2450 | ||
2451 | <A NAME="Process Substitution"></A> | |
2452 | <HR SIZE="6"> | |
2453 | <A NAME="SEC34"></A> | |
2454 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2455 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> < </A>]</TD> | |
2456 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> > </A>]</TD> | |
2457 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> << </A>]</TD> | |
2458 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2459 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2460 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2461 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2462 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2463 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2464 | </TR></TABLE> | |
2465 | <H3> 3.5.6 Process Substitution </H3> | |
2466 | <!--docid::SEC34::--> | |
2467 | <P> | |
2468 | ||
2469 | Process substitution is supported on systems that support named | |
2470 | pipes (FIFOs) or the <TT>`/dev/fd'</TT> method of naming open files. | |
2471 | It takes the form of | |
2472 | <TABLE><tr><td> </td><td class=example><pre><(<VAR>list</VAR>) | |
2473 | </pre></td></tr></table>or | |
2474 | <TABLE><tr><td> </td><td class=example><pre>>(<VAR>list</VAR>) | |
2475 | </pre></td></tr></table>The process <VAR>list</VAR> is run with its input or output connected to a | |
2476 | FIFO or some file in <TT>`/dev/fd'</TT>. The name of this file is | |
2477 | passed as an argument to the current command as the result of the | |
2478 | expansion. If the <CODE>>(<VAR>list</VAR>)</CODE> form is used, writing to | |
2479 | the file will provide input for <VAR>list</VAR>. If the | |
2480 | <CODE><(<VAR>list</VAR>)</CODE> form is used, the file passed as an | |
2481 | argument should be read to obtain the output of <VAR>list</VAR>. | |
2482 | Note that no space may appear between the <CODE><</CODE> or <CODE>></CODE> | |
2483 | and the left parenthesis, otherwise the construct would be interpreted | |
2484 | as a redirection. | |
2485 | </P><P> | |
2486 | ||
2487 | When available, process substitution is performed simultaneously with | |
2488 | parameter and variable expansion, command substitution, and arithmetic | |
2489 | expansion. | |
2490 | </P><P> | |
2491 | ||
2492 | <A NAME="Word Splitting"></A> | |
2493 | <HR SIZE="6"> | |
2494 | <A NAME="SEC35"></A> | |
2495 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2496 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> < </A>]</TD> | |
2497 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> > </A>]</TD> | |
2498 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> << </A>]</TD> | |
2499 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2500 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2501 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2502 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2503 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2504 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2505 | </TR></TABLE> | |
2506 | <H3> 3.5.7 Word Splitting </H3> | |
2507 | <!--docid::SEC35::--> | |
2508 | <P> | |
2509 | ||
2510 | The shell scans the results of parameter expansion, command substitution, | |
2511 | and arithmetic expansion that did not occur within double quotes for | |
2512 | word splitting. | |
2513 | </P><P> | |
2514 | ||
2515 | The shell treats each character of <CODE>$IFS</CODE> as a delimiter, and splits | |
2516 | the results of the other expansions into words on these characters. | |
2517 | If <CODE>IFS</CODE> is unset, or its value is exactly <CODE><space><tab><newline></CODE>, | |
2518 | the default, then sequences of | |
2519 | <CODE> <space></CODE>, <CODE><tab></CODE>, and <CODE><newline></CODE> | |
2520 | at the beginning and end of the results of the previous | |
2521 | expansions are ignored, and any sequence of <CODE>IFS</CODE> | |
2522 | characters not at the beginning or end serves to delimit words. | |
2523 | If <CODE>IFS</CODE> has a value other than the default, then sequences of | |
2524 | the whitespace characters <CODE>space</CODE> and <CODE>tab</CODE> | |
2525 | are ignored at the beginning and end of the | |
2526 | word, as long as the whitespace character is in the | |
2527 | value of <CODE>IFS</CODE> (an <CODE>IFS</CODE> whitespace character). | |
2528 | Any character in <CODE>IFS</CODE> that is not <CODE>IFS</CODE> | |
2529 | whitespace, along with any adjacent <CODE>IFS</CODE> | |
2530 | whitespace characters, delimits a field. A sequence of <CODE>IFS</CODE> | |
2531 | whitespace characters is also treated as a delimiter. | |
2532 | If the value of <CODE>IFS</CODE> is null, no word splitting occurs. | |
2533 | </P><P> | |
2534 | ||
2535 | Explicit null arguments (<CODE>""</CODE> or <CODE>"</CODE>) are retained. | |
2536 | Unquoted implicit null arguments, resulting from the expansion of | |
2537 | parameters that have no values, are removed. | |
2538 | If a parameter with no value is expanded within double quotes, a | |
2539 | null argument results and is retained. | |
2540 | </P><P> | |
2541 | ||
2542 | Note that if no expansion occurs, no splitting | |
2543 | is performed. | |
2544 | </P><P> | |
2545 | ||
2546 | <A NAME="Filename Expansion"></A> | |
2547 | <HR SIZE="6"> | |
2548 | <A NAME="SEC36"></A> | |
2549 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2550 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> < </A>]</TD> | |
2551 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> > </A>]</TD> | |
2552 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> << </A>]</TD> | |
2553 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2554 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> | |
2555 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2556 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2557 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2558 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2559 | </TR></TABLE> | |
2560 | <H3> 3.5.8 Filename Expansion </H3> | |
2561 | <!--docid::SEC36::--> | |
2562 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
2563 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the shell matches patterns.</TD></TR> | |
2564 | </TABLE></BLOCKQUOTE> | |
2565 | <A NAME="IDX64"></A> | |
2566 | <A NAME="IDX65"></A> | |
2567 | <A NAME="IDX66"></A> | |
2568 | <A NAME="IDX67"></A> | |
2569 | <P> | |
2570 | ||
2571 | After word splitting, unless the <SAMP>`-f'</SAMP> option has been set | |
2572 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), Bash scans each word for the characters | |
2573 | <SAMP>`*'</SAMP>, <SAMP>`?'</SAMP>, and <SAMP>`['</SAMP>. | |
2574 | If one of these characters appears, then the word is | |
2575 | regarded as a <VAR>pattern</VAR>, | |
2576 | and replaced with an alphabetically sorted list of | |
2577 | file names matching the pattern. If no matching file names are found, | |
2578 | and the shell option <CODE>nullglob</CODE> is disabled, the word is left | |
2579 | unchanged. | |
2580 | If the <CODE>nullglob</CODE> option is set, and no matches are found, the word | |
2581 | is removed. | |
2582 | If the <CODE>failglob</CODE> shell option is set, and no matches are found, | |
2583 | an error message is printed and the command is not executed. | |
2584 | If the shell option <CODE>nocaseglob</CODE> is enabled, the match is performed | |
2585 | without regard to the case of alphabetic characters. | |
2586 | </P><P> | |
2587 | ||
2588 | When a pattern is used for filename generation, the character <SAMP>`.'</SAMP> | |
2589 | at the start of a filename or immediately following a slash | |
2590 | must be matched explicitly, unless the shell option <CODE>dotglob</CODE> is set. | |
2591 | When matching a file name, the slash character must always be | |
2592 | matched explicitly. | |
2593 | In other cases, the <SAMP>`.'</SAMP> character is not treated specially. | |
2594 | </P><P> | |
2595 | ||
2596 | See the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>, | |
2597 | for a description of the <CODE>nocaseglob</CODE>, <CODE>nullglob</CODE>, | |
2598 | <CODE>failglob</CODE>, and <CODE>dotglob</CODE> options. | |
2599 | </P><P> | |
2600 | ||
2601 | The <CODE>GLOBIGNORE</CODE> | |
2602 | shell variable may be used to restrict the set of filenames matching a | |
2603 | pattern. If <CODE>GLOBIGNORE</CODE> | |
2604 | is set, each matching filename that also matches one of the patterns in | |
2605 | <CODE>GLOBIGNORE</CODE> is removed from the list of matches. The filenames | |
2606 | <TT>`.'</TT> and <TT>`..'</TT> | |
2607 | are always ignored when <CODE>GLOBIGNORE</CODE> | |
2608 | is set and not null. | |
2609 | However, setting <CODE>GLOBIGNORE</CODE> to a non-null value has the effect of | |
2610 | enabling the <CODE>dotglob</CODE> | |
2611 | shell option, so all other filenames beginning with a | |
2612 | <SAMP>`.'</SAMP> will match. | |
2613 | To get the old behavior of ignoring filenames beginning with a | |
2614 | <SAMP>`.'</SAMP>, make <SAMP>`.*'</SAMP> one of the patterns in <CODE>GLOBIGNORE</CODE>. | |
2615 | The <CODE>dotglob</CODE> option is disabled when <CODE>GLOBIGNORE</CODE> | |
2616 | is unset. | |
2617 | </P><P> | |
2618 | ||
2619 | <A NAME="Pattern Matching"></A> | |
2620 | <HR SIZE="6"> | |
2621 | <A NAME="SEC37"></A> | |
2622 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2623 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> < </A>]</TD> | |
2624 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> > </A>]</TD> | |
2625 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> << </A>]</TD> | |
2626 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> Up </A>]</TD> | |
2627 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> | |
2628 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2629 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2630 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2631 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2632 | </TR></TABLE> | |
2633 | <H4> 3.5.8.1 Pattern Matching </H4> | |
2634 | <!--docid::SEC37::--> | |
2635 | <P> | |
2636 | ||
2637 | Any character that appears in a pattern, other than the special pattern | |
2638 | characters described below, matches itself. | |
2639 | The NUL character may not occur in a pattern. | |
2640 | A backslash escapes the following character; the | |
2641 | escaping backslash is discarded when matching. | |
2642 | The special pattern characters must be quoted if they are to be matched | |
2643 | literally. | |
2644 | </P><P> | |
2645 | ||
2646 | The special pattern characters have the following meanings: | |
2647 | <DL COMPACT> | |
2648 | <DT><CODE>*</CODE> | |
2649 | <DD>Matches any string, including the null string. | |
2650 | When the <CODE>globstar</CODE> shell option is enabled, and <SAMP>`*'</SAMP> is used in | |
2651 | a filename expansion context, two adjacent <SAMP>`*'</SAMP>s used as a single | |
2652 | pattern will match all files and zero or more directories and | |
2653 | subdirectories. | |
2654 | If followed by a <SAMP>`/'</SAMP>, two adjacent <SAMP>`*'</SAMP>s will match only | |
2655 | directories and subdirectories. | |
2656 | <DT><CODE>?</CODE> | |
2657 | <DD>Matches any single character. | |
2658 | <DT><CODE>[<small>...</small>]</CODE> | |
2659 | <DD>Matches any one of the enclosed characters. A pair of characters | |
2660 | separated by a hyphen denotes a <VAR>range expression</VAR>; | |
2661 | any character that sorts between those two characters, inclusive, | |
2662 | using the current locale's collating sequence and character set, | |
2663 | is matched. If the first character following the | |
2664 | <SAMP>`['</SAMP> is a <SAMP>`!'</SAMP> or a <SAMP>`^'</SAMP> | |
2665 | then any character not enclosed is matched. A <SAMP>`-'</SAMP> | |
2666 | may be matched by including it as the first or last character | |
2667 | in the set. A <SAMP>`]'</SAMP> may be matched by including it as the first | |
2668 | character in the set. | |
2669 | The sorting order of characters in range expressions is determined by | |
2670 | the current locale and the value of the <CODE>LC_COLLATE</CODE> shell variable, | |
2671 | if set. | |
2672 | <P> | |
2673 | ||
2674 | For example, in the default C locale, <SAMP>`[a-dx-z]'</SAMP> is equivalent to | |
2675 | <SAMP>`[abcdxyz]'</SAMP>. Many locales sort characters in dictionary order, and in | |
2676 | these locales <SAMP>`[a-dx-z]'</SAMP> is typically not equivalent to <SAMP>`[abcdxyz]'</SAMP>; | |
2677 | it might be equivalent to <SAMP>`[aBbCcDdxXyYz]'</SAMP>, for example. To obtain | |
2678 | the traditional interpretation of ranges in bracket expressions, you can | |
2679 | force the use of the C locale by setting the <CODE>LC_COLLATE</CODE> or | |
2680 | <CODE>LC_ALL</CODE> environment variable to the value <SAMP>`C'</SAMP>. | |
2681 | </P><P> | |
2682 | ||
2683 | Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, <VAR>character classes</VAR> can be specified | |
2684 | using the syntax | |
2685 | <CODE>[:</CODE><VAR>class</VAR><CODE>:]</CODE>, where <VAR>class</VAR> is one of the | |
2686 | following classes defined in the POSIX standard: | |
2687 | <TABLE><tr><td> </td><td class=example><pre>alnum alpha ascii blank cntrl digit graph lower | |
2688 | print punct space upper word xdigit | |
2689 | </pre></td></tr></table>A character class matches any character belonging to that class. | |
2690 | The <CODE>word</CODE> character class matches letters, digits, and the character | |
2691 | <SAMP>`_'</SAMP>. | |
2692 | </P><P> | |
2693 | ||
2694 | Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, an <VAR>equivalence class</VAR> can be | |
2695 | specified using the syntax <CODE>[=</CODE><VAR>c</VAR><CODE>=]</CODE>, which | |
2696 | matches all characters with the same collation weight (as defined | |
2697 | by the current locale) as the character <VAR>c</VAR>. | |
2698 | </P><P> | |
2699 | ||
2700 | Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, the syntax <CODE>[.</CODE><VAR>symbol</VAR><CODE>.]</CODE> | |
2701 | matches the collating symbol <VAR>symbol</VAR>. | |
2702 | </DL> | |
2703 | <P> | |
2704 | ||
2705 | If the <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> | |
2706 | builtin, several extended pattern matching operators are recognized. | |
2707 | In the following description, a <VAR>pattern-list</VAR> is a list of one | |
2708 | or more patterns separated by a <SAMP>`|'</SAMP>. | |
2709 | Composite patterns may be formed using one or more of the following | |
2710 | sub-patterns: | |
2711 | </P><P> | |
2712 | ||
2713 | <DL COMPACT> | |
2714 | <DT><CODE>?(<VAR>pattern-list</VAR>)</CODE> | |
2715 | <DD>Matches zero or one occurrence of the given patterns. | |
2716 | <P> | |
2717 | ||
2718 | <DT><CODE>*(<VAR>pattern-list</VAR>)</CODE> | |
2719 | <DD>Matches zero or more occurrences of the given patterns. | |
2720 | <P> | |
2721 | ||
2722 | <DT><CODE>+(<VAR>pattern-list</VAR>)</CODE> | |
2723 | <DD>Matches one or more occurrences of the given patterns. | |
2724 | <P> | |
2725 | ||
2726 | <DT><CODE>@(<VAR>pattern-list</VAR>)</CODE> | |
2727 | <DD>Matches one of the given patterns. | |
2728 | <P> | |
2729 | ||
2730 | <DT><CODE>!(<VAR>pattern-list</VAR>)</CODE> | |
2731 | <DD>Matches anything except one of the given patterns. | |
2732 | </DL> | |
2733 | <P> | |
2734 | ||
2735 | <A NAME="Quote Removal"></A> | |
2736 | <HR SIZE="6"> | |
2737 | <A NAME="SEC38"></A> | |
2738 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2739 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> < </A>]</TD> | |
2740 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> > </A>]</TD> | |
2741 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD> | |
2742 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD> | |
2743 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD> | |
2744 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2745 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2746 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2747 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2748 | </TR></TABLE> | |
2749 | <H3> 3.5.9 Quote Removal </H3> | |
2750 | <!--docid::SEC38::--> | |
2751 | <P> | |
2752 | ||
2753 | After the preceding expansions, all unquoted occurrences of the | |
2754 | characters <SAMP>`\'</SAMP>, <SAMP>`''</SAMP>, and <SAMP>`"'</SAMP> that did not | |
2755 | result from one of the above expansions are removed. | |
2756 | </P><P> | |
2757 | ||
2758 | <A NAME="Redirections"></A> | |
2759 | <HR SIZE="6"> | |
2760 | <A NAME="SEC39"></A> | |
2761 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2762 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> < </A>]</TD> | |
2763 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> > </A>]</TD> | |
2764 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> << </A>]</TD> | |
2765 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
2766 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2767 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2768 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2769 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2770 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2771 | </TR></TABLE> | |
2772 | <H2> 3.6 Redirections </H2> | |
2773 | <!--docid::SEC39::--> | |
2774 | <P> | |
2775 | ||
2776 | Before a command is executed, its input and output | |
2777 | may be <VAR>redirected</VAR> | |
2778 | using a special notation interpreted by the shell. | |
2779 | Redirection may also be used to open and close files for the | |
2780 | current shell execution environment. The following redirection | |
2781 | operators may precede or appear anywhere within a | |
2782 | simple command or may follow a command. | |
2783 | Redirections are processed in the order they appear, from | |
2784 | left to right. | |
2785 | </P><P> | |
2786 | ||
2787 | In the following descriptions, if the file descriptor number is | |
2788 | omitted, and the first character of the redirection operator is | |
2789 | <SAMP>`<'</SAMP>, the redirection refers to the standard input (file | |
2790 | descriptor 0). If the first character of the redirection operator | |
2791 | is <SAMP>`>'</SAMP>, the redirection refers to the standard output (file | |
2792 | descriptor 1). | |
2793 | </P><P> | |
2794 | ||
2795 | The word following the redirection operator in the following | |
2796 | descriptions, unless otherwise noted, is subjected to brace expansion, | |
2797 | tilde expansion, parameter expansion, command substitution, arithmetic | |
2798 | expansion, quote removal, filename expansion, and word splitting. | |
2799 | If it expands to more than one word, Bash reports an error. | |
2800 | </P><P> | |
2801 | ||
2802 | Note that the order of redirections is significant. For example, | |
2803 | the command | |
2804 | <TABLE><tr><td> </td><td class=example><pre>ls > <VAR>dirlist</VAR> 2>&1 | |
2805 | </pre></td></tr></table>directs both standard output (file descriptor 1) and standard error | |
2806 | (file descriptor 2) to the file <VAR>dirlist</VAR>, while the command | |
2807 | <TABLE><tr><td> </td><td class=example><pre>ls 2>&1 > <VAR>dirlist</VAR> | |
2808 | </pre></td></tr></table>directs only the standard output to file <VAR>dirlist</VAR>, | |
2809 | because the standard error was duplicated as standard output | |
2810 | before the standard output was redirected to <VAR>dirlist</VAR>. | |
2811 | </P><P> | |
2812 | ||
2813 | Bash handles several filenames specially when they are used in | |
2814 | redirections, as described in the following table: | |
2815 | </P><P> | |
2816 | ||
2817 | <DL COMPACT> | |
2818 | <DT><CODE>/dev/fd/<VAR>fd</VAR></CODE> | |
2819 | <DD>If <VAR>fd</VAR> is a valid integer, file descriptor <VAR>fd</VAR> is duplicated. | |
2820 | <P> | |
2821 | ||
2822 | <DT><CODE>/dev/stdin</CODE> | |
2823 | <DD>File descriptor 0 is duplicated. | |
2824 | <P> | |
2825 | ||
2826 | <DT><CODE>/dev/stdout</CODE> | |
2827 | <DD>File descriptor 1 is duplicated. | |
2828 | <P> | |
2829 | ||
2830 | <DT><CODE>/dev/stderr</CODE> | |
2831 | <DD>File descriptor 2 is duplicated. | |
2832 | <P> | |
2833 | ||
2834 | <DT><CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE> | |
2835 | <DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR> | |
2836 | is an integer port number or service name, Bash attempts to open a TCP | |
2837 | connection to the corresponding socket. | |
2838 | <P> | |
2839 | ||
2840 | <DT><CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE> | |
2841 | <DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR> | |
2842 | is an integer port number or service name, Bash attempts to open a UDP | |
2843 | connection to the corresponding socket. | |
2844 | <P> | |
2845 | ||
2846 | </DL> | |
2847 | <P> | |
2848 | ||
2849 | A failure to open or create a file causes the redirection to fail. | |
2850 | </P><P> | |
2851 | ||
2852 | Redirections using file descriptors greater than 9 should be used with | |
2853 | care, as they may conflict with file descriptors the shell uses | |
2854 | internally. | |
2855 | </P><P> | |
2856 | ||
2857 | <HR SIZE="6"> | |
2858 | <A NAME="SEC40"></A> | |
2859 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2860 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> < </A>]</TD> | |
2861 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> > </A>]</TD> | |
2862 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> << </A>]</TD> | |
2863 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
2864 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2865 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2866 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2867 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2868 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2869 | </TR></TABLE> | |
2870 | <H3> 3.6.1 Redirecting Input </H3> | |
2871 | <!--docid::SEC40::--> | |
2872 | Redirection of input causes the file whose name results from | |
2873 | the expansion of <VAR>word</VAR> | |
2874 | to be opened for reading on file descriptor <CODE>n</CODE>, | |
2875 | or the standard input (file descriptor 0) if <CODE>n</CODE> | |
2876 | is not specified. | |
2877 | <P> | |
2878 | ||
2879 | The general format for redirecting input is: | |
2880 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<<VAR>word</VAR> | |
2881 | </pre></td></tr></table></P><P> | |
2882 | ||
2883 | <HR SIZE="6"> | |
2884 | <A NAME="SEC41"></A> | |
2885 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2886 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> < </A>]</TD> | |
2887 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> > </A>]</TD> | |
2888 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> << </A>]</TD> | |
2889 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
2890 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2891 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2892 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2893 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2894 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2895 | </TR></TABLE> | |
2896 | <H3> 3.6.2 Redirecting Output </H3> | |
2897 | <!--docid::SEC41::--> | |
2898 | Redirection of output causes the file whose name results from | |
2899 | the expansion of <VAR>word</VAR> | |
2900 | to be opened for writing on file descriptor <VAR>n</VAR>, | |
2901 | or the standard output (file descriptor 1) if <VAR>n</VAR> | |
2902 | is not specified. If the file does not exist it is created; | |
2903 | if it does exist it is truncated to zero size. | |
2904 | <P> | |
2905 | ||
2906 | The general format for redirecting output is: | |
2907 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>[|]<VAR>word</VAR> | |
2908 | </pre></td></tr></table></P><P> | |
2909 | ||
2910 | If the redirection operator is <SAMP>`>'</SAMP>, and the <CODE>noclobber</CODE> | |
2911 | option to the <CODE>set</CODE> builtin has been enabled, the redirection | |
2912 | will fail if the file whose name results from the expansion of | |
2913 | <VAR>word</VAR> exists and is a regular file. | |
2914 | If the redirection operator is <SAMP>`>|'</SAMP>, or the redirection operator is | |
2915 | <SAMP>`>'</SAMP> and the <CODE>noclobber</CODE> option is not enabled, the redirection | |
2916 | is attempted even if the file named by <VAR>word</VAR> exists. | |
2917 | </P><P> | |
2918 | ||
2919 | <HR SIZE="6"> | |
2920 | <A NAME="SEC42"></A> | |
2921 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2922 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> < </A>]</TD> | |
2923 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> > </A>]</TD> | |
2924 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> << </A>]</TD> | |
2925 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
2926 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2927 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2928 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2929 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2930 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2931 | </TR></TABLE> | |
2932 | <H3> 3.6.3 Appending Redirected Output </H3> | |
2933 | <!--docid::SEC42::--> | |
2934 | Redirection of output in this fashion | |
2935 | causes the file whose name results from | |
2936 | the expansion of <VAR>word</VAR> | |
2937 | to be opened for appending on file descriptor <VAR>n</VAR>, | |
2938 | or the standard output (file descriptor 1) if <VAR>n</VAR> | |
2939 | is not specified. If the file does not exist it is created. | |
2940 | <P> | |
2941 | ||
2942 | The general format for appending output is: | |
2943 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>><VAR>word</VAR> | |
2944 | </pre></td></tr></table></P><P> | |
2945 | ||
2946 | <HR SIZE="6"> | |
2947 | <A NAME="SEC43"></A> | |
2948 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2949 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> < </A>]</TD> | |
2950 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> > </A>]</TD> | |
2951 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> << </A>]</TD> | |
2952 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
2953 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2954 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2955 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2956 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2957 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2958 | </TR></TABLE> | |
2959 | <H3> 3.6.4 Redirecting Standard Output and Standard Error </H3> | |
2960 | <!--docid::SEC43::--> | |
2961 | This construct allows both the | |
2962 | standard output (file descriptor 1) and | |
2963 | the standard error output (file descriptor 2) | |
2964 | to be redirected to the file whose name is the | |
2965 | expansion of <VAR>word</VAR>. | |
2966 | <P> | |
2967 | ||
2968 | There are two formats for redirecting standard output and | |
2969 | standard error: | |
2970 | <TABLE><tr><td> </td><td class=example><pre>&><VAR>word</VAR> | |
2971 | </pre></td></tr></table>and | |
2972 | <TABLE><tr><td> </td><td class=example><pre>>&<VAR>word</VAR> | |
2973 | </pre></td></tr></table>Of the two forms, the first is preferred. | |
2974 | This is semantically equivalent to | |
2975 | <TABLE><tr><td> </td><td class=example><pre>><VAR>word</VAR> 2>&1 | |
2976 | </pre></td></tr></table></P><P> | |
2977 | ||
2978 | <HR SIZE="6"> | |
2979 | <A NAME="SEC44"></A> | |
2980 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
2981 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> < </A>]</TD> | |
2982 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> > </A>]</TD> | |
2983 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> << </A>]</TD> | |
2984 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
2985 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
2986 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
2987 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
2988 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
2989 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
2990 | </TR></TABLE> | |
2991 | <H3> 3.6.5 Appending Standard Output and Standard Error </H3> | |
2992 | <!--docid::SEC44::--> | |
2993 | This construct allows both the | |
2994 | standard output (file descriptor 1) and | |
2995 | the standard error output (file descriptor 2) | |
2996 | to be appended to the file whose name is the | |
2997 | expansion of <VAR>word</VAR>. | |
2998 | <P> | |
2999 | ||
3000 | The format for appending standard output and standard error is: | |
3001 | <TABLE><tr><td> </td><td class=example><pre>&>><VAR>word</VAR> | |
3002 | </pre></td></tr></table>This is semantically equivalent to | |
3003 | <TABLE><tr><td> </td><td class=example><pre>>><VAR>word</VAR> 2>&1 | |
3004 | </pre></td></tr></table></P><P> | |
3005 | ||
3006 | <HR SIZE="6"> | |
3007 | <A NAME="SEC45"></A> | |
3008 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3009 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> < </A>]</TD> | |
3010 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> > </A>]</TD> | |
3011 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> << </A>]</TD> | |
3012 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3013 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3014 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3015 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3016 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3017 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3018 | </TR></TABLE> | |
3019 | <H3> 3.6.6 Here Documents </H3> | |
3020 | <!--docid::SEC45::--> | |
3021 | This type of redirection instructs the shell to read input from the | |
3022 | current source until a line containing only <VAR>word</VAR> | |
3023 | (with no trailing blanks) is seen. All of | |
3024 | the lines read up to that point are then used as the standard | |
3025 | input for a command. | |
3026 | <P> | |
3027 | ||
3028 | The format of here-documents is: | |
3029 | <TABLE><tr><td> </td><td class=example><pre><<[-]<VAR>word</VAR> | |
3030 | <VAR>here-document</VAR> | |
3031 | <VAR>delimiter</VAR> | |
3032 | </pre></td></tr></table></P><P> | |
3033 | ||
3034 | No parameter expansion, command substitution, arithmetic expansion, | |
3035 | or filename expansion is performed on | |
3036 | <VAR>word</VAR>. If any characters in <VAR>word</VAR> are quoted, the | |
3037 | <VAR>delimiter</VAR> is the result of quote removal on <VAR>word</VAR>, | |
3038 | and the lines in the here-document are not expanded. | |
3039 | If <VAR>word</VAR> is unquoted, | |
3040 | all lines of the here-document are subjected to parameter expansion, | |
3041 | command substitution, and arithmetic expansion. In the latter | |
3042 | case, the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP> | |
3043 | must be used to quote the characters | |
3044 | <SAMP>`\'</SAMP>, <SAMP>`$'</SAMP>, and <SAMP>``'</SAMP>. | |
3045 | </P><P> | |
3046 | ||
3047 | If the redirection operator is <SAMP>`<<-'</SAMP>, | |
3048 | then all leading tab characters are stripped from input lines and the | |
3049 | line containing <VAR>delimiter</VAR>. | |
3050 | This allows here-documents within shell scripts to be indented in a | |
3051 | natural fashion. | |
3052 | </P><P> | |
3053 | ||
3054 | <HR SIZE="6"> | |
3055 | <A NAME="SEC46"></A> | |
3056 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3057 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> < </A>]</TD> | |
3058 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> > </A>]</TD> | |
3059 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> << </A>]</TD> | |
3060 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3061 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3062 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3063 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3064 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3065 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3066 | </TR></TABLE> | |
3067 | <H3> 3.6.7 Here Strings </H3> | |
3068 | <!--docid::SEC46::--> | |
3069 | A variant of here documents, the format is: | |
3070 | <TABLE><tr><td> </td><td class=example><pre><<< <VAR>word</VAR> | |
3071 | </pre></td></tr></table><P> | |
3072 | ||
3073 | The <VAR>word</VAR> is expanded and supplied to the command on its standard | |
3074 | input. | |
3075 | </P><P> | |
3076 | ||
3077 | <HR SIZE="6"> | |
3078 | <A NAME="SEC47"></A> | |
3079 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3080 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> < </A>]</TD> | |
3081 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> > </A>]</TD> | |
3082 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> << </A>]</TD> | |
3083 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3084 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3085 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3086 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3087 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3088 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3089 | </TR></TABLE> | |
3090 | <H3> 3.6.8 Duplicating File Descriptors </H3> | |
3091 | <!--docid::SEC47::--> | |
3092 | The redirection operator | |
3093 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>word</VAR> | |
3094 | </pre></td></tr></table>is used to duplicate input file descriptors. | |
3095 | If <VAR>word</VAR> | |
3096 | expands to one or more digits, the file descriptor denoted by <VAR>n</VAR> | |
3097 | is made to be a copy of that file descriptor. | |
3098 | If the digits in <VAR>word</VAR> do not specify a file descriptor open for | |
3099 | input, a redirection error occurs. | |
3100 | If <VAR>word</VAR> | |
3101 | evaluates to <SAMP>`-'</SAMP>, file descriptor <VAR>n</VAR> is closed. If | |
3102 | <VAR>n</VAR> is not specified, the standard input (file descriptor 0) is used. | |
3103 | <P> | |
3104 | ||
3105 | The operator | |
3106 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>word</VAR> | |
3107 | </pre></td></tr></table>is used similarly to duplicate output file descriptors. If | |
3108 | <VAR>n</VAR> is not specified, the standard output (file descriptor 1) is used. | |
3109 | If the digits in <VAR>word</VAR> do not specify a file descriptor open for | |
3110 | output, a redirection error occurs. | |
3111 | As a special case, if <VAR>n</VAR> is omitted, and <VAR>word</VAR> does not | |
3112 | expand to one or more digits, the standard output and standard | |
3113 | error are redirected as described previously. | |
3114 | </P><P> | |
3115 | ||
3116 | <HR SIZE="6"> | |
3117 | <A NAME="SEC48"></A> | |
3118 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3119 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> < </A>]</TD> | |
3120 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> > </A>]</TD> | |
3121 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> << </A>]</TD> | |
3122 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3123 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3124 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3125 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3126 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3127 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3128 | </TR></TABLE> | |
3129 | <H3> 3.6.9 Moving File Descriptors </H3> | |
3130 | <!--docid::SEC48::--> | |
3131 | The redirection operator | |
3132 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>digit</VAR>- | |
3133 | </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>, | |
3134 | or the standard input (file descriptor 0) if <VAR>n</VAR> is not specified. | |
3135 | <VAR>digit</VAR> is closed after being duplicated to <VAR>n</VAR>. | |
3136 | <P> | |
3137 | ||
3138 | Similarly, the redirection operator | |
3139 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>digit</VAR>- | |
3140 | </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>, | |
3141 | or the standard output (file descriptor 1) if <VAR>n</VAR> is not specified. | |
3142 | </P><P> | |
3143 | ||
3144 | <HR SIZE="6"> | |
3145 | <A NAME="SEC49"></A> | |
3146 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3147 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> < </A>]</TD> | |
3148 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> > </A>]</TD> | |
3149 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> << </A>]</TD> | |
3150 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD> | |
3151 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD> | |
3152 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3153 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3154 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3155 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3156 | </TR></TABLE> | |
3157 | <H3> 3.6.10 Opening File Descriptors for Reading and Writing </H3> | |
3158 | <!--docid::SEC49::--> | |
3159 | The redirection operator | |
3160 | <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<><VAR>word</VAR> | |
3161 | </pre></td></tr></table>causes the file whose name is the expansion of <VAR>word</VAR> | |
3162 | to be opened for both reading and writing on file descriptor | |
3163 | <VAR>n</VAR>, or on file descriptor 0 if <VAR>n</VAR> | |
3164 | is not specified. If the file does not exist, it is created. | |
3165 | <P> | |
3166 | ||
3167 | <A NAME="Executing Commands"></A> | |
3168 | <HR SIZE="6"> | |
3169 | <A NAME="SEC50"></A> | |
3170 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3171 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> < </A>]</TD> | |
3172 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> > </A>]</TD> | |
3173 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD> | |
3174 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
3175 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3176 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3177 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3178 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3179 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3180 | </TR></TABLE> | |
3181 | <H2> 3.7 Executing Commands </H2> | |
3182 | <!--docid::SEC50::--> | |
3183 | <P> | |
3184 | ||
3185 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
3186 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands simple commands before | |
3187 | executing them.</TD></TR> | |
3188 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash finds commands and runs them.</TD></TR> | |
3189 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment in which Bash | |
3190 | executes commands that are not | |
3191 | shell builtins.</TD></TR> | |
3192 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC54">3.7.4 Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment given to a command.</TD></TR> | |
3193 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC55">3.7.5 Exit Status</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The status returned by commands and how Bash | |
3194 | interprets it.</TD></TR> | |
3195 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC56">3.7.6 Signals</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What happens when Bash or a command it runs | |
3196 | receives a signal.</TD></TR> | |
3197 | </TABLE></BLOCKQUOTE> | |
3198 | <P> | |
3199 | ||
3200 | <A NAME="Simple Command Expansion"></A> | |
3201 | <HR SIZE="6"> | |
3202 | <A NAME="SEC51"></A> | |
3203 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3204 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> < </A>]</TD> | |
3205 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> > </A>]</TD> | |
3206 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD> | |
3207 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3208 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3209 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3210 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3211 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3212 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3213 | </TR></TABLE> | |
3214 | <H3> 3.7.1 Simple Command Expansion </H3> | |
3215 | <!--docid::SEC51::--> | |
3216 | <P> | |
3217 | ||
3218 | When a simple command is executed, the shell performs the following | |
3219 | expansions, assignments, and redirections, from left to right. | |
3220 | </P><P> | |
3221 | ||
3222 | <OL> | |
3223 | <LI> | |
3224 | The words that the parser has marked as variable assignments (those | |
3225 | preceding the command name) and redirections are saved for later | |
3226 | processing. | |
3227 | <P> | |
3228 | ||
3229 | <LI> | |
3230 | The words that are not variable assignments or redirections are | |
3231 | expanded (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>). | |
3232 | If any words remain after expansion, the first word | |
3233 | is taken to be the name of the command and the remaining words are | |
3234 | the arguments. | |
3235 | <P> | |
3236 | ||
3237 | <LI> | |
3238 | Redirections are performed as described above (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
3239 | <P> | |
3240 | ||
3241 | <LI> | |
3242 | The text after the <SAMP>`='</SAMP> in each variable assignment undergoes tilde | |
3243 | expansion, parameter expansion, command substitution, arithmetic expansion, | |
3244 | and quote removal before being assigned to the variable. | |
3245 | </OL> | |
3246 | <P> | |
3247 | ||
3248 | If no command name results, the variable assignments affect the current | |
3249 | shell environment. Otherwise, the variables are added to the environment | |
3250 | of the executed command and do not affect the current shell environment. | |
3251 | If any of the assignments attempts to assign a value to a readonly variable, | |
3252 | an error occurs, and the command exits with a non-zero status. | |
3253 | </P><P> | |
3254 | ||
3255 | If no command name results, redirections are performed, but do not | |
3256 | affect the current shell environment. A redirection error causes the | |
3257 | command to exit with a non-zero status. | |
3258 | </P><P> | |
3259 | ||
3260 | If there is a command name left after expansion, execution proceeds as | |
3261 | described below. Otherwise, the command exits. If one of the expansions | |
3262 | contained a command substitution, the exit status of the command is | |
3263 | the exit status of the last command substitution performed. If there | |
3264 | were no command substitutions, the command exits with a status of zero. | |
3265 | </P><P> | |
3266 | ||
3267 | <A NAME="Command Search and Execution"></A> | |
3268 | <HR SIZE="6"> | |
3269 | <A NAME="SEC52"></A> | |
3270 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3271 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> < </A>]</TD> | |
3272 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> > </A>]</TD> | |
3273 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> << </A>]</TD> | |
3274 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3275 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3276 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3277 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3278 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3279 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3280 | </TR></TABLE> | |
3281 | <H3> 3.7.2 Command Search and Execution </H3> | |
3282 | <!--docid::SEC52::--> | |
3283 | <P> | |
3284 | ||
3285 | After a command has been split into words, if it results in a | |
3286 | simple command and an optional list of arguments, the following | |
3287 | actions are taken. | |
3288 | </P><P> | |
3289 | ||
3290 | <OL> | |
3291 | <LI> | |
3292 | If the command name contains no slashes, the shell attempts to | |
3293 | locate it. If there exists a shell function by that name, that | |
3294 | function is invoked as described in <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>. | |
3295 | <P> | |
3296 | ||
3297 | <LI> | |
3298 | If the name does not match a function, the shell searches for | |
3299 | it in the list of shell builtins. If a match is found, that | |
3300 | builtin is invoked. | |
3301 | <P> | |
3302 | ||
3303 | <LI> | |
3304 | If the name is neither a shell function nor a builtin, | |
3305 | and contains no slashes, Bash searches each element of | |
3306 | <CODE>$PATH</CODE> for a directory containing an executable file | |
3307 | by that name. Bash uses a hash table to remember the full | |
3308 | pathnames of executable files to avoid multiple <CODE>PATH</CODE> searches | |
3309 | (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
3310 | A full search of the directories in <CODE>$PATH</CODE> | |
3311 | is performed only if the command is not found in the hash table. | |
3312 | If the search is unsuccessful, the shell searches for a defined shell | |
3313 | function named <CODE>command_not_found_handle</CODE>. | |
3314 | If that function exists, it is invoked with the original command and | |
3315 | the original command's arguments as its arguments, and the function's | |
3316 | exit status becomes the exit status of the shell. | |
3317 | If that function is not defined, the shell prints an error | |
3318 | message and returns an exit status of 127. | |
3319 | <P> | |
3320 | ||
3321 | <LI> | |
3322 | If the search is successful, or if the command name contains | |
3323 | one or more slashes, the shell executes the named program in | |
3324 | a separate execution environment. | |
3325 | Argument 0 is set to the name given, and the remaining arguments | |
3326 | to the command are set to the arguments supplied, if any. | |
3327 | <P> | |
3328 | ||
3329 | <LI> | |
3330 | If this execution fails because the file is not in executable | |
3331 | format, and the file is not a directory, it is assumed to be a | |
3332 | <VAR>shell script</VAR> and the shell executes it as described in | |
3333 | <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>. | |
3334 | <P> | |
3335 | ||
3336 | <LI> | |
3337 | If the command was not begun asynchronously, the shell waits for | |
3338 | the command to complete and collects its exit status. | |
3339 | <P> | |
3340 | ||
3341 | </OL> | |
3342 | <P> | |
3343 | ||
3344 | <A NAME="Command Execution Environment"></A> | |
3345 | <HR SIZE="6"> | |
3346 | <A NAME="SEC53"></A> | |
3347 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3348 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> < </A>]</TD> | |
3349 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> > </A>]</TD> | |
3350 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> << </A>]</TD> | |
3351 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3352 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3353 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3354 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3355 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3356 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3357 | </TR></TABLE> | |
3358 | <H3> 3.7.3 Command Execution Environment </H3> | |
3359 | <!--docid::SEC53::--> | |
3360 | <P> | |
3361 | ||
3362 | The shell has an <VAR>execution environment</VAR>, which consists of the | |
3363 | following: | |
3364 | </P><P> | |
3365 | ||
3366 | <UL> | |
3367 | <LI> | |
3368 | open files inherited by the shell at invocation, as modified by | |
3369 | redirections supplied to the <CODE>exec</CODE> builtin | |
3370 | <P> | |
3371 | ||
3372 | <LI> | |
3373 | the current working directory as set by <CODE>cd</CODE>, <CODE>pushd</CODE>, or | |
3374 | <CODE>popd</CODE>, or inherited by the shell at invocation | |
3375 | <P> | |
3376 | ||
3377 | <LI> | |
3378 | the file creation mode mask as set by <CODE>umask</CODE> or inherited from | |
3379 | the shell's parent | |
3380 | <P> | |
3381 | ||
3382 | <LI> | |
3383 | current traps set by <CODE>trap</CODE> | |
3384 | <P> | |
3385 | ||
3386 | <LI> | |
3387 | shell parameters that are set by variable assignment or with <CODE>set</CODE> | |
3388 | or inherited from the shell's parent in the environment | |
3389 | <P> | |
3390 | ||
3391 | <LI> | |
3392 | shell functions defined during execution or inherited from the shell's | |
3393 | parent in the environment | |
3394 | <P> | |
3395 | ||
3396 | <LI> | |
3397 | options enabled at invocation (either by default or with command-line | |
3398 | arguments) or by <CODE>set</CODE> | |
3399 | <P> | |
3400 | ||
3401 | <LI> | |
3402 | options enabled by <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) | |
3403 | <P> | |
3404 | ||
3405 | <LI> | |
3406 | shell aliases defined with <CODE>alias</CODE> (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>) | |
3407 | <P> | |
3408 | ||
3409 | <LI> | |
3410 | various process IDs, including those of background jobs | |
3411 | (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the value of <CODE>$$</CODE>, and the value of | |
3412 | <CODE>$PPID</CODE> | |
3413 | <P> | |
3414 | ||
3415 | </UL> | |
3416 | <P> | |
3417 | ||
3418 | When a simple command other than a builtin or shell function | |
3419 | is to be executed, it | |
3420 | is invoked in a separate execution environment that consists of | |
3421 | the following. Unless otherwise noted, the values are inherited | |
3422 | from the shell. | |
3423 | </P><P> | |
3424 | ||
3425 | <UL> | |
3426 | <LI> | |
3427 | the shell's open files, plus any modifications and additions specified | |
3428 | by redirections to the command | |
3429 | <P> | |
3430 | ||
3431 | <LI> | |
3432 | the current working directory | |
3433 | <P> | |
3434 | ||
3435 | <LI> | |
3436 | the file creation mode mask | |
3437 | <P> | |
3438 | ||
3439 | <LI> | |
3440 | shell variables and functions marked for export, along with variables | |
3441 | exported for the command, passed in the environment (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>) | |
3442 | <P> | |
3443 | ||
3444 | <LI> | |
3445 | traps caught by the shell are reset to the values inherited from the | |
3446 | shell's parent, and traps ignored by the shell are ignored | |
3447 | <P> | |
3448 | ||
3449 | </UL> | |
3450 | <P> | |
3451 | ||
3452 | A command invoked in this separate environment cannot affect the | |
3453 | shell's execution environment. | |
3454 | </P><P> | |
3455 | ||
3456 | Command substitution, commands grouped with parentheses, | |
3457 | and asynchronous commands are invoked in a | |
3458 | subshell environment that is a duplicate of the shell environment, | |
3459 | except that traps caught by the shell are reset to the values | |
3460 | that the shell inherited from its parent at invocation. Builtin | |
3461 | commands that are invoked as part of a pipeline are also executed | |
3462 | in a subshell environment. Changes made to the subshell environment | |
3463 | cannot affect the shell's execution environment. | |
3464 | </P><P> | |
3465 | ||
3466 | Subshells spawned to execute command substitutions inherit the value of | |
3467 | the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode, | |
3468 | Bash clears the <SAMP>`-e'</SAMP> option in such subshells. | |
3469 | </P><P> | |
3470 | ||
3471 | If a command is followed by a <SAMP>`&'</SAMP> and job control is not active, the | |
3472 | default standard input for the command is the empty file <TT>`/dev/null'</TT>. | |
3473 | Otherwise, the invoked command inherits the file descriptors of the calling | |
3474 | shell as modified by redirections. | |
3475 | </P><P> | |
3476 | ||
3477 | <A NAME="Environment"></A> | |
3478 | <HR SIZE="6"> | |
3479 | <A NAME="SEC54"></A> | |
3480 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3481 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> < </A>]</TD> | |
3482 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> > </A>]</TD> | |
3483 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> << </A>]</TD> | |
3484 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3485 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3486 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3487 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3488 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3489 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3490 | </TR></TABLE> | |
3491 | <H3> 3.7.4 Environment </H3> | |
3492 | <!--docid::SEC54::--> | |
3493 | <P> | |
3494 | ||
3495 | When a program is invoked it is given an array of strings | |
3496 | called the <VAR>environment</VAR>. | |
3497 | This is a list of name-value pairs, of the form <CODE>name=value</CODE>. | |
3498 | </P><P> | |
3499 | ||
3500 | Bash provides several ways to manipulate the environment. | |
3501 | On invocation, the shell scans its own environment and | |
3502 | creates a parameter for each name found, automatically marking | |
3503 | it for <VAR>export</VAR> | |
3504 | to child processes. Executed commands inherit the environment. | |
3505 | The <CODE>export</CODE> and <SAMP>`declare -x'</SAMP> | |
3506 | commands allow parameters and functions to be added to and | |
3507 | deleted from the environment. If the value of a parameter | |
3508 | in the environment is modified, the new value becomes part | |
3509 | of the environment, replacing the old. The environment | |
3510 | inherited by any executed command consists of the shell's | |
3511 | initial environment, whose values may be modified in the shell, | |
3512 | less any pairs removed by the <CODE>unset</CODE> and <SAMP>`export -n'</SAMP> | |
3513 | commands, plus any additions via the <CODE>export</CODE> and | |
3514 | <SAMP>`declare -x'</SAMP> commands. | |
3515 | </P><P> | |
3516 | ||
3517 | The environment for any simple command | |
3518 | or function may be augmented temporarily by prefixing it with | |
3519 | parameter assignments, as described in <A HREF="bashref.html#SEC25">3.4 Shell Parameters</A>. | |
3520 | These assignment statements affect only the environment seen | |
3521 | by that command. | |
3522 | </P><P> | |
3523 | ||
3524 | If the <SAMP>`-k'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), then all | |
3525 | parameter assignments are placed in the environment for a command, | |
3526 | not just those that precede the command name. | |
3527 | </P><P> | |
3528 | ||
3529 | When Bash invokes an external command, the variable <SAMP>`$_'</SAMP> | |
3530 | is set to the full path name of the command and passed to that | |
3531 | command in its environment. | |
3532 | </P><P> | |
3533 | ||
3534 | <A NAME="Exit Status"></A> | |
3535 | <HR SIZE="6"> | |
3536 | <A NAME="SEC55"></A> | |
3537 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3538 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> < </A>]</TD> | |
3539 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> > </A>]</TD> | |
3540 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> << </A>]</TD> | |
3541 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3542 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3543 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3544 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3545 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3546 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3547 | </TR></TABLE> | |
3548 | <H3> 3.7.5 Exit Status </H3> | |
3549 | <!--docid::SEC55::--> | |
3550 | <P> | |
3551 | ||
3552 | The exit status of an executed command is the value returned by the | |
3553 | <VAR>waitpid</VAR> system call or equivalent function. Exit statuses | |
3554 | fall between 0 and 255, though, as explained below, the shell may | |
3555 | use values above 125 specially. Exit statuses from shell builtins and | |
3556 | compound commands are also limited to this range. Under certain | |
3557 | circumstances, the shell will use special values to indicate specific | |
3558 | failure modes. | |
3559 | </P><P> | |
3560 | ||
3561 | For the shell's purposes, a command which exits with a | |
3562 | zero exit status has succeeded. | |
3563 | A non-zero exit status indicates failure. | |
3564 | This seemingly counter-intuitive scheme is used so there | |
3565 | is one well-defined way to indicate success and a variety of | |
3566 | ways to indicate various failure modes. | |
3567 | When a command terminates on a fatal signal whose number is <VAR>N</VAR>, | |
3568 | Bash uses the value 128+<VAR>N</VAR> as the exit status. | |
3569 | </P><P> | |
3570 | ||
3571 | If a command is not found, the child process created to | |
3572 | execute it returns a status of 127. If a command is found | |
3573 | but is not executable, the return status is 126. | |
3574 | </P><P> | |
3575 | ||
3576 | If a command fails because of an error during expansion or redirection, | |
3577 | the exit status is greater than zero. | |
3578 | </P><P> | |
3579 | ||
3580 | The exit status is used by the Bash conditional commands | |
3581 | (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) and some of the list | |
3582 | constructs (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>). | |
3583 | </P><P> | |
3584 | ||
3585 | All of the Bash builtins return an exit status of zero if they succeed | |
3586 | and a non-zero status on failure, so they may be used by the | |
3587 | conditional and list constructs. | |
3588 | All builtins return an exit status of 2 to indicate incorrect usage. | |
3589 | </P><P> | |
3590 | ||
3591 | <A NAME="Signals"></A> | |
3592 | <HR SIZE="6"> | |
3593 | <A NAME="SEC56"></A> | |
3594 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3595 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> < </A>]</TD> | |
3596 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> > </A>]</TD> | |
3597 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD> | |
3598 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD> | |
3599 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD> | |
3600 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3601 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3602 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3603 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3604 | </TR></TABLE> | |
3605 | <H3> 3.7.6 Signals </H3> | |
3606 | <!--docid::SEC56::--> | |
3607 | <P> | |
3608 | ||
3609 | When Bash is interactive, in the absence of any traps, it ignores | |
3610 | <CODE>SIGTERM</CODE> (so that <SAMP>`kill 0'</SAMP> does not kill an interactive shell), | |
3611 | and <CODE>SIGINT</CODE> | |
3612 | is caught and handled (so that the <CODE>wait</CODE> builtin is interruptible). | |
3613 | When Bash receives a <CODE>SIGINT</CODE>, it breaks out of any executing loops. | |
3614 | In all cases, Bash ignores <CODE>SIGQUIT</CODE>. | |
3615 | If job control is in effect (see section <A HREF="bashref.html#SEC91">7. Job Control</A>), Bash | |
3616 | ignores <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>. | |
3617 | </P><P> | |
3618 | ||
3619 | Non-builtin commands started by Bash have signal handlers set to the | |
3620 | values inherited by the shell from its parent. | |
3621 | When job control is not in effect, asynchronous commands | |
3622 | ignore <CODE>SIGINT</CODE> and <CODE>SIGQUIT</CODE> in addition to these inherited | |
3623 | handlers. | |
3624 | Commands run as a result of | |
3625 | command substitution ignore the keyboard-generated job control signals | |
3626 | <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>. | |
3627 | </P><P> | |
3628 | ||
3629 | The shell exits by default upon receipt of a <CODE>SIGHUP</CODE>. | |
3630 | Before exiting, an interactive shell resends the <CODE>SIGHUP</CODE> to | |
3631 | all jobs, running or stopped. | |
3632 | Stopped jobs are sent <CODE>SIGCONT</CODE> to ensure that they receive | |
3633 | the <CODE>SIGHUP</CODE>. | |
3634 | To prevent the shell from sending the <CODE>SIGHUP</CODE> signal to a | |
3635 | particular job, it should be removed | |
3636 | from the jobs table with the <CODE>disown</CODE> | |
3637 | builtin (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or marked | |
3638 | to not receive <CODE>SIGHUP</CODE> using <CODE>disown -h</CODE>. | |
3639 | </P><P> | |
3640 | ||
3641 | If the <CODE>huponexit</CODE> shell option has been set with <CODE>shopt</CODE> | |
3642 | (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), Bash sends a <CODE>SIGHUP</CODE> to all jobs when | |
3643 | an interactive login shell exits. | |
3644 | </P><P> | |
3645 | ||
3646 | If Bash is waiting for a command to complete and receives a signal | |
3647 | for which a trap has been set, the trap will not be executed until | |
3648 | the command completes. | |
3649 | When Bash is waiting for an asynchronous | |
3650 | command via the <CODE>wait</CODE> builtin, the reception of a signal for | |
3651 | which a trap has been set will cause the <CODE>wait</CODE> builtin to return | |
3652 | immediately with an exit status greater than 128, immediately after | |
3653 | which the trap is executed. | |
3654 | </P><P> | |
3655 | ||
3656 | <A NAME="Shell Scripts"></A> | |
3657 | <HR SIZE="6"> | |
3658 | <A NAME="SEC57"></A> | |
3659 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3660 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> < </A>]</TD> | |
3661 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> > </A>]</TD> | |
3662 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> | |
3663 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> | |
3664 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD> | |
3665 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3666 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3667 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3668 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3669 | </TR></TABLE> | |
3670 | <H2> 3.8 Shell Scripts </H2> | |
3671 | <!--docid::SEC57::--> | |
3672 | <P> | |
3673 | ||
3674 | A shell script is a text file containing shell commands. When such | |
3675 | a file is used as the first non-option argument when invoking Bash, | |
3676 | and neither the <SAMP>`-c'</SAMP> nor <SAMP>`-s'</SAMP> option is supplied | |
3677 | (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>), | |
3678 | Bash reads and executes commands from the file, then exits. This | |
3679 | mode of operation creates a non-interactive shell. The shell first | |
3680 | searches for the file in the current directory, and looks in the | |
3681 | directories in <CODE>$PATH</CODE> if not found there. | |
3682 | </P><P> | |
3683 | ||
3684 | When Bash runs | |
3685 | a shell script, it sets the special parameter <CODE>0</CODE> to the name | |
3686 | of the file, rather than the name of the shell, and the positional | |
3687 | parameters are set to the remaining arguments, if any are given. | |
3688 | If no additional arguments are supplied, the positional parameters | |
3689 | are unset. | |
3690 | </P><P> | |
3691 | ||
3692 | A shell script may be made executable by using the <CODE>chmod</CODE> command | |
3693 | to turn on the execute bit. When Bash finds such a file while | |
3694 | searching the <CODE>$PATH</CODE> for a command, it spawns a subshell to | |
3695 | execute it. In other words, executing | |
3696 | <TABLE><tr><td> </td><td class=example><pre>filename <VAR>arguments</VAR> | |
3697 | </pre></td></tr></table>is equivalent to executing | |
3698 | <TABLE><tr><td> </td><td class=example><pre>bash filename <VAR>arguments</VAR> | |
3699 | </pre></td></tr></table></P><P> | |
3700 | ||
3701 | if <CODE>filename</CODE> is an executable shell script. | |
3702 | This subshell reinitializes itself, so that the effect is as if a | |
3703 | new shell had been invoked to interpret the script, with the | |
3704 | exception that the locations of commands remembered by the parent | |
3705 | (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) | |
3706 | are retained by the child. | |
3707 | </P><P> | |
3708 | ||
3709 | Most versions of Unix make this a part of the operating system's command | |
3710 | execution mechanism. If the first line of a script begins with | |
3711 | the two characters <SAMP>`#!'</SAMP>, the remainder of the line specifies | |
3712 | an interpreter for the program. | |
3713 | Thus, you can specify Bash, <CODE>awk</CODE>, Perl, or some other | |
3714 | interpreter and write the rest of the script file in that language. | |
3715 | </P><P> | |
3716 | ||
3717 | The arguments to the interpreter | |
3718 | consist of a single optional argument following the interpreter | |
3719 | name on the first line of the script file, followed by the name of | |
3720 | the script file, followed by the rest of the arguments. Bash | |
3721 | will perform this action on operating systems that do not handle it | |
3722 | themselves. Note that some older versions of Unix limit the interpreter | |
3723 | name and argument to a maximum of 32 characters. | |
3724 | </P><P> | |
3725 | ||
3726 | Bash scripts often begin with <CODE>#! /bin/bash</CODE> (assuming that | |
3727 | Bash has been installed in <TT>`/bin'</TT>), since this ensures that | |
3728 | Bash will be used to interpret the script, even if it is executed | |
3729 | under another shell. | |
3730 | </P><P> | |
3731 | ||
3732 | <A NAME="Shell Builtin Commands"></A> | |
3733 | <HR SIZE="6"> | |
3734 | <A NAME="SEC58"></A> | |
3735 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3736 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> < </A>]</TD> | |
3737 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> > </A>]</TD> | |
3738 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD> | |
3739 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
3740 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD> | |
3741 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3742 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3743 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3744 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3745 | </TR></TABLE> | |
3746 | <H1> 4. Shell Builtin Commands </H1> | |
3747 | <!--docid::SEC58::--> | |
3748 | <P> | |
3749 | ||
3750 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
3751 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands inherited from the Bourne | |
3752 | Shell.</TD></TR> | |
3753 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Table of builtins specific to Bash.</TD></TR> | |
3754 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC61">4.3 Modifying Shell Behavior</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtins to modify shell attributes and | |
3755 | optional behavior.</TD></TR> | |
3756 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC64">4.4 Special Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands classified specially by | |
3757 | POSIX.</TD></TR> | |
3758 | </TABLE></BLOCKQUOTE> | |
3759 | <P> | |
3760 | ||
3761 | Builtin commands are contained within the shell itself. | |
3762 | When the name of a builtin command is used as the first word of | |
3763 | a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>), the shell executes | |
3764 | the command directly, without invoking another program. | |
3765 | Builtin commands are necessary to implement functionality impossible | |
3766 | or inconvenient to obtain with separate utilities. | |
3767 | </P><P> | |
3768 | ||
3769 | This section briefly describes the builtins which Bash inherits from | |
3770 | the Bourne Shell, as well as the builtin commands which are unique | |
3771 | to or have been extended in Bash. | |
3772 | </P><P> | |
3773 | ||
3774 | Several builtin commands are described in other chapters: builtin | |
3775 | commands which provide the Bash interface to the job control | |
3776 | facilities (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>), the directory stack | |
3777 | (see section <A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A>), the command history | |
3778 | (see section <A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A>), and the programmable completion | |
3779 | facilities (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>). | |
3780 | </P><P> | |
3781 | ||
3782 | Many of the builtins have been extended by POSIX or Bash. | |
3783 | </P><P> | |
3784 | ||
3785 | Unless otherwise noted, each builtin command documented as accepting | |
3786 | options preceded by <SAMP>`-'</SAMP> accepts <SAMP>`--'</SAMP> | |
3787 | to signify the end of the options. | |
3788 | For example, the <CODE>:</CODE>, <CODE>true</CODE>, <CODE>false</CODE>, and <CODE>test</CODE> | |
3789 | builtins do not accept options. | |
3790 | </P><P> | |
3791 | ||
3792 | <A NAME="Bourne Shell Builtins"></A> | |
3793 | <HR SIZE="6"> | |
3794 | <A NAME="SEC59"></A> | |
3795 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
3796 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> < </A>]</TD> | |
3797 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> > </A>]</TD> | |
3798 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD> | |
3799 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD> | |
3800 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD> | |
3801 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
3802 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
3803 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
3804 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
3805 | </TR></TABLE> | |
3806 | <H2> 4.1 Bourne Shell Builtins </H2> | |
3807 | <!--docid::SEC59::--> | |
3808 | <P> | |
3809 | ||
3810 | The following shell builtin commands are inherited from the Bourne Shell. | |
3811 | These commands are implemented as specified by the POSIX standard. | |
3812 | </P><P> | |
3813 | ||
3814 | <DL COMPACT> | |
3815 | <DT><CODE>: (a colon)</CODE> | |
3816 | <DD><A NAME="IDX68"></A> | |
3817 | <TABLE><tr><td> </td><td class=example><pre>: [<VAR>arguments</VAR>] | |
3818 | </pre></td></tr></table>Do nothing beyond expanding <VAR>arguments</VAR> and performing redirections. | |
3819 | The return status is zero. | |
3820 | <P> | |
3821 | ||
3822 | <DT><CODE>. (a period)</CODE> | |
3823 | <DD><A NAME="IDX69"></A> | |
3824 | <TABLE><tr><td> </td><td class=example><pre>. <VAR>filename</VAR> [<VAR>arguments</VAR>] | |
3825 | </pre></td></tr></table>Read and execute commands from the <VAR>filename</VAR> argument in the | |
3826 | current shell context. If <VAR>filename</VAR> does not contain a slash, | |
3827 | the <CODE>PATH</CODE> variable is used to find <VAR>filename</VAR>. | |
3828 | When Bash is not in POSIX mode, the current directory is searched | |
3829 | if <VAR>filename</VAR> is not found in <CODE>$PATH</CODE>. | |
3830 | If any <VAR>arguments</VAR> are supplied, they become the positional | |
3831 | parameters when <VAR>filename</VAR> is executed. Otherwise the positional | |
3832 | parameters are unchanged. | |
3833 | The return status is the exit status of the last command executed, or | |
3834 | zero if no commands are executed. If <VAR>filename</VAR> is not found, or | |
3835 | cannot be read, the return status is non-zero. | |
3836 | This builtin is equivalent to <CODE>source</CODE>. | |
3837 | <P> | |
3838 | ||
3839 | <DT><CODE>break</CODE> | |
3840 | <DD><A NAME="IDX70"></A> | |
3841 | <TABLE><tr><td> </td><td class=example><pre>break [<VAR>n</VAR>] | |
3842 | </pre></td></tr></table>Exit from a <CODE>for</CODE>, <CODE>while</CODE>, <CODE>until</CODE>, or <CODE>select</CODE> loop. | |
3843 | If <VAR>n</VAR> is supplied, the <VAR>n</VAR>th enclosing loop is exited. | |
3844 | <VAR>n</VAR> must be greater than or equal to 1. | |
3845 | The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1. | |
3846 | <P> | |
3847 | ||
3848 | <DT><CODE>cd</CODE> | |
3849 | <DD><A NAME="IDX71"></A> | |
3850 | <TABLE><tr><td> </td><td class=example><pre>cd [-L|-P] [<VAR>directory</VAR>] | |
3851 | </pre></td></tr></table>Change the current working directory to <VAR>directory</VAR>. | |
3852 | If <VAR>directory</VAR> is not given, the value of the <CODE>HOME</CODE> shell | |
3853 | variable is used. | |
3854 | If the shell variable <CODE>CDPATH</CODE> exists, it is used as a search path. | |
3855 | If <VAR>directory</VAR> begins with a slash, <CODE>CDPATH</CODE> is not used. | |
3856 | <P> | |
3857 | ||
3858 | The <SAMP>`-P'</SAMP> option means to not follow symbolic links; symbolic | |
3859 | links are followed by default or with the <SAMP>`-L'</SAMP> option. | |
3860 | If <VAR>directory</VAR> is <SAMP>`-'</SAMP>, it is equivalent to <CODE>$OLDPWD</CODE>. | |
3861 | </P><P> | |
3862 | ||
3863 | If a non-empty directory name from <CODE>CDPATH</CODE> is used, or if | |
3864 | <SAMP>`-'</SAMP> is the first argument, and the directory change is | |
3865 | successful, the absolute pathname of the new working directory is | |
3866 | written to the standard output. | |
3867 | </P><P> | |
3868 | ||
3869 | The return status is zero if the directory is successfully changed, | |
3870 | non-zero otherwise. | |
3871 | </P><P> | |
3872 | ||
3873 | <DT><CODE>continue</CODE> | |
3874 | <DD><A NAME="IDX72"></A> | |
3875 | <TABLE><tr><td> </td><td class=example><pre>continue [<VAR>n</VAR>] | |
3876 | </pre></td></tr></table>Resume the next iteration of an enclosing <CODE>for</CODE>, <CODE>while</CODE>, | |
3877 | <CODE>until</CODE>, or <CODE>select</CODE> loop. | |
3878 | If <VAR>n</VAR> is supplied, the execution of the <VAR>n</VAR>th enclosing loop | |
3879 | is resumed. | |
3880 | <VAR>n</VAR> must be greater than or equal to 1. | |
3881 | The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1. | |
3882 | <P> | |
3883 | ||
3884 | <DT><CODE>eval</CODE> | |
3885 | <DD><A NAME="IDX73"></A> | |
3886 | <TABLE><tr><td> </td><td class=example><pre>eval [<VAR>arguments</VAR>] | |
3887 | </pre></td></tr></table>The arguments are concatenated together into a single command, which is | |
3888 | then read and executed, and its exit status returned as the exit status | |
3889 | of <CODE>eval</CODE>. | |
3890 | If there are no arguments or only empty arguments, the return status is | |
3891 | zero. | |
3892 | <P> | |
3893 | ||
3894 | <DT><CODE>exec</CODE> | |
3895 | <DD><A NAME="IDX74"></A> | |
3896 | <TABLE><tr><td> </td><td class=example><pre>exec [-cl] [-a <VAR>name</VAR>] [<VAR>command</VAR> [<VAR>arguments</VAR>]] | |
3897 | </pre></td></tr></table>If <VAR>command</VAR> | |
3898 | is supplied, it replaces the shell without creating a new process. | |
3899 | If the <SAMP>`-l'</SAMP> option is supplied, the shell places a dash at the | |
3900 | beginning of the zeroth argument passed to <VAR>command</VAR>. | |
3901 | This is what the <CODE>login</CODE> program does. | |
3902 | The <SAMP>`-c'</SAMP> option causes <VAR>command</VAR> to be executed with an empty | |
3903 | environment. | |
3904 | If <SAMP>`-a'</SAMP> is supplied, the shell passes <VAR>name</VAR> as the zeroth | |
3905 | argument to <VAR>command</VAR>. | |
3906 | If no <VAR>command</VAR> is specified, redirections may be used to affect | |
3907 | the current shell environment. If there are no redirection errors, the | |
3908 | return status is zero; otherwise the return status is non-zero. | |
3909 | <P> | |
3910 | ||
3911 | <DT><CODE>exit</CODE> | |
3912 | <DD><A NAME="IDX75"></A> | |
3913 | <TABLE><tr><td> </td><td class=example><pre>exit [<VAR>n</VAR>] | |
3914 | </pre></td></tr></table>Exit the shell, returning a status of <VAR>n</VAR> to the shell's parent. | |
3915 | If <VAR>n</VAR> is omitted, the exit status is that of the last command executed. | |
3916 | Any trap on <CODE>EXIT</CODE> is executed before the shell terminates. | |
3917 | <P> | |
3918 | ||
3919 | <DT><CODE>export</CODE> | |
3920 | <DD><A NAME="IDX76"></A> | |
3921 | <TABLE><tr><td> </td><td class=example><pre>export [-fn] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]] | |
3922 | </pre></td></tr></table>Mark each <VAR>name</VAR> to be passed to child processes | |
3923 | in the environment. If the <SAMP>`-f'</SAMP> option is supplied, the <VAR>name</VAR>s | |
3924 | refer to shell functions; otherwise the names refer to shell variables. | |
3925 | The <SAMP>`-n'</SAMP> option means to no longer mark each <VAR>name</VAR> for export. | |
3926 | If no <VAR>names</VAR> are supplied, or if the <SAMP>`-p'</SAMP> option is given, a | |
3927 | list of exported names is displayed. | |
3928 | The <SAMP>`-p'</SAMP> option displays output in a form that may be reused as input. | |
3929 | If a variable name is followed by =<VAR>value</VAR>, the value of | |
3930 | the variable is set to <VAR>value</VAR>. | |
3931 | <P> | |
3932 | ||
3933 | The return status is zero unless an invalid option is supplied, one of | |
3934 | the names is not a valid shell variable name, or <SAMP>`-f'</SAMP> is supplied | |
3935 | with a name that is not a shell function. | |
3936 | </P><P> | |
3937 | ||
3938 | <DT><CODE>getopts</CODE> | |
3939 | <DD><A NAME="IDX77"></A> | |
3940 | <TABLE><tr><td> </td><td class=example><pre>getopts <VAR>optstring</VAR> <VAR>name</VAR> [<VAR>args</VAR>] | |
3941 | </pre></td></tr></table><CODE>getopts</CODE> is used by shell scripts to parse positional parameters. | |
3942 | <VAR>optstring</VAR> contains the option characters to be recognized; if a | |
3943 | character is followed by a colon, the option is expected to have an | |
3944 | argument, which should be separated from it by white space. | |
3945 | The colon (<SAMP>`:'</SAMP>) and question mark (<SAMP>`?'</SAMP>) may not be | |
3946 | used as option characters. | |
3947 | Each time it is invoked, <CODE>getopts</CODE> | |
3948 | places the next option in the shell variable <VAR>name</VAR>, initializing | |
3949 | <VAR>name</VAR> if it does not exist, | |
3950 | and the index of the next argument to be processed into the | |
3951 | variable <CODE>OPTIND</CODE>. | |
3952 | <CODE>OPTIND</CODE> is initialized to 1 each time the shell or a shell script | |
3953 | is invoked. | |
3954 | When an option requires an argument, | |
3955 | <CODE>getopts</CODE> places that argument into the variable <CODE>OPTARG</CODE>. | |
3956 | The shell does not reset <CODE>OPTIND</CODE> automatically; it must be manually | |
3957 | reset between multiple calls to <CODE>getopts</CODE> within the same shell | |
3958 | invocation if a new set of parameters is to be used. | |
3959 | <P> | |
3960 | ||
3961 | When the end of options is encountered, <CODE>getopts</CODE> exits with a | |
3962 | return value greater than zero. | |
3963 | <CODE>OPTIND</CODE> is set to the index of the first non-option argument, | |
3964 | and <CODE>name</CODE> is set to <SAMP>`?'</SAMP>. | |
3965 | </P><P> | |
3966 | ||
3967 | <CODE>getopts</CODE> | |
3968 | normally parses the positional parameters, but if more arguments are | |
3969 | given in <VAR>args</VAR>, <CODE>getopts</CODE> parses those instead. | |
3970 | </P><P> | |
3971 | ||
3972 | <CODE>getopts</CODE> can report errors in two ways. If the first character of | |
3973 | <VAR>optstring</VAR> is a colon, <VAR>silent</VAR> | |
3974 | error reporting is used. In normal operation diagnostic messages | |
3975 | are printed when invalid options or missing option arguments are | |
3976 | encountered. | |
3977 | If the variable <CODE>OPTERR</CODE> | |
3978 | is set to 0, no error messages will be displayed, even if the first | |
3979 | character of <CODE>optstring</CODE> is not a colon. | |
3980 | </P><P> | |
3981 | ||
3982 | If an invalid option is seen, | |
3983 | <CODE>getopts</CODE> places <SAMP>`?'</SAMP> into <VAR>name</VAR> and, if not silent, | |
3984 | prints an error message and unsets <CODE>OPTARG</CODE>. | |
3985 | If <CODE>getopts</CODE> is silent, the option character found is placed in | |
3986 | <CODE>OPTARG</CODE> and no diagnostic message is printed. | |
3987 | </P><P> | |
3988 | ||
3989 | If a required argument is not found, and <CODE>getopts</CODE> | |
3990 | is not silent, a question mark (<SAMP>`?'</SAMP>) is placed in <VAR>name</VAR>, | |
3991 | <CODE>OPTARG</CODE> is unset, and a diagnostic message is printed. | |
3992 | If <CODE>getopts</CODE> is silent, then a colon (<SAMP>`:'</SAMP>) is placed in | |
3993 | <VAR>name</VAR> and <CODE>OPTARG</CODE> is set to the option character found. | |
3994 | </P><P> | |
3995 | ||
3996 | <DT><CODE>hash</CODE> | |
3997 | <DD><A NAME="IDX78"></A> | |
3998 | <TABLE><tr><td> </td><td class=example><pre>hash [-r] [-p <VAR>filename</VAR>] [-dt] [<VAR>name</VAR>] | |
3999 | </pre></td></tr></table>Remember the full pathnames of commands specified as <VAR>name</VAR> arguments, | |
4000 | so they need not be searched for on subsequent invocations. | |
4001 | The commands are found by searching through the directories listed in | |
4002 | <CODE>$PATH</CODE>. | |
4003 | The <SAMP>`-p'</SAMP> option inhibits the path search, and <VAR>filename</VAR> is | |
4004 | used as the location of <VAR>name</VAR>. | |
4005 | The <SAMP>`-r'</SAMP> option causes the shell to forget all remembered locations. | |
4006 | The <SAMP>`-d'</SAMP> option causes the shell to forget the remembered location | |
4007 | of each <VAR>name</VAR>. | |
4008 | If the <SAMP>`-t'</SAMP> option is supplied, the full pathname to which each | |
4009 | <VAR>name</VAR> corresponds is printed. If multiple <VAR>name</VAR> arguments are | |
4010 | supplied with <SAMP>`-t'</SAMP> the <VAR>name</VAR> is printed before the hashed | |
4011 | full pathname. | |
4012 | The <SAMP>`-l'</SAMP> option causes output to be displayed in a format | |
4013 | that may be reused as input. | |
4014 | If no arguments are given, or if only <SAMP>`-l'</SAMP> is supplied, | |
4015 | information about remembered commands is printed. | |
4016 | The return status is zero unless a <VAR>name</VAR> is not found or an invalid | |
4017 | option is supplied. | |
4018 | <P> | |
4019 | ||
4020 | <DT><CODE>pwd</CODE> | |
4021 | <DD><A NAME="IDX79"></A> | |
4022 | <TABLE><tr><td> </td><td class=example><pre>pwd [-LP] | |
4023 | </pre></td></tr></table>Print the absolute pathname of the current working directory. | |
4024 | If the <SAMP>`-P'</SAMP> option is supplied, the pathname printed will not | |
4025 | contain symbolic links. | |
4026 | If the <SAMP>`-L'</SAMP> option is supplied, the pathname printed may contain | |
4027 | symbolic links. | |
4028 | The return status is zero unless an error is encountered while | |
4029 | determining the name of the current directory or an invalid option | |
4030 | is supplied. | |
4031 | <P> | |
4032 | ||
4033 | <DT><CODE>readonly</CODE> | |
4034 | <DD><A NAME="IDX80"></A> | |
4035 | <TABLE><tr><td> </td><td class=example><pre>readonly [-aApf] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small> | |
4036 | </pre></td></tr></table>Mark each <VAR>name</VAR> as readonly. | |
4037 | The values of these names may not be changed by subsequent assignment. | |
4038 | If the <SAMP>`-f'</SAMP> option is supplied, each <VAR>name</VAR> refers to a shell | |
4039 | function. | |
4040 | The <SAMP>`-a'</SAMP> option means each <VAR>name</VAR> refers to an indexed | |
4041 | array variable; the <SAMP>`-A'</SAMP> option means each <VAR>name</VAR> refers | |
4042 | to an associative array variable. | |
4043 | If no <VAR>name</VAR> arguments are given, or if the <SAMP>`-p'</SAMP> | |
4044 | option is supplied, a list of all readonly names is printed. | |
4045 | The <SAMP>`-p'</SAMP> option causes output to be displayed in a format that | |
4046 | may be reused as input. | |
4047 | If a variable name is followed by =<VAR>value</VAR>, the value of | |
4048 | the variable is set to <VAR>value</VAR>. | |
4049 | The return status is zero unless an invalid option is supplied, one of | |
4050 | the <VAR>name</VAR> arguments is not a valid shell variable or function name, | |
4051 | or the <SAMP>`-f'</SAMP> option is supplied with a name that is not a shell function. | |
4052 | <P> | |
4053 | ||
4054 | <DT><CODE>return</CODE> | |
4055 | <DD><A NAME="IDX81"></A> | |
4056 | <TABLE><tr><td> </td><td class=example><pre>return [<VAR>n</VAR>] | |
4057 | </pre></td></tr></table>Cause a shell function to exit with the return value <VAR>n</VAR>. | |
4058 | If <VAR>n</VAR> is not supplied, the return value is the exit status of the | |
4059 | last command executed in the function. | |
4060 | This may also be used to terminate execution of a script being executed | |
4061 | with the <CODE>.</CODE> (or <CODE>source</CODE>) builtin, returning either <VAR>n</VAR> or | |
4062 | the exit status of the last command executed within the script as the exit | |
4063 | status of the script. | |
4064 | Any command associated with the <CODE>RETURN</CODE> trap is executed | |
4065 | before execution resumes after the function or script. | |
4066 | The return status is non-zero if <CODE>return</CODE> is used outside a function | |
4067 | and not during the execution of a script by <CODE>.</CODE> or <CODE>source</CODE>. | |
4068 | <P> | |
4069 | ||
4070 | <DT><CODE>shift</CODE> | |
4071 | <DD><A NAME="IDX82"></A> | |
4072 | <TABLE><tr><td> </td><td class=example><pre>shift [<VAR>n</VAR>] | |
4073 | </pre></td></tr></table>Shift the positional parameters to the left by <VAR>n</VAR>. | |
4074 | The positional parameters from <VAR>n</VAR>+1 <small>...</small> <CODE>$#</CODE> are | |
4075 | renamed to <CODE>$1</CODE> <small>...</small> <CODE>$#</CODE>-<VAR>n</VAR>. | |
4076 | Parameters represented by the numbers <CODE>$#</CODE> to <CODE>$#</CODE>-<VAR>n</VAR>+1 | |
4077 | are unset. | |
4078 | <VAR>n</VAR> must be a non-negative number less than or equal to <CODE>$#</CODE>. | |
4079 | If <VAR>n</VAR> is zero or greater than <CODE>$#</CODE>, the positional parameters | |
4080 | are not changed. | |
4081 | If <VAR>n</VAR> is not supplied, it is assumed to be 1. | |
4082 | The return status is zero unless <VAR>n</VAR> is greater than <CODE>$#</CODE> or | |
4083 | less than zero, non-zero otherwise. | |
4084 | <P> | |
4085 | ||
4086 | <DT><CODE>test</CODE> | |
4087 | <DD><DT><CODE>[</CODE> | |
4088 | <DD><A NAME="IDX83"></A> | |
4089 | <A NAME="IDX84"></A> | |
4090 | Evaluate a conditional expression <VAR>expr</VAR>. | |
4091 | Each operator and operand must be a separate argument. | |
4092 | Expressions are composed of the primaries described below in | |
4093 | <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>. | |
4094 | <CODE>test</CODE> does not accept any options, nor does it accept and ignore | |
4095 | an argument of <SAMP>`--'</SAMP> as signifying the end of options. | |
4096 | <P> | |
4097 | ||
4098 | When the <CODE>[</CODE> form is used, the last argument to the command must | |
4099 | be a <CODE>]</CODE>. | |
4100 | </P><P> | |
4101 | ||
4102 | Expressions may be combined using the following operators, listed in | |
4103 | decreasing order of precedence. | |
4104 | The evaluation depends on the number of arguments; see below. | |
4105 | </P><P> | |
4106 | ||
4107 | <DL COMPACT> | |
4108 | <DT><CODE>! <VAR>expr</VAR></CODE> | |
4109 | <DD>True if <VAR>expr</VAR> is false. | |
4110 | <P> | |
4111 | ||
4112 | <DT><CODE>( <VAR>expr</VAR> )</CODE> | |
4113 | <DD>Returns the value of <VAR>expr</VAR>. | |
4114 | This may be used to override the normal precedence of operators. | |
4115 | <P> | |
4116 | ||
4117 | <DT><CODE><VAR>expr1</VAR> -a <VAR>expr2</VAR></CODE> | |
4118 | <DD>True if both <VAR>expr1</VAR> and <VAR>expr2</VAR> are true. | |
4119 | <P> | |
4120 | ||
4121 | <DT><CODE><VAR>expr1</VAR> -o <VAR>expr2</VAR></CODE> | |
4122 | <DD>True if either <VAR>expr1</VAR> or <VAR>expr2</VAR> is true. | |
4123 | </DL> | |
4124 | <P> | |
4125 | ||
4126 | The <CODE>test</CODE> and <CODE>[</CODE> builtins evaluate conditional | |
4127 | expressions using a set of rules based on the number of arguments. | |
4128 | </P><P> | |
4129 | ||
4130 | <DL COMPACT> | |
4131 | <DT>0 arguments | |
4132 | <DD>The expression is false. | |
4133 | <P> | |
4134 | ||
4135 | <DT>1 argument | |
4136 | <DD>The expression is true if and only if the argument is not null. | |
4137 | <P> | |
4138 | ||
4139 | <DT>2 arguments | |
4140 | <DD>If the first argument is <SAMP>`!'</SAMP>, the expression is true if and | |
4141 | only if the second argument is null. | |
4142 | If the first argument is one of the unary conditional operators | |
4143 | (see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the expression | |
4144 | is true if the unary test is true. | |
4145 | If the first argument is not a valid unary operator, the expression is | |
4146 | false. | |
4147 | <P> | |
4148 | ||
4149 | <DT>3 arguments | |
4150 | <DD>If the second argument is one of the binary conditional | |
4151 | operators (see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the | |
4152 | result of the expression is the result of the binary test using the | |
4153 | first and third arguments as operands. | |
4154 | The <SAMP>`-a'</SAMP> and <SAMP>`-o'</SAMP> operators are considered binary operators | |
4155 | when there are three arguments. | |
4156 | If the first argument is <SAMP>`!'</SAMP>, the value is the negation of | |
4157 | the two-argument test using the second and third arguments. | |
4158 | If the first argument is exactly <SAMP>`('</SAMP> and the third argument is | |
4159 | exactly <SAMP>`)'</SAMP>, the result is the one-argument test of the second | |
4160 | argument. | |
4161 | Otherwise, the expression is false. | |
4162 | <P> | |
4163 | ||
4164 | <DT>4 arguments | |
4165 | <DD>If the first argument is <SAMP>`!'</SAMP>, the result is the negation of | |
4166 | the three-argument expression composed of the remaining arguments. | |
4167 | Otherwise, the expression is parsed and evaluated according to | |
4168 | precedence using the rules listed above. | |
4169 | <P> | |
4170 | ||
4171 | <DT>5 or more arguments | |
4172 | <DD>The expression is parsed and evaluated according to precedence | |
4173 | using the rules listed above. | |
4174 | </DL> | |
4175 | <P> | |
4176 | ||
4177 | <DT><CODE>times</CODE> | |
4178 | <DD><A NAME="IDX85"></A> | |
4179 | <TABLE><tr><td> </td><td class=example><pre>times | |
4180 | </pre></td></tr></table>Print out the user and system times used by the shell and its children. | |
4181 | The return status is zero. | |
4182 | <P> | |
4183 | ||
4184 | <DT><CODE>trap</CODE> | |
4185 | <DD><A NAME="IDX86"></A> | |
4186 | <TABLE><tr><td> </td><td class=example><pre>trap [-lp] [<VAR>arg</VAR>] [<VAR>sigspec</VAR> <small>...</small>] | |
4187 | </pre></td></tr></table>The commands in <VAR>arg</VAR> are to be read and executed when the | |
4188 | shell receives signal <VAR>sigspec</VAR>. If <VAR>arg</VAR> is absent (and | |
4189 | there is a single <VAR>sigspec</VAR>) or | |
4190 | equal to <SAMP>`-'</SAMP>, each specified signal's disposition is reset | |
4191 | to the value it had when the shell was started. | |
4192 | If <VAR>arg</VAR> is the null string, then the signal specified by | |
4193 | each <VAR>sigspec</VAR> is ignored by the shell and commands it invokes. | |
4194 | If <VAR>arg</VAR> is not present and <SAMP>`-p'</SAMP> has been supplied, | |
4195 | the shell displays the trap commands associated with each <VAR>sigspec</VAR>. | |
4196 | If no arguments are supplied, or | |
4197 | only <SAMP>`-p'</SAMP> is given, <CODE>trap</CODE> prints the list of commands | |
4198 | associated with each signal number in a form that may be reused as | |
4199 | shell input. | |
4200 | The <SAMP>`-l'</SAMP> option causes the shell to print a list of signal names | |
4201 | and their corresponding numbers. | |
4202 | Each <VAR>sigspec</VAR> is either a signal name or a signal number. | |
4203 | Signal names are case insensitive and the <CODE>SIG</CODE> prefix is optional. | |
4204 | If a <VAR>sigspec</VAR> | |
4205 | is <CODE>0</CODE> or <CODE>EXIT</CODE>, <VAR>arg</VAR> is executed when the shell exits. | |
4206 | If a <VAR>sigspec</VAR> is <CODE>DEBUG</CODE>, the command <VAR>arg</VAR> is executed | |
4207 | before every simple command, <CODE>for</CODE> command, <CODE>case</CODE> command, | |
4208 | <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before | |
4209 | the first command executes in a shell function. | |
4210 | Refer to the description of the <CODE>extglob</CODE> option to the | |
4211 | <CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) for details of its | |
4212 | effect on the <CODE>DEBUG</CODE> trap. | |
4213 | If a <VAR>sigspec</VAR> is <CODE>ERR</CODE>, the command <VAR>arg</VAR> | |
4214 | is executed whenever a simple command has a non-zero exit status, | |
4215 | subject to the following conditions. | |
4216 | The <CODE>ERR</CODE> trap is not executed if the failed command is part of the | |
4217 | command list immediately following an <CODE>until</CODE> or <CODE>while</CODE> keyword, | |
4218 | part of the test in an <CODE>if</CODE> statement, | |
4219 | part of a command executed in a <CODE>&&</CODE> or <CODE>||</CODE> list, | |
4220 | or if the command's return | |
4221 | status is being inverted using <CODE>!</CODE>. | |
4222 | These are the same conditions obeyed by the <CODE>errexit</CODE> option. | |
4223 | If a <VAR>sigspec</VAR> is <CODE>RETURN</CODE>, the command <VAR>arg</VAR> is executed | |
4224 | each time a shell function or a script executed with the <CODE>.</CODE> or | |
4225 | <CODE>source</CODE> builtins finishes executing. | |
4226 | <P> | |
4227 | ||
4228 | Signals ignored upon entry to the shell cannot be trapped or reset. | |
4229 | Trapped signals that are not being ignored are reset to their original | |
4230 | values in a child process when it is created. | |
4231 | </P><P> | |
4232 | ||
4233 | The return status is zero unless a <VAR>sigspec</VAR> does not specify a | |
4234 | valid signal. | |
4235 | </P><P> | |
4236 | ||
4237 | <DT><CODE>umask</CODE> | |
4238 | <DD><A NAME="IDX87"></A> | |
4239 | <TABLE><tr><td> </td><td class=example><pre>umask [-p] [-S] [<VAR>mode</VAR>] | |
4240 | </pre></td></tr></table>Set the shell process's file creation mask to <VAR>mode</VAR>. If | |
4241 | <VAR>mode</VAR> begins with a digit, it is interpreted as an octal number; | |
4242 | if not, it is interpreted as a symbolic mode mask similar | |
4243 | to that accepted by the <CODE>chmod</CODE> command. If <VAR>mode</VAR> is | |
4244 | omitted, the current value of the mask is printed. If the <SAMP>`-S'</SAMP> | |
4245 | option is supplied without a <VAR>mode</VAR> argument, the mask is printed | |
4246 | in a symbolic format. | |
4247 | If the <SAMP>`-p'</SAMP> option is supplied, and <VAR>mode</VAR> | |
4248 | is omitted, the output is in a form that may be reused as input. | |
4249 | The return status is zero if the mode is successfully changed or if | |
4250 | no <VAR>mode</VAR> argument is supplied, and non-zero otherwise. | |
4251 | <P> | |
4252 | ||
4253 | Note that when the mode is interpreted as an octal number, each number | |
4254 | of the umask is subtracted from <CODE>7</CODE>. Thus, a umask of <CODE>022</CODE> | |
4255 | results in permissions of <CODE>755</CODE>. | |
4256 | </P><P> | |
4257 | ||
4258 | <DT><CODE>unset</CODE> | |
4259 | <DD><A NAME="IDX88"></A> | |
4260 | <TABLE><tr><td> </td><td class=example><pre>unset [-fv] [<VAR>name</VAR>] | |
4261 | </pre></td></tr></table>Each variable or function <VAR>name</VAR> is removed. | |
4262 | If no options are supplied, or the <SAMP>`-v'</SAMP> option is given, each | |
4263 | <VAR>name</VAR> refers to a shell variable. | |
4264 | If the <SAMP>`-f'</SAMP> option is given, the <VAR>name</VAR>s refer to shell | |
4265 | functions, and the function definition is removed. | |
4266 | Readonly variables and functions may not be unset. | |
4267 | The return status is zero unless a <VAR>name</VAR> is readonly. | |
4268 | </DL> | |
4269 | <P> | |
4270 | ||
4271 | <A NAME="Bash Builtins"></A> | |
4272 | <HR SIZE="6"> | |
4273 | <A NAME="SEC60"></A> | |
4274 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
4275 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> < </A>]</TD> | |
4276 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> > </A>]</TD> | |
4277 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> << </A>]</TD> | |
4278 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD> | |
4279 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD> | |
4280 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
4281 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
4282 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
4283 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
4284 | </TR></TABLE> | |
4285 | <H2> 4.2 Bash Builtin Commands </H2> | |
4286 | <!--docid::SEC60::--> | |
4287 | <P> | |
4288 | ||
4289 | This section describes builtin commands which are unique to | |
4290 | or have been extended in Bash. | |
4291 | Some of these commands are specified in the POSIX standard. | |
4292 | </P><P> | |
4293 | ||
4294 | <DL COMPACT> | |
4295 | ||
4296 | <DT><CODE>alias</CODE> | |
4297 | <DD><A NAME="IDX89"></A> | |
4298 | <TABLE><tr><td> </td><td class=example><pre>alias [<CODE>-p</CODE>] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>] | |
4299 | </pre></td></tr></table><P> | |
4300 | ||
4301 | Without arguments or with the <SAMP>`-p'</SAMP> option, <CODE>alias</CODE> prints | |
4302 | the list of aliases on the standard output in a form that allows | |
4303 | them to be reused as input. | |
4304 | If arguments are supplied, an alias is defined for each <VAR>name</VAR> | |
4305 | whose <VAR>value</VAR> is given. If no <VAR>value</VAR> is given, the name | |
4306 | and value of the alias is printed. | |
4307 | Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>. | |
4308 | </P><P> | |
4309 | ||
4310 | <DT><CODE>bind</CODE> | |
4311 | <DD><A NAME="IDX90"></A> | |
4312 | <TABLE><tr><td> </td><td class=example><pre>bind [-m <VAR>keymap</VAR>] [-lpsvPSV] | |
4313 | bind [-m <VAR>keymap</VAR>] [-q <VAR>function</VAR>] [-u <VAR>function</VAR>] [-r <VAR>keyseq</VAR>] | |
4314 | bind [-m <VAR>keymap</VAR>] -f <VAR>filename</VAR> | |
4315 | bind [-m <VAR>keymap</VAR>] -x <VAR>keyseq:shell-command</VAR> | |
4316 | bind [-m <VAR>keymap</VAR>] <VAR>keyseq:function-name</VAR> | |
4317 | bind <VAR>readline-command</VAR> | |
4318 | </pre></td></tr></table><P> | |
4319 | ||
4320 | Display current Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) | |
4321 | key and function bindings, | |
4322 | bind a key sequence to a Readline function or macro, | |
4323 | or set a Readline variable. | |
4324 | Each non-option argument is a command as it would appear in a | |
4325 | Readline initialization file (see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>), | |
4326 | but each binding or command must be passed as a separate argument; e.g., | |
4327 | <SAMP>`"\C-x\C-r":re-read-init-file'</SAMP>. | |
4328 | </P><P> | |
4329 | ||
4330 | Options, if supplied, have the following meanings: | |
4331 | </P><P> | |
4332 | ||
4333 | <DL COMPACT> | |
4334 | <DT><CODE>-m <VAR>keymap</VAR></CODE> | |
4335 | <DD>Use <VAR>keymap</VAR> as the keymap to be affected by | |
4336 | the subsequent bindings. Acceptable <VAR>keymap</VAR> | |
4337 | names are | |
4338 | <CODE>emacs</CODE>, | |
4339 | <CODE>emacs-standard</CODE>, | |
4340 | <CODE>emacs-meta</CODE>, | |
4341 | <CODE>emacs-ctlx</CODE>, | |
4342 | <CODE>vi</CODE>, | |
4343 | <CODE>vi-move</CODE>, | |
4344 | <CODE>vi-command</CODE>, and | |
4345 | <CODE>vi-insert</CODE>. | |
4346 | <CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>; | |
4347 | <CODE>emacs</CODE> is equivalent to <CODE>emacs-standard</CODE>. | |
4348 | <P> | |
4349 | ||
4350 | <DT><CODE>-l</CODE> | |
4351 | <DD>List the names of all Readline functions. | |
4352 | <P> | |
4353 | ||
4354 | <DT><CODE>-p</CODE> | |
4355 | <DD>Display Readline function names and bindings in such a way that they | |
4356 | can be used as input or in a Readline initialization file. | |
4357 | <P> | |
4358 | ||
4359 | <DT><CODE>-P</CODE> | |
4360 | <DD>List current Readline function names and bindings. | |
4361 | <P> | |
4362 | ||
4363 | <DT><CODE>-v</CODE> | |
4364 | <DD>Display Readline variable names and values in such a way that they | |
4365 | can be used as input or in a Readline initialization file. | |
4366 | <P> | |
4367 | ||
4368 | <DT><CODE>-V</CODE> | |
4369 | <DD>List current Readline variable names and values. | |
4370 | <P> | |
4371 | ||
4372 | <DT><CODE>-s</CODE> | |
4373 | <DD>Display Readline key sequences bound to macros and the strings they output | |
4374 | in such a way that they can be used as input or in a Readline | |
4375 | initialization file. | |
4376 | <P> | |
4377 | ||
4378 | <DT><CODE>-S</CODE> | |
4379 | <DD>Display Readline key sequences bound to macros and the strings they output. | |
4380 | <P> | |
4381 | ||
4382 | <DT><CODE>-f <VAR>filename</VAR></CODE> | |
4383 | <DD>Read key bindings from <VAR>filename</VAR>. | |
4384 | <P> | |
4385 | ||
4386 | <DT><CODE>-q <VAR>function</VAR></CODE> | |
4387 | <DD>Query about which keys invoke the named <VAR>function</VAR>. | |
4388 | <P> | |
4389 | ||
4390 | <DT><CODE>-u <VAR>function</VAR></CODE> | |
4391 | <DD>Unbind all keys bound to the named <VAR>function</VAR>. | |
4392 | <P> | |
4393 | ||
4394 | <DT><CODE>-r <VAR>keyseq</VAR></CODE> | |
4395 | <DD>Remove any current binding for <VAR>keyseq</VAR>. | |
4396 | <P> | |
4397 | ||
4398 | <DT><CODE>-x <VAR>keyseq:shell-command</VAR></CODE> | |
4399 | <DD>Cause <VAR>shell-command</VAR> to be executed whenever <VAR>keyseq</VAR> is | |
4400 | entered. | |
4401 | When <VAR>shell-command</VAR> is executed, the shell sets the | |
4402 | <CODE>READLINE_LINE</CODE> variable to the contents of the Readline line | |
4403 | buffer and the <CODE>READLINE_POINT</CODE> variable to the current location | |
4404 | of the insertion point. | |
4405 | If the executed command changes the value of <CODE>READLINE_LINE</CODE> or | |
4406 | <CODE>READLINE_POINT</CODE>, those new values will be reflected in the | |
4407 | editing state. | |
4408 | </DL> | |
4409 | <P> | |
4410 | ||
4411 | The return status is zero unless an invalid option is supplied or an | |
4412 | error occurs. | |
4413 | </P><P> | |
4414 | ||
4415 | <DT><CODE>builtin</CODE> | |
4416 | <DD><A NAME="IDX91"></A> | |
4417 | <TABLE><tr><td> </td><td class=example><pre>builtin [<VAR>shell-builtin</VAR> [<VAR>args</VAR>]] | |
4418 | </pre></td></tr></table>Run a shell builtin, passing it <VAR>args</VAR>, and return its exit status. | |
4419 | This is useful when defining a shell function with the same | |
4420 | name as a shell builtin, retaining the functionality of the builtin within | |
4421 | the function. | |
4422 | The return status is non-zero if <VAR>shell-builtin</VAR> is not a shell | |
4423 | builtin command. | |
4424 | <P> | |
4425 | ||
4426 | <DT><CODE>caller</CODE> | |
4427 | <DD><A NAME="IDX92"></A> | |
4428 | <TABLE><tr><td> </td><td class=example><pre>caller [<VAR>expr</VAR>] | |
4429 | </pre></td></tr></table>Returns the context of any active subroutine call (a shell function or | |
4430 | a script executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins). | |
4431 | <P> | |
4432 | ||
4433 | Without <VAR>expr</VAR>, <CODE>caller</CODE> displays the line number and source | |
4434 | filename of the current subroutine call. | |
4435 | If a non-negative integer is supplied as <VAR>expr</VAR>, <CODE>caller</CODE> | |
4436 | displays the line number, subroutine name, and source file corresponding | |
4437 | to that position in the current execution call stack. This extra | |
4438 | information may be used, for example, to print a stack trace. The | |
4439 | current frame is frame 0. | |
4440 | </P><P> | |
4441 | ||
4442 | The return value is 0 unless the shell is not executing a subroutine | |
4443 | call or <VAR>expr</VAR> does not correspond to a valid position in the | |
4444 | call stack. | |
4445 | </P><P> | |
4446 | ||
4447 | <DT><CODE>command</CODE> | |
4448 | <DD><A NAME="IDX93"></A> | |
4449 | <TABLE><tr><td> </td><td class=example><pre>command [-pVv] <VAR>command</VAR> [<VAR>arguments</VAR> <small>...</small>] | |
4450 | </pre></td></tr></table>Runs <VAR>command</VAR> with <VAR>arguments</VAR> ignoring any shell function | |
4451 | named <VAR>command</VAR>. | |
4452 | Only shell builtin commands or commands found by searching the | |
4453 | <CODE>PATH</CODE> are executed. | |
4454 | If there is a shell function named <CODE>ls</CODE>, running <SAMP>`command ls'</SAMP> | |
4455 | within the function will execute the external command <CODE>ls</CODE> | |
4456 | instead of calling the function recursively. | |
4457 | The <SAMP>`-p'</SAMP> option means to use a default value for <CODE>PATH</CODE> | |
4458 | that is guaranteed to find all of the standard utilities. | |
4459 | The return status in this case is 127 if <VAR>command</VAR> cannot be | |
4460 | found or an error occurred, and the exit status of <VAR>command</VAR> | |
4461 | otherwise. | |
4462 | <P> | |
4463 | ||
4464 | If either the <SAMP>`-V'</SAMP> or <SAMP>`-v'</SAMP> option is supplied, a | |
4465 | description of <VAR>command</VAR> is printed. The <SAMP>`-v'</SAMP> option | |
4466 | causes a single word indicating the command or file name used to | |
4467 | invoke <VAR>command</VAR> to be displayed; the <SAMP>`-V'</SAMP> option produces | |
4468 | a more verbose description. In this case, the return status is | |
4469 | zero if <VAR>command</VAR> is found, and non-zero if not. | |
4470 | </P><P> | |
4471 | ||
4472 | <DT><CODE>declare</CODE> | |
4473 | <DD><A NAME="IDX94"></A> | |
4474 | <TABLE><tr><td> </td><td class=example><pre>declare [-aAfFilrtux] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>] | |
4475 | </pre></td></tr></table><P> | |
4476 | ||
4477 | Declare variables and give them attributes. If no <VAR>name</VAR>s | |
4478 | are given, then display the values of variables instead. | |
4479 | </P><P> | |
4480 | ||
4481 | The <SAMP>`-p'</SAMP> option will display the attributes and values of each | |
4482 | <VAR>name</VAR>. | |
4483 | When <SAMP>`-p'</SAMP> is used with <VAR>name</VAR> arguments, additional options | |
4484 | are ignored. | |
4485 | </P><P> | |
4486 | ||
4487 | When <SAMP>`-p'</SAMP> is supplied without <VAR>name</VAR> arguments, <CODE>declare</CODE> | |
4488 | will display the attributes and values of all variables having the | |
4489 | attributes specified by the additional options. | |
4490 | If no other options are supplied with <SAMP>`-p'</SAMP>, <CODE>declare</CODE> will | |
4491 | display the attributes and values of all shell variables. The <SAMP>`-f'</SAMP> | |
4492 | option will restrict the display to shell functions. | |
4493 | </P><P> | |
4494 | ||
4495 | The <SAMP>`-F'</SAMP> option inhibits the display of function definitions; | |
4496 | only the function name and attributes are printed. | |
4497 | If the <CODE>extdebug</CODE> shell option is enabled using <CODE>shopt</CODE> | |
4498 | (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the source file name and line number where | |
4499 | the function is defined are displayed as well. | |
4500 | <SAMP>`-F'</SAMP> implies <SAMP>`-f'</SAMP>. | |
4501 | The following options can be used to restrict output to variables with | |
4502 | the specified attributes or to give variables attributes: | |
4503 | </P><P> | |
4504 | ||
4505 | <DL COMPACT> | |
4506 | <DT><CODE>-a</CODE> | |
4507 | <DD>Each <VAR>name</VAR> is an indexed array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>). | |
4508 | <P> | |
4509 | ||
4510 | <DT><CODE>-A</CODE> | |
4511 | <DD>Each <VAR>name</VAR> is an associative array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>). | |
4512 | <P> | |
4513 | ||
4514 | <DT><CODE>-f</CODE> | |
4515 | <DD>Use function names only. | |
4516 | <P> | |
4517 | ||
4518 | <DT><CODE>-i</CODE> | |
4519 | <DD>The variable is to be treated as | |
4520 | an integer; arithmetic evaluation (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) is | |
4521 | performed when the variable is assigned a value. | |
4522 | <P> | |
4523 | ||
4524 | <DT><CODE>-l</CODE> | |
4525 | <DD>When the variable is assigned a value, all upper-case characters are | |
4526 | converted to lower-case. | |
4527 | The upper-case attribute is disabled. | |
4528 | <P> | |
4529 | ||
4530 | <DT><CODE>-r</CODE> | |
4531 | <DD>Make <VAR>name</VAR>s readonly. These names cannot then be assigned values | |
4532 | by subsequent assignment statements or unset. | |
4533 | <P> | |
4534 | ||
4535 | <DT><CODE>-t</CODE> | |
4536 | <DD>Give each <VAR>name</VAR> the <CODE>trace</CODE> attribute. | |
4537 | Traced functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps from | |
4538 | the calling shell. | |
4539 | The trace attribute has no special meaning for variables. | |
4540 | <P> | |
4541 | ||
4542 | <DT><CODE>-u</CODE> | |
4543 | <DD>When the variable is assigned a value, all lower-case characters are | |
4544 | converted to upper-case. | |
4545 | The lower-case attribute is disabled. | |
4546 | <P> | |
4547 | ||
4548 | <DT><CODE>-x</CODE> | |
4549 | <DD>Mark each <VAR>name</VAR> for export to subsequent commands via | |
4550 | the environment. | |
4551 | </DL> | |
4552 | <P> | |
4553 | ||
4554 | Using <SAMP>`+'</SAMP> instead of <SAMP>`-'</SAMP> turns off the attribute instead, | |
4555 | with the exceptions that <SAMP>`+a'</SAMP> | |
4556 | may not be used to destroy an array variable and <SAMP>`+r'</SAMP> will not | |
4557 | remove the readonly attribute. | |
4558 | When used in a function, <CODE>declare</CODE> makes each <VAR>name</VAR> local, | |
4559 | as with the <CODE>local</CODE> command. If a variable name is followed by | |
4560 | =<VAR>value</VAR>, the value of the variable is set to <VAR>value</VAR>. | |
4561 | </P><P> | |
4562 | ||
4563 | The return status is zero unless an invalid option is encountered, | |
4564 | an attempt is made to define a function using <SAMP>`-f foo=bar'</SAMP>, | |
4565 | an attempt is made to assign a value to a readonly variable, | |
4566 | an attempt is made to assign a value to an array variable without | |
4567 | using the compound assignment syntax (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), | |
4568 | one of the <VAR>names</VAR> is not a valid shell variable name, | |
4569 | an attempt is made to turn off readonly status for a readonly variable, | |
4570 | an attempt is made to turn off array status for an array variable, | |
4571 | or an attempt is made to display a non-existent function with <SAMP>`-f'</SAMP>. | |
4572 | </P><P> | |
4573 | ||
4574 | <DT><CODE>echo</CODE> | |
4575 | <DD><A NAME="IDX95"></A> | |
4576 | <TABLE><tr><td> </td><td class=example><pre>echo [-neE] [<VAR>arg</VAR> <small>...</small>] | |
4577 | </pre></td></tr></table>Output the <VAR>arg</VAR>s, separated by spaces, terminated with a | |
4578 | newline. | |
4579 | The return status is always 0. | |
4580 | If <SAMP>`-n'</SAMP> is specified, the trailing newline is suppressed. | |
4581 | If the <SAMP>`-e'</SAMP> option is given, interpretation of the following | |
4582 | backslash-escaped characters is enabled. | |
4583 | The <SAMP>`-E'</SAMP> option disables the interpretation of these escape characters, | |
4584 | even on systems where they are interpreted by default. | |
4585 | The <CODE>xpg_echo</CODE> shell option may be used to | |
4586 | dynamically determine whether or not <CODE>echo</CODE> expands these | |
4587 | escape characters by default. | |
4588 | <CODE>echo</CODE> does not interpret <SAMP>`--'</SAMP> to mean the end of options. | |
4589 | <P> | |
4590 | ||
4591 | <CODE>echo</CODE> interprets the following escape sequences: | |
4592 | <DL COMPACT> | |
4593 | <DT><CODE>\a</CODE> | |
4594 | <DD>alert (bell) | |
4595 | <DT><CODE>\b</CODE> | |
4596 | <DD>backspace | |
4597 | <DT><CODE>\c</CODE> | |
4598 | <DD>suppress further output | |
4599 | <DT><CODE>\e</CODE> | |
4600 | <DD>escape | |
4601 | <DT><CODE>\f</CODE> | |
4602 | <DD>form feed | |
4603 | <DT><CODE>\n</CODE> | |
4604 | <DD>new line | |
4605 | <DT><CODE>\r</CODE> | |
4606 | <DD>carriage return | |
4607 | <DT><CODE>\t</CODE> | |
4608 | <DD>horizontal tab | |
4609 | <DT><CODE>\v</CODE> | |
4610 | <DD>vertical tab | |
4611 | <DT><CODE>\\</CODE> | |
4612 | <DD>backslash | |
4613 | <DT><CODE>\0<VAR>nnn</VAR></CODE> | |
4614 | <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR> | |
4615 | (zero to three octal digits) | |
4616 | <DT><CODE>\x<VAR>HH</VAR></CODE> | |
4617 | <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR> | |
4618 | (one or two hex digits) | |
4619 | </DL> | |
4620 | <P> | |
4621 | ||
4622 | <DT><CODE>enable</CODE> | |
4623 | <DD><A NAME="IDX96"></A> | |
4624 | <TABLE><tr><td> </td><td class=example><pre>enable [-a] [-dnps] [-f <VAR>filename</VAR>] [<VAR>name</VAR> <small>...</small>] | |
4625 | </pre></td></tr></table>Enable and disable builtin shell commands. | |
4626 | Disabling a builtin allows a disk command which has the same name | |
4627 | as a shell builtin to be executed without specifying a full pathname, | |
4628 | even though the shell normally searches for builtins before disk commands. | |
4629 | If <SAMP>`-n'</SAMP> is used, the <VAR>name</VAR>s become disabled. Otherwise | |
4630 | <VAR>name</VAR>s are enabled. For example, to use the <CODE>test</CODE> binary | |
4631 | found via <CODE>$PATH</CODE> instead of the shell builtin version, type | |
4632 | <SAMP>`enable -n test'</SAMP>. | |
4633 | <P> | |
4634 | ||
4635 | If the <SAMP>`-p'</SAMP> option is supplied, or no <VAR>name</VAR> arguments appear, | |
4636 | a list of shell builtins is printed. With no other arguments, the list | |
4637 | consists of all enabled shell builtins. | |
4638 | The <SAMP>`-a'</SAMP> option means to list | |
4639 | each builtin with an indication of whether or not it is enabled. | |
4640 | </P><P> | |
4641 | ||
4642 | The <SAMP>`-f'</SAMP> option means to load the new builtin command <VAR>name</VAR> | |
4643 | from shared object <VAR>filename</VAR>, on systems that support dynamic loading. | |
4644 | The <SAMP>`-d'</SAMP> option will delete a builtin loaded with <SAMP>`-f'</SAMP>. | |
4645 | </P><P> | |
4646 | ||
4647 | If there are no options, a list of the shell builtins is displayed. | |
4648 | The <SAMP>`-s'</SAMP> option restricts <CODE>enable</CODE> to the POSIX special | |
4649 | builtins. If <SAMP>`-s'</SAMP> is used with <SAMP>`-f'</SAMP>, the new builtin becomes | |
4650 | a special builtin (see section <A HREF="bashref.html#SEC64">4.4 Special Builtins</A>). | |
4651 | </P><P> | |
4652 | ||
4653 | The return status is zero unless a <VAR>name</VAR> is not a shell builtin | |
4654 | or there is an error loading a new builtin from a shared object. | |
4655 | </P><P> | |
4656 | ||
4657 | <DT><CODE>help</CODE> | |
4658 | <DD><A NAME="IDX97"></A> | |
4659 | <TABLE><tr><td> </td><td class=example><pre>help [-dms] [<VAR>pattern</VAR>] | |
4660 | </pre></td></tr></table>Display helpful information about builtin commands. | |
4661 | If <VAR>pattern</VAR> is specified, <CODE>help</CODE> gives detailed help | |
4662 | on all commands matching <VAR>pattern</VAR>, otherwise a list of | |
4663 | the builtins is printed. | |
4664 | <P> | |
4665 | ||
4666 | Options, if supplied, have the following meanings: | |
4667 | </P><P> | |
4668 | ||
4669 | <DL COMPACT> | |
4670 | <DT><CODE>-d</CODE> | |
4671 | <DD>Display a short description of each <VAR>pattern</VAR> | |
4672 | <DT><CODE>-m</CODE> | |
4673 | <DD>Display the description of each <VAR>pattern</VAR> in a manpage-like format | |
4674 | <DT><CODE>-s</CODE> | |
4675 | <DD>Display only a short usage synopsis for each <VAR>pattern</VAR> | |
4676 | </DL> | |
4677 | <P> | |
4678 | ||
4679 | The return status is zero unless no command matches <VAR>pattern</VAR>. | |
4680 | </P><P> | |
4681 | ||
4682 | <DT><CODE>let</CODE> | |
4683 | <DD><A NAME="IDX98"></A> | |
4684 | <TABLE><tr><td> </td><td class=example><pre>let <VAR>expression</VAR> [<VAR>expression</VAR>] | |
4685 | </pre></td></tr></table>The <CODE>let</CODE> builtin allows arithmetic to be performed on shell | |
4686 | variables. Each <VAR>expression</VAR> is evaluated according to the | |
4687 | rules given below in <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>. If the | |
4688 | last <VAR>expression</VAR> evaluates to 0, <CODE>let</CODE> returns 1; | |
4689 | otherwise 0 is returned. | |
4690 | <P> | |
4691 | ||
4692 | <DT><CODE>local</CODE> | |
4693 | <DD><A NAME="IDX99"></A> | |
4694 | <TABLE><tr><td> </td><td class=example><pre>local [<VAR>option</VAR>] <VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small> | |
4695 | </pre></td></tr></table>For each argument, a local variable named <VAR>name</VAR> is created, | |
4696 | and assigned <VAR>value</VAR>. | |
4697 | The <VAR>option</VAR> can be any of the options accepted by <CODE>declare</CODE>. | |
4698 | <CODE>local</CODE> can only be used within a function; it makes the variable | |
4699 | <VAR>name</VAR> have a visible scope restricted to that function and its | |
4700 | children. The return status is zero unless <CODE>local</CODE> is used outside | |
4701 | a function, an invalid <VAR>name</VAR> is supplied, or <VAR>name</VAR> is a | |
4702 | readonly variable. | |
4703 | <P> | |
4704 | ||
4705 | <DT><CODE>logout</CODE> | |
4706 | <DD><A NAME="IDX100"></A> | |
4707 | <TABLE><tr><td> </td><td class=example><pre>logout [<VAR>n</VAR>] | |
4708 | </pre></td></tr></table>Exit a login shell, returning a status of <VAR>n</VAR> to the shell's | |
4709 | parent. | |
4710 | <P> | |
4711 | ||
4712 | <DT><CODE>mapfile</CODE> | |
4713 | <DD><A NAME="IDX101"></A> | |
4714 | <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>] [ | |
4715 | -C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>] | |
4716 | </pre></td></tr></table>Read lines from the standard input into array variable <VAR>array</VAR>, | |
4717 | or from file descriptor <VAR>fd</VAR> | |
4718 | if the <SAMP>`-u'</SAMP> option is supplied. | |
4719 | The variable <CODE>MAPFILE</CODE> is the default <VAR>array</VAR>. | |
4720 | Options, if supplied, have the following meanings: | |
4721 | <DL COMPACT> | |
4722 | ||
4723 | <DT><CODE>-n</CODE> | |
4724 | <DD>Copy at most <VAR>count</VAR> lines. If <VAR>count</VAR> is 0, all lines are copied. | |
4725 | <DT><CODE>-O</CODE> | |
4726 | <DD>Begin assigning to <VAR>array</VAR> at index <VAR>origin</VAR>. | |
4727 | The default index is 0. | |
4728 | <DT><CODE>-s</CODE> | |
4729 | <DD>Discard the first <VAR>count</VAR> lines read. | |
4730 | <DT><CODE>-t</CODE> | |
4731 | <DD>Remove a trailing line from each line read. | |
4732 | <DT><CODE>-u</CODE> | |
4733 | <DD>Read lines from file descriptor <VAR>fd</VAR> instead of the standard input. | |
4734 | <DT><CODE>-C</CODE> | |
4735 | <DD>Evaluate <VAR>callback</VAR> each time <VAR>quantum</VAR>P lines are read. | |
4736 | The <SAMP>`-c'</SAMP> option specifies <VAR>quantum</VAR>. | |
4737 | <DT><CODE>-c</CODE> | |
4738 | <DD>Specify the number of lines read between each call to <VAR>callback</VAR>. | |
4739 | </DL> | |
4740 | <P> | |
4741 | ||
4742 | If <SAMP>`-C'</SAMP> is specified without <SAMP>`-c'</SAMP>, | |
4743 | the default quantum is 5000. | |
4744 | When <VAR>callback</VAR> is evaluated, it is supplied the index of the next | |
4745 | array element to be assigned as an additional argument. | |
4746 | <VAR>callback</VAR> is evaluated after the line is read but before the | |
4747 | array element is assigned. | |
4748 | </P><P> | |
4749 | ||
4750 | If not supplied with an explicit origin, <CODE>mapfile</CODE> will clear <VAR>array</VAR> | |
4751 | before assigning to it. | |
4752 | </P><P> | |
4753 | ||
4754 | <CODE>mapfile</CODE> returns successfully unless an invalid option or option | |
4755 | argument is supplied, or <VAR>array</VAR> is invalid or unassignable. | |
4756 | </P><P> | |
4757 | ||
4758 | <DT><CODE>printf</CODE> | |
4759 | <DD><A NAME="IDX102"></A> | |
4760 | <TABLE><tr><td> </td><td class=example><pre>printf [-v <VAR>var</VAR>] <VAR>format</VAR> [<VAR>arguments</VAR>] | |
4761 | </pre></td></tr></table>Write the formatted <VAR>arguments</VAR> to the standard output under the | |
4762 | control of the <VAR>format</VAR>. | |
4763 | The <VAR>format</VAR> is a character string which contains three types of objects: | |
4764 | plain characters, which are simply copied to standard output, character | |
4765 | escape sequences, which are converted and copied to the standard output, and | |
4766 | format specifications, each of which causes printing of the next successive | |
4767 | <VAR>argument</VAR>. | |
4768 | In addition to the standard <CODE>printf(1)</CODE> formats, <SAMP>`%b'</SAMP> causes | |
4769 | <CODE>printf</CODE> to expand backslash escape sequences in the corresponding | |
4770 | <VAR>argument</VAR>, | |
4771 | (except that <SAMP>`\c'</SAMP> terminates output, backslashes in | |
4772 | <SAMP>`\''</SAMP>, <SAMP>`\"'</SAMP>, and <SAMP>`\?'</SAMP> are not removed, and octal escapes | |
4773 | beginning with <SAMP>`\0'</SAMP> may contain up to four digits), | |
4774 | and <SAMP>`%q'</SAMP> causes <CODE>printf</CODE> to output the | |
4775 | corresponding <VAR>argument</VAR> in a format that can be reused as shell input. | |
4776 | <P> | |
4777 | ||
4778 | The <SAMP>`-v'</SAMP> option causes the output to be assigned to the variable | |
4779 | <VAR>var</VAR> rather than being printed to the standard output. | |
4780 | </P><P> | |
4781 | ||
4782 | The <VAR>format</VAR> is reused as necessary to consume all of the <VAR>arguments</VAR>. | |
4783 | If the <VAR>format</VAR> requires more <VAR>arguments</VAR> than are supplied, the | |
4784 | extra format specifications behave as if a zero value or null string, as | |
4785 | appropriate, had been supplied. The return value is zero on success, | |
4786 | non-zero on failure. | |
4787 | </P><P> | |
4788 | ||
4789 | <DT><CODE>read</CODE> | |
4790 | <DD><A NAME="IDX103"></A> | |
4791 | <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>] [-p <VAR>prompt</VAR>] [-t <VAR>timeout</VAR>] [-u <VAR>fd</VAR>] [<VAR>name</VAR> <small>...</small>] | |
4792 | </pre></td></tr></table>One line is read from the standard input, or from the file descriptor | |
4793 | <VAR>fd</VAR> supplied as an argument to the <SAMP>`-u'</SAMP> option, and the first word | |
4794 | is assigned to the first <VAR>name</VAR>, the second word to the second <VAR>name</VAR>, | |
4795 | and so on, with leftover words and their intervening separators assigned | |
4796 | to the last <VAR>name</VAR>. | |
4797 | If there are fewer words read from the input stream than names, | |
4798 | the remaining names are assigned empty values. | |
4799 | The characters in the value of the <CODE>IFS</CODE> variable | |
4800 | are used to split the line into words. | |
4801 | The backslash character <SAMP>`\'</SAMP> may be used to remove any special | |
4802 | meaning for the next character read and for line continuation. | |
4803 | If no names are supplied, the line read is assigned to the | |
4804 | variable <CODE>REPLY</CODE>. | |
4805 | The return code is zero, unless end-of-file is encountered, <CODE>read</CODE> | |
4806 | times out (in which case the return code is greater than 128), or an | |
4807 | invalid file descriptor is supplied as the argument to <SAMP>`-u'</SAMP>. | |
4808 | <P> | |
4809 | ||
4810 | Options, if supplied, have the following meanings: | |
4811 | </P><P> | |
4812 | ||
4813 | <DL COMPACT> | |
4814 | <DT><CODE>-a <VAR>aname</VAR></CODE> | |
4815 | <DD>The words are assigned to sequential indices of the array variable | |
4816 | <VAR>aname</VAR>, starting at 0. | |
4817 | All elements are removed from <VAR>aname</VAR> before the assignment. | |
4818 | Other <VAR>name</VAR> arguments are ignored. | |
4819 | <P> | |
4820 | ||
4821 | <DT><CODE>-d <VAR>delim</VAR></CODE> | |
4822 | <DD>The first character of <VAR>delim</VAR> is used to terminate the input line, | |
4823 | rather than newline. | |
4824 | <P> | |
4825 | ||
4826 | <DT><CODE>-e</CODE> | |
4827 | <DD>Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) is used to obtain the line. | |
4828 | Readline uses the current (or default, if line editing was not previously | |
4829 | active) editing settings. | |
4830 | <P> | |
4831 | ||
4832 | <DT><CODE>-i <VAR>text</VAR></CODE> | |
4833 | <DD>If Readline is being used to read the line, <VAR>text</VAR> is placed into | |
4834 | the editing buffer before editing begins. | |
4835 | <P> | |
4836 | ||
4837 | <DT><CODE>-n <VAR>nchars</VAR></CODE> | |
4838 | <DD><CODE>read</CODE> returns after reading <VAR>nchars</VAR> characters rather than | |
4839 | waiting for a complete line of input. | |
4840 | <P> | |
4841 | ||
4842 | <DT><CODE>-p <VAR>prompt</VAR></CODE> | |
4843 | <DD>Display <VAR>prompt</VAR>, without a trailing newline, before attempting | |
4844 | to read any input. | |
4845 | The prompt is displayed only if input is coming from a terminal. | |
4846 | <P> | |
4847 | ||
4848 | <DT><CODE>-r</CODE> | |
4849 | <DD>If this option is given, backslash does not act as an escape character. | |
4850 | The backslash is considered to be part of the line. | |
4851 | In particular, a backslash-newline pair may not be used as a line | |
4852 | continuation. | |
4853 | <P> | |
4854 | ||
4855 | <DT><CODE>-s</CODE> | |
4856 | <DD>Silent mode. If input is coming from a terminal, characters are | |
4857 | not echoed. | |
4858 | <P> | |
4859 | ||
4860 | <DT><CODE>-t <VAR>timeout</VAR></CODE> | |
4861 | <DD>Cause <CODE>read</CODE> to time out and return failure if a complete line of | |
4862 | input is not read within <VAR>timeout</VAR> seconds. | |
4863 | <VAR>timeout</VAR> may be a decimal number with a fractional portion following | |
4864 | the decimal point. | |
4865 | This option is only effective if <CODE>read</CODE> is reading input from a | |
4866 | terminal, pipe, or other special file; it has no effect when reading | |
4867 | from regular files. | |
4868 | If <VAR>timeout</VAR> is 0, <CODE>read</CODE> returns success if input is available on | |
4869 | the specified file descriptor, failure otherwise. | |
4870 | The exit status is greater than 128 if the timeout is exceeded. | |
4871 | <P> | |
4872 | ||
4873 | <DT><CODE>-u <VAR>fd</VAR></CODE> | |
4874 | <DD>Read input from file descriptor <VAR>fd</VAR>. | |
4875 | <P> | |
4876 | ||
4877 | </DL> | |
4878 | <P> | |
4879 | ||
4880 | <DT><CODE>readarray</CODE> | |
4881 | <DD><A NAME="IDX104"></A> | |
4882 | <TABLE><tr><td> </td><td class=example><pre>readarray [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>] [ | |
4883 | -C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>] | |
4884 | </pre></td></tr></table>Read lines from the standard input into array variable <VAR>array</VAR>, | |
4885 | or from file descriptor <VAR>fd</VAR> | |
4886 | if the <SAMP>`-u'</SAMP> option is supplied. | |
4887 | <P> | |
4888 | ||
4889 | A synonym for <CODE>mapfile</CODE>. | |
4890 | </P><P> | |
4891 | ||
4892 | <DT><CODE>source</CODE> | |
4893 | <DD><A NAME="IDX105"></A> | |
4894 | <TABLE><tr><td> </td><td class=example><pre>source <VAR>filename</VAR> | |
4895 | </pre></td></tr></table>A synonym for <CODE>.</CODE> (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
4896 | <P> | |
4897 | ||
4898 | <DT><CODE>type</CODE> | |
4899 | <DD><A NAME="IDX106"></A> | |
4900 | <TABLE><tr><td> </td><td class=example><pre>type [-afptP] [<VAR>name</VAR> <small>...</small>] | |
4901 | </pre></td></tr></table>For each <VAR>name</VAR>, indicate how it would be interpreted if used as a | |
4902 | command name. | |
4903 | <P> | |
4904 | ||
4905 | If the <SAMP>`-t'</SAMP> option is used, <CODE>type</CODE> prints a single word | |
4906 | which is one of <SAMP>`alias'</SAMP>, <SAMP>`function'</SAMP>, <SAMP>`builtin'</SAMP>, | |
4907 | <SAMP>`file'</SAMP> or <SAMP>`keyword'</SAMP>, | |
4908 | if <VAR>name</VAR> is an alias, shell function, shell builtin, | |
4909 | disk file, or shell reserved word, respectively. | |
4910 | If the <VAR>name</VAR> is not found, then nothing is printed, and | |
4911 | <CODE>type</CODE> returns a failure status. | |
4912 | </P><P> | |
4913 | ||
4914 | If the <SAMP>`-p'</SAMP> option is used, <CODE>type</CODE> either returns the name | |
4915 | of the disk file that would be executed, or nothing if <SAMP>`-t'</SAMP> | |
4916 | would not return <SAMP>`file'</SAMP>. | |
4917 | </P><P> | |
4918 | ||
4919 | The <SAMP>`-P'</SAMP> option forces a path search for each <VAR>name</VAR>, even if | |
4920 | <SAMP>`-t'</SAMP> would not return <SAMP>`file'</SAMP>. | |
4921 | </P><P> | |
4922 | ||
4923 | If a command is hashed, <SAMP>`-p'</SAMP> and <SAMP>`-P'</SAMP> print the hashed value, | |
4924 | not necessarily the file that appears first in <CODE>$PATH</CODE>. | |
4925 | </P><P> | |
4926 | ||
4927 | If the <SAMP>`-a'</SAMP> option is used, <CODE>type</CODE> returns all of the places | |
4928 | that contain an executable named <VAR>file</VAR>. | |
4929 | This includes aliases and functions, if and only if the <SAMP>`-p'</SAMP> option | |
4930 | is not also used. | |
4931 | </P><P> | |
4932 | ||
4933 | If the <SAMP>`-f'</SAMP> option is used, <CODE>type</CODE> does not attempt to find | |
4934 | shell functions, as with the <CODE>command</CODE> builtin. | |
4935 | </P><P> | |
4936 | ||
4937 | The return status is zero if all of the <VAR>names</VAR> are found, non-zero | |
4938 | if any are not found. | |
4939 | </P><P> | |
4940 | ||
4941 | <DT><CODE>typeset</CODE> | |
4942 | <DD><A NAME="IDX107"></A> | |
4943 | <TABLE><tr><td> </td><td class=example><pre>typeset [-afFrxi] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>] | |
4944 | </pre></td></tr></table>The <CODE>typeset</CODE> command is supplied for compatibility with the Korn | |
4945 | shell; however, it has been deprecated in favor of the <CODE>declare</CODE> | |
4946 | builtin command. | |
4947 | <P> | |
4948 | ||
4949 | <DT><CODE>ulimit</CODE> | |
4950 | <DD><A NAME="IDX108"></A> | |
4951 | <TABLE><tr><td> </td><td class=example><pre>ulimit [-abcdefilmnpqrstuvxHST] [<VAR>limit</VAR>] | |
4952 | </pre></td></tr></table><CODE>ulimit</CODE> provides control over the resources available to processes | |
4953 | started by the shell, on systems that allow such control. If an | |
4954 | option is given, it is interpreted as follows: | |
4955 | <DL COMPACT> | |
4956 | <DT><CODE>-S</CODE> | |
4957 | <DD>Change and report the soft limit associated with a resource. | |
4958 | <P> | |
4959 | ||
4960 | <DT><CODE>-H</CODE> | |
4961 | <DD>Change and report the hard limit associated with a resource. | |
4962 | <P> | |
4963 | ||
4964 | <DT><CODE>-a</CODE> | |
4965 | <DD>All current limits are reported. | |
4966 | <P> | |
4967 | ||
4968 | <DT><CODE>-b</CODE> | |
4969 | <DD>The maximum socket buffer size. | |
4970 | <P> | |
4971 | ||
4972 | <DT><CODE>-c</CODE> | |
4973 | <DD>The maximum size of core files created. | |
4974 | <P> | |
4975 | ||
4976 | <DT><CODE>-d</CODE> | |
4977 | <DD>The maximum size of a process's data segment. | |
4978 | <P> | |
4979 | ||
4980 | <DT><CODE>-e</CODE> | |
4981 | <DD>The maximum scheduling priority ("nice"). | |
4982 | <P> | |
4983 | ||
4984 | <DT><CODE>-f</CODE> | |
4985 | <DD>The maximum size of files written by the shell and its children. | |
4986 | <P> | |
4987 | ||
4988 | <DT><CODE>-i</CODE> | |
4989 | <DD>The maximum number of pending signals. | |
4990 | <P> | |
4991 | ||
4992 | <DT><CODE>-l</CODE> | |
4993 | <DD>The maximum size that may be locked into memory. | |
4994 | <P> | |
4995 | ||
4996 | <DT><CODE>-m</CODE> | |
4997 | <DD>The maximum resident set size. | |
4998 | <P> | |
4999 | ||
5000 | <DT><CODE>-n</CODE> | |
5001 | <DD>The maximum number of open file descriptors. | |
5002 | <P> | |
5003 | ||
5004 | <DT><CODE>-p</CODE> | |
5005 | <DD>The pipe buffer size. | |
5006 | <P> | |
5007 | ||
5008 | <DT><CODE>-q</CODE> | |
5009 | <DD>The maximum number of bytes in POSIX message queues. | |
5010 | <P> | |
5011 | ||
5012 | <DT><CODE>-r</CODE> | |
5013 | <DD>The maximum real-time scheduling priority. | |
5014 | <P> | |
5015 | ||
5016 | <DT><CODE>-s</CODE> | |
5017 | <DD>The maximum stack size. | |
5018 | <P> | |
5019 | ||
5020 | <DT><CODE>-t</CODE> | |
5021 | <DD>The maximum amount of cpu time in seconds. | |
5022 | <P> | |
5023 | ||
5024 | <DT><CODE>-u</CODE> | |
5025 | <DD>The maximum number of processes available to a single user. | |
5026 | <P> | |
5027 | ||
5028 | <DT><CODE>-v</CODE> | |
5029 | <DD>The maximum amount of virtual memory available to the process. | |
5030 | <P> | |
5031 | ||
5032 | <DT><CODE>-x</CODE> | |
5033 | <DD>The maximum number of file locks. | |
5034 | <P> | |
5035 | ||
5036 | <DT><CODE>-T</CODE> | |
5037 | <DD>The maximum number of threads. | |
5038 | <P> | |
5039 | ||
5040 | </DL> | |
5041 | <P> | |
5042 | ||
5043 | If <VAR>limit</VAR> is given, it is the new value of the specified resource; | |
5044 | the special <VAR>limit</VAR> values <CODE>hard</CODE>, <CODE>soft</CODE>, and | |
5045 | <CODE>unlimited</CODE> stand for the current hard limit, the current soft limit, | |
5046 | and no limit, respectively. | |
5047 | A hard limit cannot be increased by a non-root user once it is set; | |
5048 | a soft limit may be increased up to the value of the hard limit. | |
5049 | Otherwise, the current value of the soft limit for the specified resource | |
5050 | is printed, unless the <SAMP>`-H'</SAMP> option is supplied. | |
5051 | When setting new limits, if neither <SAMP>`-H'</SAMP> nor <SAMP>`-S'</SAMP> is supplied, | |
5052 | both the hard and soft limits are set. | |
5053 | If no option is given, then <SAMP>`-f'</SAMP> is assumed. Values are in 1024-byte | |
5054 | increments, except for <SAMP>`-t'</SAMP>, which is in seconds, <SAMP>`-p'</SAMP>, | |
5055 | which is in units of 512-byte blocks, and <SAMP>`-n'</SAMP> and <SAMP>`-u'</SAMP>, which | |
5056 | are unscaled values. | |
5057 | </P><P> | |
5058 | ||
5059 | The return status is zero unless an invalid option or argument is supplied, | |
5060 | or an error occurs while setting a new limit. | |
5061 | </P><P> | |
5062 | ||
5063 | <DT><CODE>unalias</CODE> | |
5064 | <DD><A NAME="IDX109"></A> | |
5065 | <TABLE><tr><td> </td><td class=example><pre>unalias [-a] [<VAR>name</VAR> <small>...</small> ] | |
5066 | </pre></td></tr></table><P> | |
5067 | ||
5068 | Remove each <VAR>name</VAR> from the list of aliases. If <SAMP>`-a'</SAMP> is | |
5069 | supplied, all aliases are removed. | |
5070 | Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>. | |
5071 | </P><P> | |
5072 | ||
5073 | </DL> | |
5074 | <P> | |
5075 | ||
5076 | <A NAME="Modifying Shell Behavior"></A> | |
5077 | <HR SIZE="6"> | |
5078 | <A NAME="SEC61"></A> | |
5079 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
5080 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> < </A>]</TD> | |
5081 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> > </A>]</TD> | |
5082 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD> | |
5083 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD> | |
5084 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD> | |
5085 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5086 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5087 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5088 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5089 | </TR></TABLE> | |
5090 | <H2> 4.3 Modifying Shell Behavior </H2> | |
5091 | <!--docid::SEC61::--> | |
5092 | ||
5093 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
5094 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Change the values of shell attributes and | |
5095 | positional parameters.</TD></TR> | |
5096 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Modify shell optional behavior.</TD></TR> | |
5097 | </TABLE></BLOCKQUOTE> | |
5098 | <P> | |
5099 | ||
5100 | <A NAME="The Set Builtin"></A> | |
5101 | <HR SIZE="6"> | |
5102 | <A NAME="SEC62"></A> | |
5103 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
5104 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> < </A>]</TD> | |
5105 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> > </A>]</TD> | |
5106 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD> | |
5107 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD> | |
5108 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD> | |
5109 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5110 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5111 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5112 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5113 | </TR></TABLE> | |
5114 | <H3> 4.3.1 The Set Builtin </H3> | |
5115 | <!--docid::SEC62::--> | |
5116 | <P> | |
5117 | ||
5118 | This builtin is so complicated that it deserves its own section. <CODE>set</CODE> | |
5119 | allows you to change the values of shell options and set the positional | |
5120 | parameters, or to display the names and values of shell variables. | |
5121 | </P><P> | |
5122 | ||
5123 | <DL COMPACT> | |
5124 | <DT><CODE>set</CODE> | |
5125 | <DD><A NAME="IDX110"></A> | |
5126 | <TABLE><tr><td> </td><td class=example><pre>set [--abefhkmnptuvxBCEHPT] [-o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>] | |
5127 | set [+abefhkmnptuvxBCEHPT] [+o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>] | |
5128 | </pre></td></tr></table><P> | |
5129 | ||
5130 | If no options or arguments are supplied, <CODE>set</CODE> displays the names | |
5131 | and values of all shell variables and functions, sorted according to the | |
5132 | current locale, in a format that may be reused as input | |
5133 | for setting or resetting the currently-set variables. | |
5134 | Read-only variables cannot be reset. | |
5135 | In POSIX mode, only shell variables are listed. | |
5136 | </P><P> | |
5137 | ||
5138 | When options are supplied, they set or unset shell attributes. | |
5139 | Options, if specified, have the following meanings: | |
5140 | </P><P> | |
5141 | ||
5142 | <DL COMPACT> | |
5143 | <DT><CODE>-a</CODE> | |
5144 | <DD>Mark variables and function which are modified or created for export | |
5145 | to the environment of subsequent commands. | |
5146 | <P> | |
5147 | ||
5148 | <DT><CODE>-b</CODE> | |
5149 | <DD>Cause the status of terminated background jobs to be reported | |
5150 | immediately, rather than before printing the next primary prompt. | |
5151 | <P> | |
5152 | ||
5153 | <DT><CODE>-e</CODE> | |
5154 | <DD>Exit immediately if a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>) exits | |
5155 | with a non-zero status, unless the command that fails is part of the | |
5156 | command list immediately following a <CODE>while</CODE> or <CODE>until</CODE> keyword, | |
5157 | part of the test in an <CODE>if</CODE> statement, | |
5158 | part of a command executed in a <CODE>&&</CODE> or <CODE>||b</CODE> list, | |
5159 | any command in a pipeline but the last, | |
5160 | or if the command's return status is being inverted using <CODE>!</CODE>. | |
5161 | Failing simple commands that are part of shell functions or command lists | |
5162 | enclosed in braces or parentheses satisfying the above conditions do not | |
5163 | cause the shell to exit. | |
5164 | A trap on <CODE>ERR</CODE>, if set, is executed before the shell exits. | |
5165 | <P> | |
5166 | ||
5167 | <DT><CODE>-f</CODE> | |
5168 | <DD>Disable file name generation (globbing). | |
5169 | <P> | |
5170 | ||
5171 | <DT><CODE>-h</CODE> | |
5172 | <DD>Locate and remember (hash) commands as they are looked up for execution. | |
5173 | This option is enabled by default. | |
5174 | <P> | |
5175 | ||
5176 | <DT><CODE>-k</CODE> | |
5177 | <DD>All arguments in the form of assignment statements are placed | |
5178 | in the environment for a command, not just those that precede | |
5179 | the command name. | |
5180 | <P> | |
5181 | ||
5182 | <DT><CODE>-m</CODE> | |
5183 | <DD>Job control is enabled (see section <A HREF="bashref.html#SEC91">7. Job Control</A>). | |
5184 | <P> | |
5185 | ||
5186 | <DT><CODE>-n</CODE> | |
5187 | <DD>Read commands but do not execute them; this may be used to check a | |
5188 | script for syntax errors. | |
5189 | This option is ignored by interactive shells. | |
5190 | <P> | |
5191 | ||
5192 | <DT><CODE>-o <VAR>option-name</VAR></CODE> | |
5193 | <DD><P> | |
5194 | ||
5195 | Set the option corresponding to <VAR>option-name</VAR>: | |
5196 | </P><P> | |
5197 | ||
5198 | <DL COMPACT> | |
5199 | <DT><CODE>allexport</CODE> | |
5200 | <DD>Same as <CODE>-a</CODE>. | |
5201 | <P> | |
5202 | ||
5203 | <DT><CODE>braceexpand</CODE> | |
5204 | <DD>Same as <CODE>-B</CODE>. | |
5205 | <P> | |
5206 | ||
5207 | <DT><CODE>emacs</CODE> | |
5208 | <DD>Use an <CODE>emacs</CODE>-style line editing interface (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>). | |
5209 | This also affects the editing interface used for <CODE>read -e</CODE>. | |
5210 | <P> | |
5211 | ||
5212 | <DT><CODE>errexit</CODE> | |
5213 | <DD>Same as <CODE>-e</CODE>. | |
5214 | <P> | |
5215 | ||
5216 | <DT><CODE>errtrace</CODE> | |
5217 | <DD>Same as <CODE>-E</CODE>. | |
5218 | <P> | |
5219 | ||
5220 | <DT><CODE>functrace</CODE> | |
5221 | <DD>Same as <CODE>-T</CODE>. | |
5222 | <P> | |
5223 | ||
5224 | <DT><CODE>hashall</CODE> | |
5225 | <DD>Same as <CODE>-h</CODE>. | |
5226 | <P> | |
5227 | ||
5228 | <DT><CODE>histexpand</CODE> | |
5229 | <DD>Same as <CODE>-H</CODE>. | |
5230 | <P> | |
5231 | ||
5232 | <DT><CODE>history</CODE> | |
5233 | <DD>Enable command history, as described in <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>. | |
5234 | This option is on by default in interactive shells. | |
5235 | <P> | |
5236 | ||
5237 | <DT><CODE>ignoreeof</CODE> | |
5238 | <DD>An interactive shell will not exit upon reading EOF. | |
5239 | <P> | |
5240 | ||
5241 | <DT><CODE>keyword</CODE> | |
5242 | <DD>Same as <CODE>-k</CODE>. | |
5243 | <P> | |
5244 | ||
5245 | <DT><CODE>monitor</CODE> | |
5246 | <DD>Same as <CODE>-m</CODE>. | |
5247 | <P> | |
5248 | ||
5249 | <DT><CODE>noclobber</CODE> | |
5250 | <DD>Same as <CODE>-C</CODE>. | |
5251 | <P> | |
5252 | ||
5253 | <DT><CODE>noexec</CODE> | |
5254 | <DD>Same as <CODE>-n</CODE>. | |
5255 | <P> | |
5256 | ||
5257 | <DT><CODE>noglob</CODE> | |
5258 | <DD>Same as <CODE>-f</CODE>. | |
5259 | <P> | |
5260 | ||
5261 | <DT><CODE>nolog</CODE> | |
5262 | <DD>Currently ignored. | |
5263 | <P> | |
5264 | ||
5265 | <DT><CODE>notify</CODE> | |
5266 | <DD>Same as <CODE>-b</CODE>. | |
5267 | <P> | |
5268 | ||
5269 | <DT><CODE>nounset</CODE> | |
5270 | <DD>Same as <CODE>-u</CODE>. | |
5271 | <P> | |
5272 | ||
5273 | <DT><CODE>onecmd</CODE> | |
5274 | <DD>Same as <CODE>-t</CODE>. | |
5275 | <P> | |
5276 | ||
5277 | <DT><CODE>physical</CODE> | |
5278 | <DD>Same as <CODE>-P</CODE>. | |
5279 | <P> | |
5280 | ||
5281 | <DT><CODE>pipefail</CODE> | |
5282 | <DD>If set, the return value of a pipeline is the value of the last | |
5283 | (rightmost) command to exit with a non-zero status, or zero if all | |
5284 | commands in the pipeline exit successfully. | |
5285 | This option is disabled by default. | |
5286 | <P> | |
5287 | ||
5288 | <DT><CODE>posix</CODE> | |
5289 | <DD>Change the behavior of Bash where the default operation differs | |
5290 | from the POSIX standard to match the standard | |
5291 | (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>). | |
5292 | This is intended to make Bash behave as a strict superset of that | |
5293 | standard. | |
5294 | <P> | |
5295 | ||
5296 | <DT><CODE>privileged</CODE> | |
5297 | <DD>Same as <CODE>-p</CODE>. | |
5298 | <P> | |
5299 | ||
5300 | <DT><CODE>verbose</CODE> | |
5301 | <DD>Same as <CODE>-v</CODE>. | |
5302 | <P> | |
5303 | ||
5304 | <DT><CODE>vi</CODE> | |
5305 | <DD>Use a <CODE>vi</CODE>-style line editing interface. | |
5306 | This also affects the editing interface used for <CODE>read -e</CODE>. | |
5307 | <P> | |
5308 | ||
5309 | <DT><CODE>xtrace</CODE> | |
5310 | <DD>Same as <CODE>-x</CODE>. | |
5311 | </DL> | |
5312 | <P> | |
5313 | ||
5314 | <DT><CODE>-p</CODE> | |
5315 | <DD>Turn on privileged mode. | |
5316 | In this mode, the <CODE>$BASH_ENV</CODE> and <CODE>$ENV</CODE> files are not | |
5317 | processed, shell functions are not inherited from the environment, | |
5318 | and the <CODE>SHELLOPTS</CODE>, <CODE>CDPATH</CODE> and <CODE>GLOBIGNORE</CODE> variables, | |
5319 | if they appear in the environment, are ignored. | |
5320 | If the shell is started with the effective user (group) id not equal to the | |
5321 | real user (group) id, and the <CODE>-p</CODE> option is not supplied, these actions | |
5322 | are taken and the effective user id is set to the real user id. | |
5323 | If the <CODE>-p</CODE> option is supplied at startup, the effective user id is | |
5324 | not reset. | |
5325 | Turning this option off causes the effective user | |
5326 | and group ids to be set to the real user and group ids. | |
5327 | <P> | |
5328 | ||
5329 | <DT><CODE>-t</CODE> | |
5330 | <DD>Exit after reading and executing one command. | |
5331 | <P> | |
5332 | ||
5333 | <DT><CODE>-u</CODE> | |
5334 | <DD>Treat unset variables as an error when performing parameter expansion. | |
5335 | An error message will be written to the standard error, and a non-interactive | |
5336 | shell will exit. | |
5337 | <P> | |
5338 | ||
5339 | <DT><CODE>-v</CODE> | |
5340 | <DD>Print shell input lines as they are read. | |
5341 | <P> | |
5342 | ||
5343 | <DT><CODE>-x</CODE> | |
5344 | <DD>Print a trace of simple commands, <CODE>for</CODE> commands, <CODE>case</CODE> | |
5345 | commands, <CODE>select</CODE> commands, and arithmetic <CODE>for</CODE> commands | |
5346 | and their arguments or associated word lists after they are | |
5347 | expanded and before they are executed. The value of the <CODE>PS4</CODE> | |
5348 | variable is expanded and the resultant value is printed before | |
5349 | the command and its expanded arguments. | |
5350 | <P> | |
5351 | ||
5352 | <DT><CODE>-B</CODE> | |
5353 | <DD>The shell will perform brace expansion (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>). | |
5354 | This option is on by default. | |
5355 | <P> | |
5356 | ||
5357 | <DT><CODE>-C</CODE> | |
5358 | <DD>Prevent output redirection using <SAMP>`>'</SAMP>, <SAMP>`>&'</SAMP>, and <SAMP>`<>'</SAMP> | |
5359 | from overwriting existing files. | |
5360 | <P> | |
5361 | ||
5362 | <DT><CODE>-E</CODE> | |
5363 | <DD>If set, any trap on <CODE>ERR</CODE> is inherited by shell functions, command | |
5364 | substitutions, and commands executed in a subshell environment. | |
5365 | The <CODE>ERR</CODE> trap is normally not inherited in such cases. | |
5366 | <P> | |
5367 | ||
5368 | <DT><CODE>-H</CODE> | |
5369 | <DD>Enable <SAMP>`!'</SAMP> style history substitution (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>). | |
5370 | This option is on by default for interactive shells. | |
5371 | <P> | |
5372 | ||
5373 | <DT><CODE>-P</CODE> | |
5374 | <DD>If set, do not follow symbolic links when performing commands such as | |
5375 | <CODE>cd</CODE> which change the current directory. The physical directory | |
5376 | is used instead. By default, Bash follows | |
5377 | the logical chain of directories when performing commands | |
5378 | which change the current directory. | |
5379 | <P> | |
5380 | ||
5381 | For example, if <TT>`/usr/sys'</TT> is a symbolic link to <TT>`/usr/local/sys'</TT> | |
5382 | then: | |
5383 | <TABLE><tr><td> </td><td class=example><pre>$ cd /usr/sys; echo $PWD | |
5384 | /usr/sys | |
5385 | $ cd ..; pwd | |
5386 | /usr | |
5387 | </pre></td></tr></table></P><P> | |
5388 | ||
5389 | If <CODE>set -P</CODE> is on, then: | |
5390 | <TABLE><tr><td> </td><td class=example><pre>$ cd /usr/sys; echo $PWD | |
5391 | /usr/local/sys | |
5392 | $ cd ..; pwd | |
5393 | /usr/local | |
5394 | </pre></td></tr></table></P><P> | |
5395 | ||
5396 | <DT><CODE>-T</CODE> | |
5397 | <DD>If set, any trap on <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> are inherited by | |
5398 | shell functions, command substitutions, and commands executed | |
5399 | in a subshell environment. | |
5400 | The <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps are normally not inherited | |
5401 | in such cases. | |
5402 | <P> | |
5403 | ||
5404 | <DT><CODE>--</CODE> | |
5405 | <DD>If no arguments follow this option, then the positional parameters are | |
5406 | unset. Otherwise, the positional parameters are set to the | |
5407 | <VAR>arguments</VAR>, even if some of them begin with a <SAMP>`-'</SAMP>. | |
5408 | <P> | |
5409 | ||
5410 | <DT><CODE>-</CODE> | |
5411 | <DD>Signal the end of options, cause all remaining <VAR>arguments</VAR> | |
5412 | to be assigned to the positional parameters. The <SAMP>`-x'</SAMP> | |
5413 | and <SAMP>`-v'</SAMP> options are turned off. | |
5414 | If there are no arguments, the positional parameters remain unchanged. | |
5415 | </DL> | |
5416 | <P> | |
5417 | ||
5418 | Using <SAMP>`+'</SAMP> rather than <SAMP>`-'</SAMP> causes these options to be | |
5419 | turned off. The options can also be used upon invocation of the | |
5420 | shell. The current set of options may be found in <CODE>$-</CODE>. | |
5421 | </P><P> | |
5422 | ||
5423 | The remaining N <VAR>arguments</VAR> are positional parameters and are | |
5424 | assigned, in order, to <CODE>$1</CODE>, <CODE>$2</CODE>, <small>...</small> <CODE>$N</CODE>. | |
5425 | The special parameter <CODE>#</CODE> is set to N. | |
5426 | </P><P> | |
5427 | ||
5428 | The return status is always zero unless an invalid option is supplied. | |
5429 | </DL> | |
5430 | <P> | |
5431 | ||
5432 | <A NAME="The Shopt Builtin"></A> | |
5433 | <HR SIZE="6"> | |
5434 | <A NAME="SEC63"></A> | |
5435 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
5436 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> < </A>]</TD> | |
5437 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> > </A>]</TD> | |
5438 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD> | |
5439 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD> | |
5440 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD> | |
5441 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5442 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5443 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5444 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5445 | </TR></TABLE> | |
5446 | <H3> 4.3.2 The Shopt Builtin </H3> | |
5447 | <!--docid::SEC63::--> | |
5448 | <P> | |
5449 | ||
5450 | This builtin allows you to change additional shell optional behavior. | |
5451 | </P><P> | |
5452 | ||
5453 | <DL COMPACT> | |
5454 | ||
5455 | <DT><CODE>shopt</CODE> | |
5456 | <DD><A NAME="IDX111"></A> | |
5457 | <TABLE><tr><td> </td><td class=example><pre>shopt [-pqsu] [-o] [<VAR>optname</VAR> <small>...</small>] | |
5458 | </pre></td></tr></table>Toggle the values of variables controlling optional shell behavior. | |
5459 | With no options, or with the <SAMP>`-p'</SAMP> option, a list of all settable | |
5460 | options is displayed, with an indication of whether or not each is set. | |
5461 | The <SAMP>`-p'</SAMP> option causes output to be displayed in a form that | |
5462 | may be reused as input. | |
5463 | Other options have the following meanings: | |
5464 | <P> | |
5465 | ||
5466 | <DL COMPACT> | |
5467 | <DT><CODE>-s</CODE> | |
5468 | <DD>Enable (set) each <VAR>optname</VAR>. | |
5469 | <P> | |
5470 | ||
5471 | <DT><CODE>-u</CODE> | |
5472 | <DD>Disable (unset) each <VAR>optname</VAR>. | |
5473 | <P> | |
5474 | ||
5475 | <DT><CODE>-q</CODE> | |
5476 | <DD>Suppresses normal output; the return status | |
5477 | indicates whether the <VAR>optname</VAR> is set or unset. | |
5478 | If multiple <VAR>optname</VAR> arguments are given with <SAMP>`-q'</SAMP>, | |
5479 | the return status is zero if all <VAR>optnames</VAR> are enabled; | |
5480 | non-zero otherwise. | |
5481 | <P> | |
5482 | ||
5483 | <DT><CODE>-o</CODE> | |
5484 | <DD>Restricts the values of | |
5485 | <VAR>optname</VAR> to be those defined for the <SAMP>`-o'</SAMP> option to the | |
5486 | <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
5487 | </DL> | |
5488 | <P> | |
5489 | ||
5490 | If either <SAMP>`-s'</SAMP> or <SAMP>`-u'</SAMP> | |
5491 | is used with no <VAR>optname</VAR> arguments, the display is limited to | |
5492 | those options which are set or unset, respectively. | |
5493 | </P><P> | |
5494 | ||
5495 | Unless otherwise noted, the <CODE>shopt</CODE> options are disabled (off) | |
5496 | by default. | |
5497 | </P><P> | |
5498 | ||
5499 | The return status when listing options is zero if all <VAR>optnames</VAR> | |
5500 | are enabled, non-zero otherwise. When setting or unsetting options, | |
5501 | the return status is zero unless an <VAR>optname</VAR> is not a valid shell | |
5502 | option. | |
5503 | </P><P> | |
5504 | ||
5505 | The list of <CODE>shopt</CODE> options is: | |
5506 | <DL COMPACT> | |
5507 | ||
5508 | <DT><CODE>autocd</CODE> | |
5509 | <DD>If set, a command name that is the name of a directory is executed as if | |
5510 | it were the argument to the <CODE>cd</CODE> command. | |
5511 | This option is only used by interactive shells. | |
5512 | <P> | |
5513 | ||
5514 | <DT><CODE>cdable_vars</CODE> | |
5515 | <DD>If this is set, an argument to the <CODE>cd</CODE> builtin command that | |
5516 | is not a directory is assumed to be the name of a variable whose | |
5517 | value is the directory to change to. | |
5518 | <P> | |
5519 | ||
5520 | <DT><CODE>cdspell</CODE> | |
5521 | <DD>If set, minor errors in the spelling of a directory component in a | |
5522 | <CODE>cd</CODE> command will be corrected. | |
5523 | The errors checked for are transposed characters, | |
5524 | a missing character, and a character too many. | |
5525 | If a correction is found, the corrected path is printed, | |
5526 | and the command proceeds. | |
5527 | This option is only used by interactive shells. | |
5528 | <P> | |
5529 | ||
5530 | <DT><CODE>checkhash</CODE> | |
5531 | <DD>If this is set, Bash checks that a command found in the hash | |
5532 | table exists before trying to execute it. If a hashed command no | |
5533 | longer exists, a normal path search is performed. | |
5534 | <P> | |
5535 | ||
5536 | <DT><CODE>checkjobs</CODE> | |
5537 | <DD>If set, Bash lists the status of any stopped and running jobs before | |
5538 | exiting an interactive shell. If any jobs are running, this causes | |
5539 | the exit to be deferred until a second exit is attempted without an | |
5540 | intervening command (see section <A HREF="bashref.html#SEC91">7. Job Control</A>). | |
5541 | The shell always postpones exiting if any jobs are stopped. | |
5542 | <P> | |
5543 | ||
5544 | <DT><CODE>checkwinsize</CODE> | |
5545 | <DD>If set, Bash checks the window size after each command | |
5546 | and, if necessary, updates the values of | |
5547 | <CODE>LINES</CODE> and <CODE>COLUMNS</CODE>. | |
5548 | <P> | |
5549 | ||
5550 | <DT><CODE>cmdhist</CODE> | |
5551 | <DD>If set, Bash | |
5552 | attempts to save all lines of a multiple-line | |
5553 | command in the same history entry. This allows | |
5554 | easy re-editing of multi-line commands. | |
5555 | <P> | |
5556 | ||
5557 | <DT><CODE>compat31</CODE> | |
5558 | <DD>If set, Bash | |
5559 | changes its behavior to that of version 3.1 with respect to quoted | |
5560 | arguments to the conditional command's =~ operator. | |
5561 | <P> | |
5562 | ||
5563 | <DT><CODE>dirspell</CODE> | |
5564 | <DD>If set, Bash | |
5565 | attempts spelling correction on directory names during word completion | |
5566 | if the directory name initially supplied does not exist. | |
5567 | <P> | |
5568 | ||
5569 | <DT><CODE>dotglob</CODE> | |
5570 | <DD>If set, Bash includes filenames beginning with a `.' in | |
5571 | the results of filename expansion. | |
5572 | <P> | |
5573 | ||
5574 | <DT><CODE>execfail</CODE> | |
5575 | <DD>If this is set, a non-interactive shell will not exit if | |
5576 | it cannot execute the file specified as an argument to the <CODE>exec</CODE> | |
5577 | builtin command. An interactive shell does not exit if <CODE>exec</CODE> | |
5578 | fails. | |
5579 | <P> | |
5580 | ||
5581 | <DT><CODE>expand_aliases</CODE> | |
5582 | <DD>If set, aliases are expanded as described below under Aliases, | |
5583 | <A HREF="bashref.html#SEC84">6.6 Aliases</A>. | |
5584 | This option is enabled by default for interactive shells. | |
5585 | <P> | |
5586 | ||
5587 | <DT><CODE>extdebug</CODE> | |
5588 | <DD>If set, behavior intended for use by debuggers is enabled: | |
5589 | <P> | |
5590 | ||
5591 | <OL> | |
5592 | <LI> | |
5593 | The <SAMP>`-F'</SAMP> option to the <CODE>declare</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>) | |
5594 | displays the source file name and line number corresponding to each function | |
5595 | name supplied as an argument. | |
5596 | <P> | |
5597 | ||
5598 | <LI> | |
5599 | If the command run by the <CODE>DEBUG</CODE> trap returns a non-zero value, the | |
5600 | next command is skipped and not executed. | |
5601 | <P> | |
5602 | ||
5603 | <LI> | |
5604 | If the command run by the <CODE>DEBUG</CODE> trap returns a value of 2, and the | |
5605 | shell is executing in a subroutine (a shell function or a shell script | |
5606 | executed by the <CODE>.</CODE> or <CODE>source</CODE> builtins), a call to | |
5607 | <CODE>return</CODE> is simulated. | |
5608 | <P> | |
5609 | ||
5610 | <LI> | |
5611 | <CODE>BASH_ARGC</CODE> and <CODE>BASH_ARGV</CODE> are updated as described in their | |
5612 | descriptions (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
5613 | <P> | |
5614 | ||
5615 | <LI> | |
5616 | Function tracing is enabled: command substitution, shell functions, and | |
5617 | subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the | |
5618 | <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps. | |
5619 | <P> | |
5620 | ||
5621 | <LI> | |
5622 | Error tracing is enabled: command substitution, shell functions, and | |
5623 | subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the | |
5624 | <CODE>ERROR</CODE> trap. | |
5625 | </OL> | |
5626 | <P> | |
5627 | ||
5628 | <DT><CODE>extglob</CODE> | |
5629 | <DD>If set, the extended pattern matching features described above | |
5630 | (see section <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>) are enabled. | |
5631 | <P> | |
5632 | ||
5633 | <DT><CODE>extquote</CODE> | |
5634 | <DD>If set, <CODE>$'<VAR>string</VAR>'</CODE> and <CODE>$"<VAR>string</VAR>"</CODE> quoting is | |
5635 | performed within <CODE>${<VAR>parameter</VAR>}</CODE> expansions | |
5636 | enclosed in double quotes. This option is enabled by default. | |
5637 | <P> | |
5638 | ||
5639 | <DT><CODE>failglob</CODE> | |
5640 | <DD>If set, patterns which fail to match filenames during pathname expansion | |
5641 | result in an expansion error. | |
5642 | <P> | |
5643 | ||
5644 | <DT><CODE>force_fignore</CODE> | |
5645 | <DD>If set, the suffixes specified by the <CODE>FIGNORE</CODE> shell variable | |
5646 | cause words to be ignored when performing word completion even if | |
5647 | the ignored words are the only possible completions. | |
5648 | See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>. | |
5649 | This option is enabled by default. | |
5650 | <P> | |
5651 | ||
5652 | <DT><CODE>globstar</CODE> | |
5653 | <DD>If set, the pattern <SAMP>`**'</SAMP> used in a filename expansion context will | |
5654 | match a files and zero or more directories and subdirectories. | |
5655 | If the pattern is followed by a <SAMP>`/'</SAMP>, only directories and | |
5656 | subdirectories match. | |
5657 | <P> | |
5658 | ||
5659 | <DT><CODE>gnu_errfmt</CODE> | |
5660 | <DD>If set, shell error messages are written in the standard GNU error | |
5661 | message format. | |
5662 | <P> | |
5663 | ||
5664 | <DT><CODE>histappend</CODE> | |
5665 | <DD>If set, the history list is appended to the file named by the value | |
5666 | of the <CODE>HISTFILE</CODE> | |
5667 | variable when the shell exits, rather than overwriting the file. | |
5668 | <P> | |
5669 | ||
5670 | <DT><CODE>histreedit</CODE> | |
5671 | <DD>If set, and Readline | |
5672 | is being used, a user is given the opportunity to re-edit a | |
5673 | failed history substitution. | |
5674 | <P> | |
5675 | ||
5676 | <DT><CODE>histverify</CODE> | |
5677 | <DD>If set, and Readline | |
5678 | is being used, the results of history substitution are not immediately | |
5679 | passed to the shell parser. Instead, the resulting line is loaded into | |
5680 | the Readline editing buffer, allowing further modification. | |
5681 | <P> | |
5682 | ||
5683 | <DT><CODE>hostcomplete</CODE> | |
5684 | <DD>If set, and Readline is being used, Bash will attempt to perform | |
5685 | hostname completion when a word containing a <SAMP>`@'</SAMP> is being | |
5686 | completed (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>). This option is enabled | |
5687 | by default. | |
5688 | <P> | |
5689 | ||
5690 | <DT><CODE>huponexit</CODE> | |
5691 | <DD>If set, Bash will send <CODE>SIGHUP</CODE> to all jobs when an interactive | |
5692 | login shell exits (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>). | |
5693 | <P> | |
5694 | ||
5695 | <DT><CODE>interactive_comments</CODE> | |
5696 | <DD>Allow a word beginning with <SAMP>`#'</SAMP> | |
5697 | to cause that word and all remaining characters on that | |
5698 | line to be ignored in an interactive shell. | |
5699 | This option is enabled by default. | |
5700 | <P> | |
5701 | ||
5702 | <DT><CODE>lithist</CODE> | |
5703 | <DD>If enabled, and the <CODE>cmdhist</CODE> | |
5704 | option is enabled, multi-line commands are saved to the history with | |
5705 | embedded newlines rather than using semicolon separators where possible. | |
5706 | <P> | |
5707 | ||
5708 | <DT><CODE>login_shell</CODE> | |
5709 | <DD>The shell sets this option if it is started as a login shell | |
5710 | (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>). | |
5711 | The value may not be changed. | |
5712 | <P> | |
5713 | ||
5714 | <DT><CODE>mailwarn</CODE> | |
5715 | <DD>If set, and a file that Bash is checking for mail has been | |
5716 | accessed since the last time it was checked, the message | |
5717 | <CODE>"The mail in <VAR>mailfile</VAR> has been read"</CODE> is displayed. | |
5718 | <P> | |
5719 | ||
5720 | <DT><CODE>no_empty_cmd_completion</CODE> | |
5721 | <DD>If set, and Readline is being used, Bash will not attempt to search | |
5722 | the <CODE>PATH</CODE> for possible completions when completion is attempted | |
5723 | on an empty line. | |
5724 | <P> | |
5725 | ||
5726 | <DT><CODE>nocaseglob</CODE> | |
5727 | <DD>If set, Bash matches filenames in a case-insensitive fashion when | |
5728 | performing filename expansion. | |
5729 | <P> | |
5730 | ||
5731 | <DT><CODE>nocasematch</CODE> | |
5732 | <DD>If set, Bash matches patterns in a case-insensitive fashion when | |
5733 | performing matching while executing <CODE>case</CODE> or <CODE>[[</CODE> | |
5734 | conditional commands. | |
5735 | <P> | |
5736 | ||
5737 | <DT><CODE>nullglob</CODE> | |
5738 | <DD>If set, Bash allows filename patterns which match no | |
5739 | files to expand to a null string, rather than themselves. | |
5740 | <P> | |
5741 | ||
5742 | <DT><CODE>progcomp</CODE> | |
5743 | <DD>If set, the programmable completion facilities | |
5744 | (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>) are enabled. | |
5745 | This option is enabled by default. | |
5746 | <P> | |
5747 | ||
5748 | <DT><CODE>promptvars</CODE> | |
5749 | <DD>If set, prompt strings undergo | |
5750 | parameter expansion, command substitution, arithmetic | |
5751 | expansion, and quote removal after being expanded | |
5752 | as described below (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>). | |
5753 | This option is enabled by default. | |
5754 | <P> | |
5755 | ||
5756 | <DT><CODE>restricted_shell</CODE> | |
5757 | <DD>The shell sets this option if it is started in restricted mode | |
5758 | (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>). | |
5759 | The value may not be changed. | |
5760 | This is not reset when the startup files are executed, allowing | |
5761 | the startup files to discover whether or not a shell is restricted. | |
5762 | <P> | |
5763 | ||
5764 | <DT><CODE>shift_verbose</CODE> | |
5765 | <DD>If this is set, the <CODE>shift</CODE> | |
5766 | builtin prints an error message when the shift count exceeds the | |
5767 | number of positional parameters. | |
5768 | <P> | |
5769 | ||
5770 | <DT><CODE>sourcepath</CODE> | |
5771 | <DD>If set, the <CODE>source</CODE> builtin uses the value of <CODE>PATH</CODE> | |
5772 | to find the directory containing the file supplied as an argument. | |
5773 | This option is enabled by default. | |
5774 | <P> | |
5775 | ||
5776 | <DT><CODE>xpg_echo</CODE> | |
5777 | <DD>If set, the <CODE>echo</CODE> builtin expands backslash-escape sequences | |
5778 | by default. | |
5779 | <P> | |
5780 | ||
5781 | </DL> | |
5782 | <P> | |
5783 | ||
5784 | The return status when listing options is zero if all <VAR>optnames</VAR> | |
5785 | are enabled, non-zero otherwise. | |
5786 | When setting or unsetting options, the return status is zero unless an | |
5787 | <VAR>optname</VAR> is not a valid shell option. | |
5788 | </P><P> | |
5789 | ||
5790 | </DL> | |
5791 | <P> | |
5792 | ||
5793 | <A NAME="Special Builtins"></A> | |
5794 | <HR SIZE="6"> | |
5795 | <A NAME="SEC64"></A> | |
5796 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
5797 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> < </A>]</TD> | |
5798 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> > </A>]</TD> | |
5799 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD> | |
5800 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD> | |
5801 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD> | |
5802 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5803 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5804 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5805 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5806 | </TR></TABLE> | |
5807 | <H2> 4.4 Special Builtins </H2> | |
5808 | <!--docid::SEC64::--> | |
5809 | <P> | |
5810 | ||
5811 | For historical reasons, the POSIX standard has classified | |
5812 | several builtin commands as <EM>special</EM>. | |
5813 | When Bash is executing in POSIX mode, the special builtins | |
5814 | differ from other builtin commands in three respects: | |
5815 | </P><P> | |
5816 | ||
5817 | <OL> | |
5818 | <LI> | |
5819 | Special builtins are found before shell functions during command lookup. | |
5820 | <P> | |
5821 | ||
5822 | <LI> | |
5823 | If a special builtin returns an error status, a non-interactive shell exits. | |
5824 | <P> | |
5825 | ||
5826 | <LI> | |
5827 | Assignment statements preceding the command stay in effect in the shell | |
5828 | environment after the command completes. | |
5829 | </OL> | |
5830 | <P> | |
5831 | ||
5832 | When Bash is not executing in POSIX mode, these builtins behave no | |
5833 | differently than the rest of the Bash builtin commands. | |
5834 | The Bash POSIX mode is described in <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>. | |
5835 | </P><P> | |
5836 | ||
5837 | These are the POSIX special builtins: | |
5838 | <TABLE><tr><td> </td><td class=example><pre>break : . continue eval exec exit export readonly return set | |
5839 | shift trap unset | |
5840 | </pre></td></tr></table></P><P> | |
5841 | ||
5842 | <A NAME="Shell Variables"></A> | |
5843 | <HR SIZE="6"> | |
5844 | <A NAME="SEC65"></A> | |
5845 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
5846 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> < </A>]</TD> | |
5847 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> > </A>]</TD> | |
5848 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> << </A>]</TD> | |
5849 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
5850 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> >> </A>]</TD> | |
5851 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5852 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5853 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5854 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5855 | </TR></TABLE> | |
5856 | <H1> 5. Shell Variables </H1> | |
5857 | <!--docid::SEC65::--> | |
5858 | <P> | |
5859 | ||
5860 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
5861 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables which Bash uses in the same way | |
5862 | as the Bourne Shell.</TD></TR> | |
5863 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">List of variables that exist in Bash.</TD></TR> | |
5864 | </TABLE></BLOCKQUOTE> | |
5865 | <P> | |
5866 | ||
5867 | This chapter describes the shell variables that Bash uses. | |
5868 | Bash automatically assigns default values to a number of variables. | |
5869 | </P><P> | |
5870 | ||
5871 | <A NAME="Bourne Shell Variables"></A> | |
5872 | <HR SIZE="6"> | |
5873 | <A NAME="SEC66"></A> | |
5874 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
5875 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> < </A>]</TD> | |
5876 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> > </A>]</TD> | |
5877 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD> | |
5878 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD> | |
5879 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> >> </A>]</TD> | |
5880 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5881 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5882 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5883 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5884 | </TR></TABLE> | |
5885 | <H2> 5.1 Bourne Shell Variables </H2> | |
5886 | <!--docid::SEC66::--> | |
5887 | <P> | |
5888 | ||
5889 | Bash uses certain shell variables in the same way as the Bourne shell. | |
5890 | In some cases, Bash assigns a default value to the variable. | |
5891 | </P><P> | |
5892 | ||
5893 | <DL COMPACT> | |
5894 | ||
5895 | <A NAME="IDX112"></A> | |
5896 | <DT><CODE>CDPATH</CODE> | |
5897 | <DD><A NAME="IDX113"></A> | |
5898 | A colon-separated list of directories used as a search path for | |
5899 | the <CODE>cd</CODE> builtin command. | |
5900 | <P> | |
5901 | ||
5902 | <A NAME="IDX114"></A> | |
5903 | <DT><CODE>HOME</CODE> | |
5904 | <DD><A NAME="IDX115"></A> | |
5905 | The current user's home directory; the default for the <CODE>cd</CODE> builtin | |
5906 | command. | |
5907 | The value of this variable is also used by tilde expansion | |
5908 | (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>). | |
5909 | <P> | |
5910 | ||
5911 | <A NAME="IDX116"></A> | |
5912 | <DT><CODE>IFS</CODE> | |
5913 | <DD><A NAME="IDX117"></A> | |
5914 | A list of characters that separate fields; used when the shell splits | |
5915 | words as part of expansion. | |
5916 | <P> | |
5917 | ||
5918 | <A NAME="IDX118"></A> | |
5919 | <DT><CODE>MAIL</CODE> | |
5920 | <DD><A NAME="IDX119"></A> | |
5921 | If this parameter is set to a filename and the <CODE>MAILPATH</CODE> variable | |
5922 | is not set, Bash informs the user of the arrival of mail in | |
5923 | the specified file. | |
5924 | <P> | |
5925 | ||
5926 | <A NAME="IDX120"></A> | |
5927 | <DT><CODE>MAILPATH</CODE> | |
5928 | <DD><A NAME="IDX121"></A> | |
5929 | A colon-separated list of filenames which the shell periodically checks | |
5930 | for new mail. | |
5931 | Each list entry can specify the message that is printed when new mail | |
5932 | arrives in the mail file by separating the file name from the message with | |
5933 | a <SAMP>`?'</SAMP>. | |
5934 | When used in the text of the message, <CODE>$_</CODE> expands to the name of | |
5935 | the current mail file. | |
5936 | <P> | |
5937 | ||
5938 | <A NAME="IDX122"></A> | |
5939 | <DT><CODE>OPTARG</CODE> | |
5940 | <DD><A NAME="IDX123"></A> | |
5941 | The value of the last option argument processed by the <CODE>getopts</CODE> builtin. | |
5942 | <P> | |
5943 | ||
5944 | <A NAME="IDX124"></A> | |
5945 | <DT><CODE>OPTIND</CODE> | |
5946 | <DD><A NAME="IDX125"></A> | |
5947 | The index of the last option argument processed by the <CODE>getopts</CODE> builtin. | |
5948 | <P> | |
5949 | ||
5950 | <A NAME="IDX126"></A> | |
5951 | <DT><CODE>PATH</CODE> | |
5952 | <DD><A NAME="IDX127"></A> | |
5953 | A colon-separated list of directories in which the shell looks for | |
5954 | commands. | |
5955 | A zero-length (null) directory name in the value of <CODE>PATH</CODE> indicates the | |
5956 | current directory. | |
5957 | A null directory name may appear as two adjacent colons, or as an initial | |
5958 | or trailing colon. | |
5959 | <P> | |
5960 | ||
5961 | <A NAME="IDX128"></A> | |
5962 | <DT><CODE>PS1</CODE> | |
5963 | <DD><A NAME="IDX129"></A> | |
5964 | The primary prompt string. The default value is <SAMP>`\s-\v\$ '</SAMP>. | |
5965 | See section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for the complete list of escape | |
5966 | sequences that are expanded before <CODE>PS1</CODE> is displayed. | |
5967 | <P> | |
5968 | ||
5969 | <A NAME="IDX130"></A> | |
5970 | <DT><CODE>PS2</CODE> | |
5971 | <DD><A NAME="IDX131"></A> | |
5972 | The secondary prompt string. The default value is <SAMP>`> '</SAMP>. | |
5973 | <P> | |
5974 | ||
5975 | </DL> | |
5976 | <P> | |
5977 | ||
5978 | <A NAME="Bash Variables"></A> | |
5979 | <HR SIZE="6"> | |
5980 | <A NAME="SEC67"></A> | |
5981 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
5982 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> < </A>]</TD> | |
5983 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> > </A>]</TD> | |
5984 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD> | |
5985 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD> | |
5986 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> >> </A>]</TD> | |
5987 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
5988 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
5989 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
5990 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
5991 | </TR></TABLE> | |
5992 | <H2> 5.2 Bash Variables </H2> | |
5993 | <!--docid::SEC67::--> | |
5994 | <P> | |
5995 | ||
5996 | These variables are set or used by Bash, but other shells | |
5997 | do not normally treat them specially. | |
5998 | </P><P> | |
5999 | ||
6000 | A few variables used by Bash are described in different chapters: | |
6001 | variables for controlling the job control facilities | |
6002 | (see section <A HREF="bashref.html#SEC94">7.3 Job Control Variables</A>). | |
6003 | </P><P> | |
6004 | ||
6005 | <DL COMPACT> | |
6006 | ||
6007 | <A NAME="IDX132"></A> | |
6008 | <DT><CODE>BASH</CODE> | |
6009 | <DD><A NAME="IDX133"></A> | |
6010 | The full pathname used to execute the current instance of Bash. | |
6011 | <P> | |
6012 | ||
6013 | <A NAME="IDX134"></A> | |
6014 | <DT><CODE>BASHPID</CODE> | |
6015 | <DD><A NAME="IDX135"></A> | |
6016 | Expands to the process id of the current Bash process. | |
6017 | This differs from <CODE>$$</CODE> under certain circumstances, such as subshells | |
6018 | that do not require Bash to be re-initialized. | |
6019 | <P> | |
6020 | ||
6021 | <A NAME="IDX136"></A> | |
6022 | <DT><CODE>BASH_ALIASES</CODE> | |
6023 | <DD><A NAME="IDX137"></A> | |
6024 | An associative array variable whose members correspond to the internal | |
6025 | list of aliases as maintained by the <CODE>alias</CODE> builtin | |
6026 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
6027 | Elements added to this array appear in the alias list; unsetting array | |
6028 | elements cause aliases to be removed from the alias list. | |
6029 | <P> | |
6030 | ||
6031 | <A NAME="IDX138"></A> | |
6032 | <DT><CODE>BASH_ARGC</CODE> | |
6033 | <DD><A NAME="IDX139"></A> | |
6034 | An array variable whose values are the number of parameters in each | |
6035 | frame of the current bash execution call stack. The number of | |
6036 | parameters to the current subroutine (shell function or script executed | |
6037 | with <CODE>.</CODE> or <CODE>source</CODE>) is at the top of the stack. When a | |
6038 | subroutine is executed, the number of parameters passed is pushed onto | |
6039 | <CODE>BASH_ARGC</CODE>. | |
6040 | The shell sets <CODE>BASH_ARGC</CODE> only when in extended debugging mode | |
6041 | (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A> | |
6042 | for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE> | |
6043 | builtin). | |
6044 | <P> | |
6045 | ||
6046 | <A NAME="IDX140"></A> | |
6047 | <DT><CODE>BASH_ARGV</CODE> | |
6048 | <DD><A NAME="IDX141"></A> | |
6049 | An array variable containing all of the parameters in the current bash | |
6050 | execution call stack. The final parameter of the last subroutine call | |
6051 | is at the top of the stack; the first parameter of the initial call is | |
6052 | at the bottom. When a subroutine is executed, the parameters supplied | |
6053 | are pushed onto <CODE>BASH_ARGV</CODE>. | |
6054 | The shell sets <CODE>BASH_ARGV</CODE> only when in extended debugging mode | |
6055 | (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A> | |
6056 | for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE> | |
6057 | builtin). | |
6058 | <P> | |
6059 | ||
6060 | <A NAME="IDX142"></A> | |
6061 | <DT><CODE>BASH_CMDS</CODE> | |
6062 | <DD><A NAME="IDX143"></A> | |
6063 | An associative array variable whose members correspond to the internal | |
6064 | hash table of commands as maintained by the <CODE>hash</CODE> builtin | |
6065 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
6066 | Elements added to this array appear in the hash table; unsetting array | |
6067 | elements cause commands to be removed from the hash table. | |
6068 | <P> | |
6069 | ||
6070 | <A NAME="IDX144"></A> | |
6071 | <DT><CODE>BASH_COMMAND</CODE> | |
6072 | <DD><A NAME="IDX145"></A> | |
6073 | The command currently being executed or about to be executed, unless the | |
6074 | shell is executing a command as the result of a trap, | |
6075 | in which case it is the command executing at the time of the trap. | |
6076 | <P> | |
6077 | ||
6078 | <A NAME="IDX146"></A> | |
6079 | <DT><CODE>BASH_ENV</CODE> | |
6080 | <DD><A NAME="IDX147"></A> | |
6081 | If this variable is set when Bash is invoked to execute a shell | |
6082 | script, its value is expanded and used as the name of a startup file | |
6083 | to read before executing the script. See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>. | |
6084 | <P> | |
6085 | ||
6086 | <A NAME="IDX148"></A> | |
6087 | <DT><CODE>BASH_EXECUTION_STRING</CODE> | |
6088 | <DD><A NAME="IDX149"></A> | |
6089 | The command argument to the <SAMP>`-c'</SAMP> invocation option. | |
6090 | <P> | |
6091 | ||
6092 | <A NAME="IDX150"></A> | |
6093 | <DT><CODE>BASH_LINENO</CODE> | |
6094 | <DD><A NAME="IDX151"></A> | |
6095 | An array variable whose members are the line numbers in source files | |
6096 | corresponding to each member of <VAR>FUNCNAME</VAR>. | |
6097 | <CODE>${BASH_LINENO[$i]}</CODE> is the line number in the source file where | |
6098 | <CODE>${FUNCNAME[$i]}</CODE> was called (or <CODE>${BASH_LINENO[$i-1]}</CODE> if | |
6099 | referenced within another shell function). | |
6100 | The corresponding source file name is <CODE>${BASH_SOURCE[$i]}</CODE>. | |
6101 | Use <CODE>LINENO</CODE> to obtain the current line number. | |
6102 | <P> | |
6103 | ||
6104 | <A NAME="IDX152"></A> | |
6105 | <DT><CODE>BASH_REMATCH</CODE> | |
6106 | <DD><A NAME="IDX153"></A> | |
6107 | An array variable whose members are assigned by the <SAMP>`=~'</SAMP> binary | |
6108 | operator to the <CODE>[[</CODE> conditional command | |
6109 | (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). | |
6110 | The element with index 0 is the portion of the string | |
6111 | matching the entire regular expression. | |
6112 | The element with index <VAR>n</VAR> is the portion of the | |
6113 | string matching the <VAR>n</VAR>th parenthesized subexpression. | |
6114 | This variable is read-only. | |
6115 | <P> | |
6116 | ||
6117 | <A NAME="IDX154"></A> | |
6118 | <DT><CODE>BASH_SOURCE</CODE> | |
6119 | <DD><A NAME="IDX155"></A> | |
6120 | An array variable whose members are the source filenames corresponding | |
6121 | to the elements in the <CODE>FUNCNAME</CODE> array variable. | |
6122 | <P> | |
6123 | ||
6124 | <A NAME="IDX156"></A> | |
6125 | <DT><CODE>BASH_SUBSHELL</CODE> | |
6126 | <DD><A NAME="IDX157"></A> | |
6127 | Incremented by one each time a subshell or subshell environment is spawned. | |
6128 | The initial value is 0. | |
6129 | <P> | |
6130 | ||
6131 | <A NAME="IDX158"></A> | |
6132 | <DT><CODE>BASH_VERSINFO</CODE> | |
6133 | <DD><A NAME="IDX159"></A> | |
6134 | A readonly array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>) | |
6135 | whose members hold version information for this instance of Bash. | |
6136 | The values assigned to the array members are as follows: | |
6137 | <P> | |
6138 | ||
6139 | <DL COMPACT> | |
6140 | ||
6141 | <DT><CODE>BASH_VERSINFO[0]</CODE> | |
6142 | <DD>The major version number (the <VAR>release</VAR>). | |
6143 | <P> | |
6144 | ||
6145 | <DT><CODE>BASH_VERSINFO[1]</CODE> | |
6146 | <DD>The minor version number (the <VAR>version</VAR>). | |
6147 | <P> | |
6148 | ||
6149 | <DT><CODE>BASH_VERSINFO[2]</CODE> | |
6150 | <DD>The patch level. | |
6151 | <P> | |
6152 | ||
6153 | <DT><CODE>BASH_VERSINFO[3]</CODE> | |
6154 | <DD>The build version. | |
6155 | <P> | |
6156 | ||
6157 | <DT><CODE>BASH_VERSINFO[4]</CODE> | |
6158 | <DD>The release status (e.g., <VAR>beta1</VAR>). | |
6159 | <P> | |
6160 | ||
6161 | <DT><CODE>BASH_VERSINFO[5]</CODE> | |
6162 | <DD>The value of <CODE>MACHTYPE</CODE>. | |
6163 | <P> | |
6164 | ||
6165 | </DL> | |
6166 | <P> | |
6167 | ||
6168 | <A NAME="IDX160"></A> | |
6169 | <DT><CODE>BASH_VERSION</CODE> | |
6170 | <DD><A NAME="IDX161"></A> | |
6171 | The version number of the current instance of Bash. | |
6172 | <P> | |
6173 | ||
6174 | <A NAME="IDX162"></A> | |
6175 | <DT><CODE>COLUMNS</CODE> | |
6176 | <DD><A NAME="IDX163"></A> | |
6177 | Used by the <CODE>select</CODE> builtin command to determine the terminal width | |
6178 | when printing selection lists. Automatically set upon receipt of a | |
6179 | <CODE>SIGWINCH</CODE>. | |
6180 | <P> | |
6181 | ||
6182 | <A NAME="IDX164"></A> | |
6183 | <DT><CODE>COMP_CWORD</CODE> | |
6184 | <DD><A NAME="IDX165"></A> | |
6185 | An index into <CODE>${COMP_WORDS}</CODE> of the word containing the current | |
6186 | cursor position. | |
6187 | This variable is available only in shell functions invoked by the | |
6188 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
6189 | <P> | |
6190 | ||
6191 | <A NAME="IDX166"></A> | |
6192 | <DT><CODE>COMP_LINE</CODE> | |
6193 | <DD><A NAME="IDX167"></A> | |
6194 | The current command line. | |
6195 | This variable is available only in shell functions and external | |
6196 | commands invoked by the | |
6197 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
6198 | <P> | |
6199 | ||
6200 | <A NAME="IDX168"></A> | |
6201 | <DT><CODE>COMP_POINT</CODE> | |
6202 | <DD><A NAME="IDX169"></A> | |
6203 | The index of the current cursor position relative to the beginning of | |
6204 | the current command. | |
6205 | If the current cursor position is at the end of the current command, | |
6206 | the value of this variable is equal to <CODE>${#COMP_LINE}</CODE>. | |
6207 | This variable is available only in shell functions and external | |
6208 | commands invoked by the | |
6209 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
6210 | <P> | |
6211 | ||
6212 | <A NAME="IDX170"></A> | |
6213 | <DT><CODE>COMP_TYPE</CODE> | |
6214 | <DD><A NAME="IDX171"></A> | |
6215 | Set to an integer value corresponding to the type of completion attempted | |
6216 | that caused a completion function to be called: | |
6217 | <VAR>TAB</VAR>, for normal completion, | |
6218 | <SAMP>`?'</SAMP>, for listing completions after successive tabs, | |
6219 | <SAMP>`!'</SAMP>, for listing alternatives on partial word completion, | |
6220 | <SAMP>`@'</SAMP>, to list completions if the word is not unmodified, | |
6221 | or | |
6222 | <SAMP>`%'</SAMP>, for menu completion. | |
6223 | This variable is available only in shell functions and external | |
6224 | commands invoked by the | |
6225 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
6226 | <P> | |
6227 | ||
6228 | <A NAME="IDX172"></A> | |
6229 | <DT><CODE>COMP_KEY</CODE> | |
6230 | <DD><A NAME="IDX173"></A> | |
6231 | The key (or final key of a key sequence) used to invoke the current | |
6232 | completion function. | |
6233 | <P> | |
6234 | ||
6235 | <A NAME="IDX174"></A> | |
6236 | <DT><CODE>COMP_WORDBREAKS</CODE> | |
6237 | <DD><A NAME="IDX175"></A> | |
6238 | The set of characters that the Readline library treats as word | |
6239 | separators when performing word completion. | |
6240 | If <CODE>COMP_WORDBREAKS</CODE> is unset, it loses its special properties, | |
6241 | even if it is subsequently reset. | |
6242 | <P> | |
6243 | ||
6244 | <A NAME="IDX176"></A> | |
6245 | <DT><CODE>COMP_WORDS</CODE> | |
6246 | <DD><A NAME="IDX177"></A> | |
6247 | An array variable consisting of the individual | |
6248 | words in the current command line. | |
6249 | The words are split on shell metacharacters as the shell parser would | |
6250 | separate them. | |
6251 | This variable is available only in shell functions invoked by the | |
6252 | programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
6253 | <P> | |
6254 | ||
6255 | <A NAME="IDX178"></A> | |
6256 | <DT><CODE>COMPREPLY</CODE> | |
6257 | <DD><A NAME="IDX179"></A> | |
6258 | An array variable from which Bash reads the possible completions | |
6259 | generated by a shell function invoked by the programmable completion | |
6260 | facility (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
6261 | <P> | |
6262 | ||
6263 | <A NAME="IDX180"></A> | |
6264 | <DT><CODE>DIRSTACK</CODE> | |
6265 | <DD><A NAME="IDX181"></A> | |
6266 | An array variable containing the current contents of the directory stack. | |
6267 | Directories appear in the stack in the order they are displayed by the | |
6268 | <CODE>dirs</CODE> builtin. | |
6269 | Assigning to members of this array variable may be used to modify | |
6270 | directories already in the stack, but the <CODE>pushd</CODE> and <CODE>popd</CODE> | |
6271 | builtins must be used to add and remove directories. | |
6272 | Assignment to this variable will not change the current directory. | |
6273 | If <CODE>DIRSTACK</CODE> is unset, it loses its special properties, even if | |
6274 | it is subsequently reset. | |
6275 | <P> | |
6276 | ||
6277 | <A NAME="IDX182"></A> | |
6278 | <DT><CODE>EMACS</CODE> | |
6279 | <DD><A NAME="IDX183"></A> | |
6280 | If Bash finds this variable in the environment when the shell | |
6281 | starts with value <SAMP>`t'</SAMP>, it assumes that the shell is running in an | |
6282 | emacs shell buffer and disables line editing. | |
6283 | <P> | |
6284 | ||
6285 | <A NAME="IDX184"></A> | |
6286 | <DT><CODE>EUID</CODE> | |
6287 | <DD><A NAME="IDX185"></A> | |
6288 | The numeric effective user id of the current user. This variable | |
6289 | is readonly. | |
6290 | <P> | |
6291 | ||
6292 | <A NAME="IDX186"></A> | |
6293 | <DT><CODE>FCEDIT</CODE> | |
6294 | <DD><A NAME="IDX187"></A> | |
6295 | The editor used as a default by the <SAMP>`-e'</SAMP> option to the <CODE>fc</CODE> | |
6296 | builtin command. | |
6297 | <P> | |
6298 | ||
6299 | <A NAME="IDX188"></A> | |
6300 | <DT><CODE>FIGNORE</CODE> | |
6301 | <DD><A NAME="IDX189"></A> | |
6302 | A colon-separated list of suffixes to ignore when performing | |
6303 | filename completion. | |
6304 | A file name whose suffix matches one of the entries in | |
6305 | <CODE>FIGNORE</CODE> | |
6306 | is excluded from the list of matched file names. A sample | |
6307 | value is <SAMP>`.o:~'</SAMP> | |
6308 | <P> | |
6309 | ||
6310 | <A NAME="IDX190"></A> | |
6311 | <DT><CODE>FUNCNAME</CODE> | |
6312 | <DD><A NAME="IDX191"></A> | |
6313 | An array variable containing the names of all shell functions | |
6314 | currently in the execution call stack. | |
6315 | The element with index 0 is the name of any currently-executing | |
6316 | shell function. | |
6317 | The bottom-most element is <CODE>"main"</CODE>. | |
6318 | This variable exists only when a shell function is executing. | |
6319 | Assignments to <CODE>FUNCNAME</CODE> have no effect and return an error status. | |
6320 | If <CODE>FUNCNAME</CODE> is unset, it loses its special properties, even if | |
6321 | it is subsequently reset. | |
6322 | <P> | |
6323 | ||
6324 | <A NAME="IDX192"></A> | |
6325 | <DT><CODE>GLOBIGNORE</CODE> | |
6326 | <DD><A NAME="IDX193"></A> | |
6327 | A colon-separated list of patterns defining the set of filenames to | |
6328 | be ignored by filename expansion. | |
6329 | If a filename matched by a filename expansion pattern also matches one | |
6330 | of the patterns in <CODE>GLOBIGNORE</CODE>, it is removed from the list | |
6331 | of matches. | |
6332 | <P> | |
6333 | ||
6334 | <A NAME="IDX194"></A> | |
6335 | <DT><CODE>GROUPS</CODE> | |
6336 | <DD><A NAME="IDX195"></A> | |
6337 | An array variable containing the list of groups of which the current | |
6338 | user is a member. | |
6339 | Assignments to <CODE>GROUPS</CODE> have no effect and return an error status. | |
6340 | If <CODE>GROUPS</CODE> is unset, it loses its special properties, even if it is | |
6341 | subsequently reset. | |
6342 | <P> | |
6343 | ||
6344 | <A NAME="IDX196"></A> | |
6345 | <DT><CODE>histchars</CODE> | |
6346 | <DD><A NAME="IDX197"></A> | |
6347 | Up to three characters which control history expansion, quick | |
6348 | substitution, and tokenization (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>). | |
6349 | The first character is the | |
6350 | <VAR>history expansion</VAR> character, that is, the character which signifies the | |
6351 | start of a history expansion, normally <SAMP>`!'</SAMP>. The second character is the | |
6352 | character which signifies `quick substitution' when seen as the first | |
6353 | character on a line, normally <SAMP>`^'</SAMP>. The optional third character is the | |
6354 | character which indicates that the remainder of the line is a comment when | |
6355 | found as the first character of a word, usually <SAMP>`#'</SAMP>. The history | |
6356 | comment character causes history substitution to be skipped for the | |
6357 | remaining words on the line. It does not necessarily cause the shell | |
6358 | parser to treat the rest of the line as a comment. | |
6359 | <P> | |
6360 | ||
6361 | <A NAME="IDX198"></A> | |
6362 | <DT><CODE>HISTCMD</CODE> | |
6363 | <DD><A NAME="IDX199"></A> | |
6364 | The history number, or index in the history list, of the current | |
6365 | command. If <CODE>HISTCMD</CODE> is unset, it loses its special properties, | |
6366 | even if it is subsequently reset. | |
6367 | <P> | |
6368 | ||
6369 | <A NAME="IDX200"></A> | |
6370 | <DT><CODE>HISTCONTROL</CODE> | |
6371 | <DD><A NAME="IDX201"></A> | |
6372 | A colon-separated list of values controlling how commands are saved on | |
6373 | the history list. | |
6374 | If the list of values includes <SAMP>`ignorespace'</SAMP>, lines which begin | |
6375 | with a space character are not saved in the history list. | |
6376 | A value of <SAMP>`ignoredups'</SAMP> causes lines which match the previous | |
6377 | history entry to not be saved. | |
6378 | A value of <SAMP>`ignoreboth'</SAMP> is shorthand for | |
6379 | <SAMP>`ignorespace'</SAMP> and <SAMP>`ignoredups'</SAMP>. | |
6380 | A value of <SAMP>`erasedups'</SAMP> causes all previous lines matching the | |
6381 | current line to be removed from the history list before that line | |
6382 | is saved. | |
6383 | Any value not in the above list is ignored. | |
6384 | If <CODE>HISTCONTROL</CODE> is unset, or does not include a valid value, | |
6385 | all lines read by the shell parser are saved on the history list, | |
6386 | subject to the value of <CODE>HISTIGNORE</CODE>. | |
6387 | The second and subsequent lines of a multi-line compound command are | |
6388 | not tested, and are added to the history regardless of the value of | |
6389 | <CODE>HISTCONTROL</CODE>. | |
6390 | <P> | |
6391 | ||
6392 | <A NAME="IDX202"></A> | |
6393 | <DT><CODE>HISTFILE</CODE> | |
6394 | <DD><A NAME="IDX203"></A> | |
6395 | The name of the file to which the command history is saved. The | |
6396 | default value is <TT>`~/.bash_history'</TT>. | |
6397 | <P> | |
6398 | ||
6399 | <A NAME="IDX204"></A> | |
6400 | <DT><CODE>HISTFILESIZE</CODE> | |
6401 | <DD><A NAME="IDX205"></A> | |
6402 | The maximum number of lines contained in the history file. When this | |
6403 | variable is assigned a value, the history file is truncated, if | |
6404 | necessary, by removing the oldest entries, | |
6405 | to contain no more than that number of lines. | |
6406 | The history file is also truncated to this size after | |
6407 | writing it when an interactive shell exits. | |
6408 | The default value is 500. | |
6409 | <P> | |
6410 | ||
6411 | <A NAME="IDX206"></A> | |
6412 | <DT><CODE>HISTIGNORE</CODE> | |
6413 | <DD><A NAME="IDX207"></A> | |
6414 | A colon-separated list of patterns used to decide which command | |
6415 | lines should be saved on the history list. Each pattern is | |
6416 | anchored at the beginning of the line and must match the complete | |
6417 | line (no implicit <SAMP>`*'</SAMP> is appended). Each pattern is tested | |
6418 | against the line after the checks specified by <CODE>HISTCONTROL</CODE> | |
6419 | are applied. In addition to the normal shell pattern matching | |
6420 | characters, <SAMP>`&'</SAMP> matches the previous history line. <SAMP>`&'</SAMP> | |
6421 | may be escaped using a backslash; the backslash is removed | |
6422 | before attempting a match. | |
6423 | The second and subsequent lines of a multi-line compound command are | |
6424 | not tested, and are added to the history regardless of the value of | |
6425 | <CODE>HISTIGNORE</CODE>. | |
6426 | <P> | |
6427 | ||
6428 | <CODE>HISTIGNORE</CODE> subsumes the function of <CODE>HISTCONTROL</CODE>. A | |
6429 | pattern of <SAMP>`&'</SAMP> is identical to <CODE>ignoredups</CODE>, and a | |
6430 | pattern of <SAMP>`[ ]*'</SAMP> is identical to <CODE>ignorespace</CODE>. | |
6431 | Combining these two patterns, separating them with a colon, | |
6432 | provides the functionality of <CODE>ignoreboth</CODE>. | |
6433 | </P><P> | |
6434 | ||
6435 | <A NAME="IDX208"></A> | |
6436 | <DT><CODE>HISTSIZE</CODE> | |
6437 | <DD><A NAME="IDX209"></A> | |
6438 | The maximum number of commands to remember on the history list. | |
6439 | The default value is 500. | |
6440 | <P> | |
6441 | ||
6442 | <A NAME="IDX210"></A> | |
6443 | <DT><CODE>HISTTIMEFORMAT</CODE> | |
6444 | <DD><A NAME="IDX211"></A> | |
6445 | If this variable is set and not null, its value is used as a format string | |
6446 | for <VAR>strftime</VAR> to print the time stamp associated with each history | |
6447 | entry displayed by the <CODE>history</CODE> builtin. | |
6448 | If this variable is set, time stamps are written to the history file so | |
6449 | they may be preserved across shell sessions. | |
6450 | This uses the history comment character to distinguish timestamps from | |
6451 | other history lines. | |
6452 | <P> | |
6453 | ||
6454 | <A NAME="IDX212"></A> | |
6455 | <DT><CODE>HOSTFILE</CODE> | |
6456 | <DD><A NAME="IDX213"></A> | |
6457 | Contains the name of a file in the same format as <TT>`/etc/hosts'</TT> that | |
6458 | should be read when the shell needs to complete a hostname. | |
6459 | The list of possible hostname completions may be changed while the shell | |
6460 | is running; | |
6461 | the next time hostname completion is attempted after the | |
6462 | value is changed, Bash adds the contents of the new file to the | |
6463 | existing list. | |
6464 | If <CODE>HOSTFILE</CODE> is set, but has no value, Bash attempts to read | |
6465 | <TT>`/etc/hosts'</TT> to obtain the list of possible hostname completions. | |
6466 | When <CODE>HOSTFILE</CODE> is unset, the hostname list is cleared. | |
6467 | <P> | |
6468 | ||
6469 | <A NAME="IDX214"></A> | |
6470 | <DT><CODE>HOSTNAME</CODE> | |
6471 | <DD><A NAME="IDX215"></A> | |
6472 | The name of the current host. | |
6473 | <P> | |
6474 | ||
6475 | <A NAME="IDX216"></A> | |
6476 | <DT><CODE>HOSTTYPE</CODE> | |
6477 | <DD><A NAME="IDX217"></A> | |
6478 | A string describing the machine Bash is running on. | |
6479 | <P> | |
6480 | ||
6481 | <A NAME="IDX218"></A> | |
6482 | <DT><CODE>IGNOREEOF</CODE> | |
6483 | <DD><A NAME="IDX219"></A> | |
6484 | Controls the action of the shell on receipt of an <CODE>EOF</CODE> character | |
6485 | as the sole input. If set, the value denotes the number | |
6486 | of consecutive <CODE>EOF</CODE> characters that can be read as the | |
6487 | first character on an input line | |
6488 | before the shell will exit. If the variable exists but does not | |
6489 | have a numeric value (or has no value) then the default is 10. | |
6490 | If the variable does not exist, then <CODE>EOF</CODE> signifies the end of | |
6491 | input to the shell. This is only in effect for interactive shells. | |
6492 | <P> | |
6493 | ||
6494 | <A NAME="IDX220"></A> | |
6495 | <DT><CODE>INPUTRC</CODE> | |
6496 | <DD><A NAME="IDX221"></A> | |
6497 | The name of the Readline initialization file, overriding the default | |
6498 | of <TT>`~/.inputrc'</TT>. | |
6499 | <P> | |
6500 | ||
6501 | <A NAME="IDX222"></A> | |
6502 | <DT><CODE>LANG</CODE> | |
6503 | <DD><A NAME="IDX223"></A> | |
6504 | Used to determine the locale category for any category not specifically | |
6505 | selected with a variable starting with <CODE>LC_</CODE>. | |
6506 | <P> | |
6507 | ||
6508 | <A NAME="IDX224"></A> | |
6509 | <DT><CODE>LC_ALL</CODE> | |
6510 | <DD><A NAME="IDX225"></A> | |
6511 | This variable overrides the value of <CODE>LANG</CODE> and any other | |
6512 | <CODE>LC_</CODE> variable specifying a locale category. | |
6513 | <P> | |
6514 | ||
6515 | <A NAME="IDX226"></A> | |
6516 | <DT><CODE>LC_COLLATE</CODE> | |
6517 | <DD><A NAME="IDX227"></A> | |
6518 | This variable determines the collation order used when sorting the | |
6519 | results of filename expansion, and | |
6520 | determines the behavior of range expressions, equivalence classes, | |
6521 | and collating sequences within filename expansion and pattern matching | |
6522 | (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). | |
6523 | <P> | |
6524 | ||
6525 | <A NAME="IDX228"></A> | |
6526 | <DT><CODE>LC_CTYPE</CODE> | |
6527 | <DD><A NAME="IDX229"></A> | |
6528 | This variable determines the interpretation of characters and the | |
6529 | behavior of character classes within filename expansion and pattern | |
6530 | matching (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). | |
6531 | <P> | |
6532 | ||
6533 | <A NAME="IDX230"></A> | |
6534 | <DT><CODE>LC_MESSAGES</CODE> | |
6535 | <DD><A NAME="IDX231"></A> | |
6536 | This variable determines the locale used to translate double-quoted | |
6537 | strings preceded by a <SAMP>`$'</SAMP> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>). | |
6538 | <P> | |
6539 | ||
6540 | <A NAME="IDX232"></A> | |
6541 | <DT><CODE>LC_NUMERIC</CODE> | |
6542 | <DD><A NAME="IDX233"></A> | |
6543 | This variable determines the locale category used for number formatting. | |
6544 | <P> | |
6545 | ||
6546 | <A NAME="IDX234"></A> | |
6547 | <DT><CODE>LINENO</CODE> | |
6548 | <DD><A NAME="IDX235"></A> | |
6549 | The line number in the script or shell function currently executing. | |
6550 | <P> | |
6551 | ||
6552 | <A NAME="IDX236"></A> | |
6553 | <DT><CODE>LINES</CODE> | |
6554 | <DD><A NAME="IDX237"></A> | |
6555 | Used by the <CODE>select</CODE> builtin command to determine the column length | |
6556 | for printing selection lists. Automatically set upon receipt of a | |
6557 | <CODE>SIGWINCH</CODE>. | |
6558 | <P> | |
6559 | ||
6560 | <A NAME="IDX238"></A> | |
6561 | <DT><CODE>MACHTYPE</CODE> | |
6562 | <DD><A NAME="IDX239"></A> | |
6563 | A string that fully describes the system type on which Bash | |
6564 | is executing, in the standard GNU <VAR>cpu-company-system</VAR> format. | |
6565 | <P> | |
6566 | ||
6567 | <A NAME="IDX240"></A> | |
6568 | <DT><CODE>MAILCHECK</CODE> | |
6569 | <DD><A NAME="IDX241"></A> | |
6570 | How often (in seconds) that the shell should check for mail in the | |
6571 | files specified in the <CODE>MAILPATH</CODE> or <CODE>MAIL</CODE> variables. | |
6572 | The default is 60 seconds. When it is time to check | |
6573 | for mail, the shell does so before displaying the primary prompt. | |
6574 | If this variable is unset, or set to a value that is not a number | |
6575 | greater than or equal to zero, the shell disables mail checking. | |
6576 | <P> | |
6577 | ||
6578 | <A NAME="IDX242"></A> | |
6579 | <DT><CODE>OLDPWD</CODE> | |
6580 | <DD><A NAME="IDX243"></A> | |
6581 | The previous working directory as set by the <CODE>cd</CODE> builtin. | |
6582 | <P> | |
6583 | ||
6584 | <A NAME="IDX244"></A> | |
6585 | <DT><CODE>OPTERR</CODE> | |
6586 | <DD><A NAME="IDX245"></A> | |
6587 | If set to the value 1, Bash displays error messages | |
6588 | generated by the <CODE>getopts</CODE> builtin command. | |
6589 | <P> | |
6590 | ||
6591 | <A NAME="IDX246"></A> | |
6592 | <DT><CODE>OSTYPE</CODE> | |
6593 | <DD><A NAME="IDX247"></A> | |
6594 | A string describing the operating system Bash is running on. | |
6595 | <P> | |
6596 | ||
6597 | <A NAME="IDX248"></A> | |
6598 | <DT><CODE>PIPESTATUS</CODE> | |
6599 | <DD><A NAME="IDX249"></A> | |
6600 | An array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>) | |
6601 | containing a list of exit status values from the processes | |
6602 | in the most-recently-executed foreground pipeline (which may | |
6603 | contain only a single command). | |
6604 | <P> | |
6605 | ||
6606 | <A NAME="IDX250"></A> | |
6607 | <DT><CODE>POSIXLY_CORRECT</CODE> | |
6608 | <DD><A NAME="IDX251"></A> | |
6609 | If this variable is in the environment when <CODE>bash</CODE> starts, the shell | |
6610 | enters POSIX mode (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>) before reading the | |
6611 | startup files, as if the <SAMP>`--posix'</SAMP> invocation option had been supplied. | |
6612 | If it is set while the shell is running, <CODE>bash</CODE> enables POSIX mode, | |
6613 | as if the command | |
6614 | <TABLE><tr><td> </td><td class=example><pre><CODE>set -o posix</CODE> | |
6615 | </pre></td></tr></table>had been executed. | |
6616 | <P> | |
6617 | ||
6618 | <A NAME="IDX252"></A> | |
6619 | <DT><CODE>PPID</CODE> | |
6620 | <DD><A NAME="IDX253"></A> | |
6621 | The process ID of the shell's parent process. This variable | |
6622 | is readonly. | |
6623 | <P> | |
6624 | ||
6625 | <A NAME="IDX254"></A> | |
6626 | <DT><CODE>PROMPT_COMMAND</CODE> | |
6627 | <DD><A NAME="IDX255"></A> | |
6628 | If set, the value is interpreted as a command to execute | |
6629 | before the printing of each primary prompt (<CODE>$PS1</CODE>). | |
6630 | <P> | |
6631 | ||
6632 | <A NAME="IDX256"></A> | |
6633 | <DT><CODE>PROMPT_DIRTRIM</CODE> | |
6634 | <DD><A NAME="IDX257"></A> | |
6635 | If set to a number greater than zero, the value is used as the number of | |
6636 | trailing directory components to retain when expanding the <CODE>\w</CODE> and | |
6637 | <CODE>\W</CODE> prompt string escapes (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>). | |
6638 | Characters removed are replaced with an ellipsis. | |
6639 | <P> | |
6640 | ||
6641 | <A NAME="IDX258"></A> | |
6642 | <DT><CODE>PS3</CODE> | |
6643 | <DD><A NAME="IDX259"></A> | |
6644 | The value of this variable is used as the prompt for the | |
6645 | <CODE>select</CODE> command. If this variable is not set, the | |
6646 | <CODE>select</CODE> command prompts with <SAMP>`#? '</SAMP> | |
6647 | <P> | |
6648 | ||
6649 | <A NAME="IDX260"></A> | |
6650 | <DT><CODE>PS4</CODE> | |
6651 | <DD><A NAME="IDX261"></A> | |
6652 | The value is the prompt printed before the command line is echoed | |
6653 | when the <SAMP>`-x'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
6654 | The first character of <CODE>PS4</CODE> is replicated multiple times, as | |
6655 | necessary, to indicate multiple levels of indirection. | |
6656 | The default is <SAMP>`+ '</SAMP>. | |
6657 | <P> | |
6658 | ||
6659 | <A NAME="IDX262"></A> | |
6660 | <DT><CODE>PWD</CODE> | |
6661 | <DD><A NAME="IDX263"></A> | |
6662 | The current working directory as set by the <CODE>cd</CODE> builtin. | |
6663 | <P> | |
6664 | ||
6665 | <A NAME="IDX264"></A> | |
6666 | <DT><CODE>RANDOM</CODE> | |
6667 | <DD><A NAME="IDX265"></A> | |
6668 | Each time this parameter is referenced, a random integer | |
6669 | between 0 and 32767 is generated. Assigning a value to this | |
6670 | variable seeds the random number generator. | |
6671 | <P> | |
6672 | ||
6673 | <A NAME="IDX266"></A> | |
6674 | <DT><CODE>REPLY</CODE> | |
6675 | <DD><A NAME="IDX267"></A> | |
6676 | The default variable for the <CODE>read</CODE> builtin. | |
6677 | <P> | |
6678 | ||
6679 | <A NAME="IDX268"></A> | |
6680 | <DT><CODE>SECONDS</CODE> | |
6681 | <DD><A NAME="IDX269"></A> | |
6682 | This variable expands to the number of seconds since the | |
6683 | shell was started. Assignment to this variable resets | |
6684 | the count to the value assigned, and the expanded value | |
6685 | becomes the value assigned plus the number of seconds | |
6686 | since the assignment. | |
6687 | <P> | |
6688 | ||
6689 | <A NAME="IDX270"></A> | |
6690 | <DT><CODE>SHELL</CODE> | |
6691 | <DD><A NAME="IDX271"></A> | |
6692 | The full pathname to the shell is kept in this environment variable. | |
6693 | If it is not set when the shell starts, | |
6694 | Bash assigns to it the full pathname of the current user's login shell. | |
6695 | <P> | |
6696 | ||
6697 | <A NAME="IDX272"></A> | |
6698 | <DT><CODE>SHELLOPTS</CODE> | |
6699 | <DD><A NAME="IDX273"></A> | |
6700 | A colon-separated list of enabled shell options. Each word in | |
6701 | the list is a valid argument for the <SAMP>`-o'</SAMP> option to the | |
6702 | <CODE>set</CODE> builtin command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
6703 | The options appearing in <CODE>SHELLOPTS</CODE> are those reported | |
6704 | as <SAMP>`on'</SAMP> by <SAMP>`set -o'</SAMP>. | |
6705 | If this variable is in the environment when Bash | |
6706 | starts up, each shell option in the list will be enabled before | |
6707 | reading any startup files. This variable is readonly. | |
6708 | <P> | |
6709 | ||
6710 | <A NAME="IDX274"></A> | |
6711 | <DT><CODE>SHLVL</CODE> | |
6712 | <DD><A NAME="IDX275"></A> | |
6713 | Incremented by one each time a new instance of Bash is started. This is | |
6714 | intended to be a count of how deeply your Bash shells are nested. | |
6715 | <P> | |
6716 | ||
6717 | <A NAME="IDX276"></A> | |
6718 | <DT><CODE>TIMEFORMAT</CODE> | |
6719 | <DD><A NAME="IDX277"></A> | |
6720 | The value of this parameter is used as a format string specifying | |
6721 | how the timing information for pipelines prefixed with the <CODE>time</CODE> | |
6722 | reserved word should be displayed. | |
6723 | The <SAMP>`%'</SAMP> character introduces an | |
6724 | escape sequence that is expanded to a time value or other | |
6725 | information. | |
6726 | The escape sequences and their meanings are as | |
6727 | follows; the braces denote optional portions. | |
6728 | <P> | |
6729 | ||
6730 | <DL COMPACT> | |
6731 | ||
6732 | <DT><CODE>%%</CODE> | |
6733 | <DD>A literal <SAMP>`%'</SAMP>. | |
6734 | <P> | |
6735 | ||
6736 | <DT><CODE>%[<VAR>p</VAR>][l]R</CODE> | |
6737 | <DD>The elapsed time in seconds. | |
6738 | <P> | |
6739 | ||
6740 | <DT><CODE>%[<VAR>p</VAR>][l]U</CODE> | |
6741 | <DD>The number of CPU seconds spent in user mode. | |
6742 | <P> | |
6743 | ||
6744 | <DT><CODE>%[<VAR>p</VAR>][l]S</CODE> | |
6745 | <DD>The number of CPU seconds spent in system mode. | |
6746 | <P> | |
6747 | ||
6748 | <DT><CODE>%P</CODE> | |
6749 | <DD>The CPU percentage, computed as (%U + %S) / %R. | |
6750 | </DL> | |
6751 | <P> | |
6752 | ||
6753 | The optional <VAR>p</VAR> is a digit specifying the precision, the number of | |
6754 | fractional digits after a decimal point. | |
6755 | A value of 0 causes no decimal point or fraction to be output. | |
6756 | At most three places after the decimal point may be specified; values | |
6757 | of <VAR>p</VAR> greater than 3 are changed to 3. | |
6758 | If <VAR>p</VAR> is not specified, the value 3 is used. | |
6759 | </P><P> | |
6760 | ||
6761 | The optional <CODE>l</CODE> specifies a longer format, including minutes, of | |
6762 | the form <VAR>MM</VAR>m<VAR>SS</VAR>.<VAR>FF</VAR>s. | |
6763 | The value of <VAR>p</VAR> determines whether or not the fraction is included. | |
6764 | </P><P> | |
6765 | ||
6766 | If this variable is not set, Bash acts as if it had the value | |
6767 | <TABLE><tr><td> </td><td class=example><pre><CODE>$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'</CODE> | |
6768 | </pre></td></tr></table>If the value is null, no timing information is displayed. | |
6769 | A trailing newline is added when the format string is displayed. | |
6770 | </P><P> | |
6771 | ||
6772 | <A NAME="IDX278"></A> | |
6773 | <DT><CODE>TMOUT</CODE> | |
6774 | <DD><A NAME="IDX279"></A> | |
6775 | If set to a value greater than zero, <CODE>TMOUT</CODE> is treated as the | |
6776 | default timeout for the <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
6777 | The <CODE>select</CODE> command (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) terminates | |
6778 | if input does not arrive after <CODE>TMOUT</CODE> seconds when input is coming | |
6779 | from a terminal. | |
6780 | <P> | |
6781 | ||
6782 | In an interactive shell, the value is interpreted as | |
6783 | the number of seconds to wait for input after issuing the primary | |
6784 | prompt when the shell is interactive. | |
6785 | Bash terminates after that number of seconds if input does | |
6786 | not arrive. | |
6787 | </P><P> | |
6788 | ||
6789 | <A NAME="IDX280"></A> | |
6790 | <DT><CODE>TMPDIR</CODE> | |
6791 | <DD><A NAME="IDX281"></A> | |
6792 | If set, Bash uses its value as the name of a directory in which | |
6793 | Bash creates temporary files for the shell's use. | |
6794 | <P> | |
6795 | ||
6796 | <A NAME="IDX282"></A> | |
6797 | <DT><CODE>UID</CODE> | |
6798 | <DD><A NAME="IDX283"></A> | |
6799 | The numeric real user id of the current user. This variable is readonly. | |
6800 | <P> | |
6801 | ||
6802 | </DL> | |
6803 | <P> | |
6804 | ||
6805 | <A NAME="Bash Features"></A> | |
6806 | <HR SIZE="6"> | |
6807 | <A NAME="SEC68"></A> | |
6808 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
6809 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> < </A>]</TD> | |
6810 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> > </A>]</TD> | |
6811 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD> | |
6812 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
6813 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
6814 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
6815 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
6816 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
6817 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
6818 | </TR></TABLE> | |
6819 | <H1> 6. Bash Features </H1> | |
6820 | <!--docid::SEC68::--> | |
6821 | <P> | |
6822 | ||
6823 | This section describes features unique to Bash. | |
6824 | </P><P> | |
6825 | ||
6826 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
6827 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Command line options that you can give | |
6828 | to Bash.</TD></TR> | |
6829 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">When and how Bash executes scripts.</TD></TR> | |
6830 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What an interactive shell is.</TD></TR> | |
6831 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Primitives used in composing expressions for | |
6832 | the <CODE>test</CODE> builtin.</TD></TR> | |
6833 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Arithmetic on shell variables.</TD></TR> | |
6834 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC84">6.6 Aliases</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Substituting one command for another.</TD></TR> | |
6835 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC85">6.7 Arrays</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Array Variables.</TD></TR> | |
6836 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC86">6.8 The Directory Stack</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">History of visited directories.</TD></TR> | |
6837 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling the PS1 string.</TD></TR> | |
6838 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A more controlled mode of shell execution.</TD></TR> | |
6839 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Making Bash behave more closely to what | |
6840 | the POSIX standard specifies.</TD></TR> | |
6841 | </TABLE></BLOCKQUOTE> | |
6842 | <P> | |
6843 | ||
6844 | <A NAME="Invoking Bash"></A> | |
6845 | <HR SIZE="6"> | |
6846 | <A NAME="SEC69"></A> | |
6847 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
6848 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> < </A>]</TD> | |
6849 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> > </A>]</TD> | |
6850 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> << </A>]</TD> | |
6851 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
6852 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
6853 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
6854 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
6855 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
6856 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
6857 | </TR></TABLE> | |
6858 | <H2> 6.1 Invoking Bash </H2> | |
6859 | <!--docid::SEC69::--> | |
6860 | <P> | |
6861 | ||
6862 | <TABLE><tr><td> </td><td class=example><pre>bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>] | |
6863 | bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] -c <VAR>string</VAR> [<VAR>argument</VAR> <small>...</small>] | |
6864 | bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>] | |
6865 | </pre></td></tr></table></P><P> | |
6866 | ||
6867 | In addition to the single-character shell command-line options | |
6868 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), there are several multi-character | |
6869 | options that you can use. These options must appear on the command | |
6870 | line before the single-character options to be recognized. | |
6871 | </P><P> | |
6872 | ||
6873 | <DL COMPACT> | |
6874 | <DT><CODE>--debugger</CODE> | |
6875 | <DD>Arrange for the debugger profile to be executed before the shell | |
6876 | starts. Turns on extended debugging mode (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A> | |
6877 | for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE> | |
6878 | builtin) and shell function tracing | |
6879 | (see <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A> for a description of the <CODE>-o functrace</CODE> | |
6880 | option). | |
6881 | <P> | |
6882 | ||
6883 | <DT><CODE>--dump-po-strings</CODE> | |
6884 | <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP> | |
6885 | is printed on the standard output | |
6886 | in the GNU <CODE>gettext</CODE> PO (portable object) file format. | |
6887 | Equivalent to <SAMP>`-D'</SAMP> except for the output format. | |
6888 | <P> | |
6889 | ||
6890 | <DT><CODE>--dump-strings</CODE> | |
6891 | <DD>Equivalent to <SAMP>`-D'</SAMP>. | |
6892 | <P> | |
6893 | ||
6894 | <DT><CODE>--help</CODE> | |
6895 | <DD>Display a usage message on standard output and exit successfully. | |
6896 | <P> | |
6897 | ||
6898 | <DT><CODE>--init-file <VAR>filename</VAR></CODE> | |
6899 | <DD><DT><CODE>--rcfile <VAR>filename</VAR></CODE> | |
6900 | <DD>Execute commands from <VAR>filename</VAR> (instead of <TT>`~/.bashrc'</TT>) | |
6901 | in an interactive shell. | |
6902 | <P> | |
6903 | ||
6904 | <DT><CODE>--login</CODE> | |
6905 | <DD>Equivalent to <SAMP>`-l'</SAMP>. | |
6906 | <P> | |
6907 | ||
6908 | <DT><CODE>--noediting</CODE> | |
6909 | <DD>Do not use the GNU Readline library (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) | |
6910 | to read command lines when the shell is interactive. | |
6911 | <P> | |
6912 | ||
6913 | <DT><CODE>--noprofile</CODE> | |
6914 | <DD>Don't load the system-wide startup file <TT>`/etc/profile'</TT> | |
6915 | or any of the personal initialization files | |
6916 | <TT>`~/.bash_profile'</TT>, <TT>`~/.bash_login'</TT>, or <TT>`~/.profile'</TT> | |
6917 | when Bash is invoked as a login shell. | |
6918 | <P> | |
6919 | ||
6920 | <DT><CODE>--norc</CODE> | |
6921 | <DD>Don't read the <TT>`~/.bashrc'</TT> initialization file in an | |
6922 | interactive shell. This is on by default if the shell is | |
6923 | invoked as <CODE>sh</CODE>. | |
6924 | <P> | |
6925 | ||
6926 | <DT><CODE>--posix</CODE> | |
6927 | <DD>Change the behavior of Bash where the default operation differs | |
6928 | from the POSIX standard to match the standard. This | |
6929 | is intended to make Bash behave as a strict superset of that | |
6930 | standard. See section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>, for a description of the Bash | |
6931 | POSIX mode. | |
6932 | <P> | |
6933 | ||
6934 | <DT><CODE>--restricted</CODE> | |
6935 | <DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>). | |
6936 | <P> | |
6937 | ||
6938 | <DT><CODE>--verbose</CODE> | |
6939 | <DD>Equivalent to <SAMP>`-v'</SAMP>. Print shell input lines as they're read. | |
6940 | <P> | |
6941 | ||
6942 | <DT><CODE>--version</CODE> | |
6943 | <DD>Show version information for this instance of | |
6944 | Bash on the standard output and exit successfully. | |
6945 | <P> | |
6946 | ||
6947 | </DL> | |
6948 | <P> | |
6949 | ||
6950 | There are several single-character options that may be supplied at | |
6951 | invocation which are not available with the <CODE>set</CODE> builtin. | |
6952 | </P><P> | |
6953 | ||
6954 | <DL COMPACT> | |
6955 | <DT><CODE>-c <VAR>string</VAR></CODE> | |
6956 | <DD>Read and execute commands from <VAR>string</VAR> after processing the | |
6957 | options, then exit. Any remaining arguments are assigned to the | |
6958 | positional parameters, starting with <CODE>$0</CODE>. | |
6959 | <P> | |
6960 | ||
6961 | <DT><CODE>-i</CODE> | |
6962 | <DD>Force the shell to run interactively. Interactive shells are | |
6963 | described in <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>. | |
6964 | <P> | |
6965 | ||
6966 | <DT><CODE>-l</CODE> | |
6967 | <DD>Make this shell act as if it had been directly invoked by login. | |
6968 | When the shell is interactive, this is equivalent to starting a | |
6969 | login shell with <SAMP>`exec -l bash'</SAMP>. | |
6970 | When the shell is not interactive, the login shell startup files will | |
6971 | be executed. | |
6972 | <SAMP>`exec bash -l'</SAMP> or <SAMP>`exec bash --login'</SAMP> | |
6973 | will replace the current shell with a Bash login shell. | |
6974 | See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>, for a description of the special behavior | |
6975 | of a login shell. | |
6976 | <P> | |
6977 | ||
6978 | <DT><CODE>-r</CODE> | |
6979 | <DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>). | |
6980 | <P> | |
6981 | ||
6982 | <DT><CODE>-s</CODE> | |
6983 | <DD>If this option is present, or if no arguments remain after option | |
6984 | processing, then commands are read from the standard input. | |
6985 | This option allows the positional parameters to be set | |
6986 | when invoking an interactive shell. | |
6987 | <P> | |
6988 | ||
6989 | <DT><CODE>-D</CODE> | |
6990 | <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP> | |
6991 | is printed on the standard output. | |
6992 | These are the strings that | |
6993 | are subject to language translation when the current locale | |
6994 | is not <CODE>C</CODE> or <CODE>POSIX</CODE> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>). | |
6995 | This implies the <SAMP>`-n'</SAMP> option; no commands will be executed. | |
6996 | <P> | |
6997 | ||
6998 | <DT><CODE>[-+]O [<VAR>shopt_option</VAR>]</CODE> | |
6999 | <DD><VAR>shopt_option</VAR> is one of the shell options accepted by the | |
7000 | <CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>). | |
7001 | If <VAR>shopt_option</VAR> is present, <SAMP>`-O'</SAMP> sets the value of that option; | |
7002 | <SAMP>`+O'</SAMP> unsets it. | |
7003 | If <VAR>shopt_option</VAR> is not supplied, the names and values of the shell | |
7004 | options accepted by <CODE>shopt</CODE> are printed on the standard output. | |
7005 | If the invocation option is <SAMP>`+O'</SAMP>, the output is displayed in a format | |
7006 | that may be reused as input. | |
7007 | <P> | |
7008 | ||
7009 | <DT><CODE>--</CODE> | |
7010 | <DD>A <CODE>--</CODE> signals the end of options and disables further option | |
7011 | processing. | |
7012 | Any arguments after the <CODE>--</CODE> are treated as filenames and arguments. | |
7013 | <P> | |
7014 | ||
7015 | </DL> | |
7016 | <P> | |
7017 | ||
7018 | <A NAME="IDX284"></A> | |
7019 | A <EM>login</EM> shell is one whose first character of argument zero is | |
7020 | <SAMP>`-'</SAMP>, or one invoked with the <SAMP>`--login'</SAMP> option. | |
7021 | </P><P> | |
7022 | ||
7023 | <A NAME="IDX285"></A> | |
7024 | An <EM>interactive</EM> shell is one started without non-option arguments, | |
7025 | unless <SAMP>`-s'</SAMP> is specified, | |
7026 | without specifying the <SAMP>`-c'</SAMP> option, and whose input and output are both | |
7027 | connected to terminals (as determined by <CODE>isatty(3)</CODE>), or one | |
7028 | started with the <SAMP>`-i'</SAMP> option. See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for more | |
7029 | information. | |
7030 | </P><P> | |
7031 | ||
7032 | If arguments remain after option processing, and neither the | |
7033 | <SAMP>`-c'</SAMP> nor the <SAMP>`-s'</SAMP> | |
7034 | option has been supplied, the first argument is assumed to | |
7035 | be the name of a file containing shell commands (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>). | |
7036 | When Bash is invoked in this fashion, <CODE>$0</CODE> | |
7037 | is set to the name of the file, and the positional parameters | |
7038 | are set to the remaining arguments. | |
7039 | Bash reads and executes commands from this file, then exits. | |
7040 | Bash's exit status is the exit status of the last command executed | |
7041 | in the script. If no commands are executed, the exit status is 0. | |
7042 | </P><P> | |
7043 | ||
7044 | <A NAME="Bash Startup Files"></A> | |
7045 | <HR SIZE="6"> | |
7046 | <A NAME="SEC70"></A> | |
7047 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7048 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> < </A>]</TD> | |
7049 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> > </A>]</TD> | |
7050 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> << </A>]</TD> | |
7051 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7052 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7053 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7054 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7055 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7056 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7057 | </TR></TABLE> | |
7058 | <H2> 6.2 Bash Startup Files </H2> | |
7059 | <!--docid::SEC70::--> | |
7060 | <P> | |
7061 | ||
7062 | This section describes how Bash executes its startup files. | |
7063 | If any of the files exist but cannot be read, Bash reports an error. | |
7064 | Tildes are expanded in file names as described above under | |
7065 | Tilde Expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>). | |
7066 | </P><P> | |
7067 | ||
7068 | Interactive shells are described in <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>. | |
7069 | </P><P> | |
7070 | ||
7071 | <A NAME="SEC71"></A> | |
7072 | <H4> Invoked as an interactive login shell, or with <SAMP>`--login'</SAMP> </H4> | |
7073 | <!--docid::SEC71::--> | |
7074 | <P> | |
7075 | ||
7076 | When Bash is invoked as an interactive login shell, or as a | |
7077 | non-interactive shell with the <SAMP>`--login'</SAMP> option, it first reads and | |
7078 | executes commands from the file <TT>`/etc/profile'</TT>, if that file exists. | |
7079 | After reading that file, it looks for <TT>`~/.bash_profile'</TT>, | |
7080 | <TT>`~/.bash_login'</TT>, and <TT>`~/.profile'</TT>, in that order, and reads | |
7081 | and executes commands from the first one that exists and is readable. | |
7082 | The <SAMP>`--noprofile'</SAMP> option may be used when the shell is started to | |
7083 | inhibit this behavior. | |
7084 | </P><P> | |
7085 | ||
7086 | When a login shell exits, Bash reads and executes commands from | |
7087 | the file <TT>`~/.bash_logout'</TT>, if it exists. | |
7088 | </P><P> | |
7089 | ||
7090 | <A NAME="SEC72"></A> | |
7091 | <H4> Invoked as an interactive non-login shell </H4> | |
7092 | <!--docid::SEC72::--> | |
7093 | <P> | |
7094 | ||
7095 | When an interactive shell that is not a login shell is started, Bash | |
7096 | reads and executes commands from <TT>`~/.bashrc'</TT>, if that file exists. | |
7097 | This may be inhibited by using the <SAMP>`--norc'</SAMP> option. | |
7098 | The <SAMP>`--rcfile <VAR>file</VAR>'</SAMP> option will force Bash to read and | |
7099 | execute commands from <VAR>file</VAR> instead of <TT>`~/.bashrc'</TT>. | |
7100 | </P><P> | |
7101 | ||
7102 | So, typically, your <TT>`~/.bash_profile'</TT> contains the line | |
7103 | <TABLE><tr><td> </td><td class=example><pre><CODE>if [ -f ~/.bashrc ]; then . ~/.bashrc; fi</CODE> | |
7104 | </pre></td></tr></table>after (or before) any login-specific initializations. | |
7105 | </P><P> | |
7106 | ||
7107 | <A NAME="SEC73"></A> | |
7108 | <H4> Invoked non-interactively </H4> | |
7109 | <!--docid::SEC73::--> | |
7110 | <P> | |
7111 | ||
7112 | When Bash is started non-interactively, to run a shell script, | |
7113 | for example, it looks for the variable <CODE>BASH_ENV</CODE> in the environment, | |
7114 | expands its value if it appears there, and uses the expanded value as | |
7115 | the name of a file to read and execute. Bash behaves as if the | |
7116 | following command were executed: | |
7117 | <TABLE><tr><td> </td><td class=example><pre><CODE>if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi</CODE> | |
7118 | </pre></td></tr></table>but the value of the <CODE>PATH</CODE> variable is not used to search for the | |
7119 | file name. | |
7120 | </P><P> | |
7121 | ||
7122 | As noted above, if a non-interactive shell is invoked with the | |
7123 | <SAMP>`--login'</SAMP> option, Bash attempts to read and execute commands from the | |
7124 | login shell startup files. | |
7125 | </P><P> | |
7126 | ||
7127 | <A NAME="SEC74"></A> | |
7128 | <H4> Invoked with name <CODE>sh</CODE> </H4> | |
7129 | <!--docid::SEC74::--> | |
7130 | <P> | |
7131 | ||
7132 | If Bash is invoked with the name <CODE>sh</CODE>, it tries to mimic the | |
7133 | startup behavior of historical versions of <CODE>sh</CODE> as closely as | |
7134 | possible, while conforming to the POSIX standard as well. | |
7135 | </P><P> | |
7136 | ||
7137 | When invoked as an interactive login shell, or as a non-interactive | |
7138 | shell with the <SAMP>`--login'</SAMP> option, it first attempts to read | |
7139 | and execute commands from <TT>`/etc/profile'</TT> and <TT>`~/.profile'</TT>, in | |
7140 | that order. | |
7141 | The <SAMP>`--noprofile'</SAMP> option may be used to inhibit this behavior. | |
7142 | When invoked as an interactive shell with the name <CODE>sh</CODE>, Bash | |
7143 | looks for the variable <CODE>ENV</CODE>, expands its value if it is defined, | |
7144 | and uses the expanded value as the name of a file to read and execute. | |
7145 | Since a shell invoked as <CODE>sh</CODE> does not attempt to read and execute | |
7146 | commands from any other startup files, the <SAMP>`--rcfile'</SAMP> option has | |
7147 | no effect. | |
7148 | A non-interactive shell invoked with the name <CODE>sh</CODE> does not attempt | |
7149 | to read any other startup files. | |
7150 | </P><P> | |
7151 | ||
7152 | When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after | |
7153 | the startup files are read. | |
7154 | </P><P> | |
7155 | ||
7156 | <A NAME="SEC75"></A> | |
7157 | <H4> Invoked in POSIX mode </H4> | |
7158 | <!--docid::SEC75::--> | |
7159 | <P> | |
7160 | ||
7161 | When Bash is started in POSIX mode, as with the | |
7162 | <SAMP>`--posix'</SAMP> command line option, it follows the POSIX standard | |
7163 | for startup files. | |
7164 | In this mode, interactive shells expand the <CODE>ENV</CODE> variable | |
7165 | and commands are read and executed from the file whose name is the | |
7166 | expanded value. | |
7167 | No other startup files are read. | |
7168 | </P><P> | |
7169 | ||
7170 | <A NAME="SEC76"></A> | |
7171 | <H4> Invoked by remote shell daemon </H4> | |
7172 | <!--docid::SEC76::--> | |
7173 | <P> | |
7174 | ||
7175 | Bash attempts to determine when it is being run with its standard input | |
7176 | connected to a a network connection, as if by the remote shell | |
7177 | daemon, usually <CODE>rshd</CODE>, or the secure shell daemon <CODE>sshd</CODE>. | |
7178 | If Bash determines it is being run in | |
7179 | this fashion, it reads and executes commands from <TT>`~/.bashrc'</TT>, if that | |
7180 | file exists and is readable. | |
7181 | It will not do this if invoked as <CODE>sh</CODE>. | |
7182 | The <SAMP>`--norc'</SAMP> option may be used to inhibit this behavior, and the | |
7183 | <SAMP>`--rcfile'</SAMP> option may be used to force another file to be read, but | |
7184 | <CODE>rshd</CODE> does not generally invoke the shell with those options or | |
7185 | allow them to be specified. | |
7186 | </P><P> | |
7187 | ||
7188 | <A NAME="SEC77"></A> | |
7189 | <H4> Invoked with unequal effective and real UID/GIDs </H4> | |
7190 | <!--docid::SEC77::--> | |
7191 | <P> | |
7192 | ||
7193 | If Bash is started with the effective user (group) id not equal to the | |
7194 | real user (group) id, and the <CODE>-p</CODE> option is not supplied, no startup | |
7195 | files are read, shell functions are not inherited from the environment, | |
7196 | the <CODE>SHELLOPTS</CODE> variable, if it appears in the environment, is ignored, | |
7197 | and the effective user id is set to the real user id. | |
7198 | If the <CODE>-p</CODE> option is supplied at invocation, the startup behavior is | |
7199 | the same, but the effective user id is not reset. | |
7200 | </P><P> | |
7201 | ||
7202 | <A NAME="Interactive Shells"></A> | |
7203 | <HR SIZE="6"> | |
7204 | <A NAME="SEC78"></A> | |
7205 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7206 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> < </A>]</TD> | |
7207 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> > </A>]</TD> | |
7208 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD> | |
7209 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7210 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD> | |
7211 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7212 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7213 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7214 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7215 | </TR></TABLE> | |
7216 | <H2> 6.3 Interactive Shells </H2> | |
7217 | <!--docid::SEC78::--> | |
7218 | <P> | |
7219 | ||
7220 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
7221 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC79">6.3.1 What is an Interactive Shell?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What determines whether a shell is Interactive.</TD></TR> | |
7222 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC80">6.3.2 Is this Shell Interactive?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to tell if a shell is interactive.</TD></TR> | |
7223 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC81">6.3.3 Interactive Shell Behavior</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What changes in a interactive shell?</TD></TR> | |
7224 | </TABLE></BLOCKQUOTE> | |
7225 | <P> | |
7226 | ||
7227 | <A NAME="What is an Interactive Shell?"></A> | |
7228 | <HR SIZE="6"> | |
7229 | <A NAME="SEC79"></A> | |
7230 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7231 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> < </A>]</TD> | |
7232 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> > </A>]</TD> | |
7233 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD> | |
7234 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD> | |
7235 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD> | |
7236 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7237 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7238 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7239 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7240 | </TR></TABLE> | |
7241 | <H3> 6.3.1 What is an Interactive Shell? </H3> | |
7242 | <!--docid::SEC79::--> | |
7243 | <P> | |
7244 | ||
7245 | An interactive shell | |
7246 | is one started without non-option arguments, unless <SAMP>`-s'</SAMP> is | |
7247 | specified, without specifying the <SAMP>`-c'</SAMP> option, and | |
7248 | whose input and error output are both | |
7249 | connected to terminals (as determined by <CODE>isatty(3)</CODE>), | |
7250 | or one started with the <SAMP>`-i'</SAMP> option. | |
7251 | </P><P> | |
7252 | ||
7253 | An interactive shell generally reads from and writes to a user's | |
7254 | terminal. | |
7255 | </P><P> | |
7256 | ||
7257 | The <SAMP>`-s'</SAMP> invocation option may be used to set the positional parameters | |
7258 | when an interactive shell is started. | |
7259 | </P><P> | |
7260 | ||
7261 | <A NAME="Is this Shell Interactive?"></A> | |
7262 | <HR SIZE="6"> | |
7263 | <A NAME="SEC80"></A> | |
7264 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7265 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> < </A>]</TD> | |
7266 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> > </A>]</TD> | |
7267 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> << </A>]</TD> | |
7268 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD> | |
7269 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD> | |
7270 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7271 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7272 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7273 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7274 | </TR></TABLE> | |
7275 | <H3> 6.3.2 Is this Shell Interactive? </H3> | |
7276 | <!--docid::SEC80::--> | |
7277 | <P> | |
7278 | ||
7279 | To determine within a startup script whether or not Bash is | |
7280 | running interactively, | |
7281 | test the value of the <SAMP>`-'</SAMP> special parameter. | |
7282 | It contains <CODE>i</CODE> when the shell is interactive. For example: | |
7283 | </P><P> | |
7284 | ||
7285 | <TABLE><tr><td> </td><td class=example><pre>case "$-" in | |
7286 | *i*) echo This shell is interactive ;; | |
7287 | *) echo This shell is not interactive ;; | |
7288 | esac | |
7289 | </pre></td></tr></table></P><P> | |
7290 | ||
7291 | Alternatively, startup scripts may examine the variable | |
7292 | <CODE>PS1</CODE>; it is unset in non-interactive shells, and set in | |
7293 | interactive shells. Thus: | |
7294 | </P><P> | |
7295 | ||
7296 | <TABLE><tr><td> </td><td class=example><pre>if [ -z "$PS1" ]; then | |
7297 | echo This shell is not interactive | |
7298 | else | |
7299 | echo This shell is interactive | |
7300 | fi | |
7301 | </pre></td></tr></table></P><P> | |
7302 | ||
7303 | <A NAME="Interactive Shell Behavior"></A> | |
7304 | <HR SIZE="6"> | |
7305 | <A NAME="SEC81"></A> | |
7306 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7307 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> < </A>]</TD> | |
7308 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> > </A>]</TD> | |
7309 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD> | |
7310 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD> | |
7311 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD> | |
7312 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7313 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7314 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7315 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7316 | </TR></TABLE> | |
7317 | <H3> 6.3.3 Interactive Shell Behavior </H3> | |
7318 | <!--docid::SEC81::--> | |
7319 | <P> | |
7320 | ||
7321 | When the shell is running interactively, it changes its behavior in | |
7322 | several ways. | |
7323 | </P><P> | |
7324 | ||
7325 | <OL> | |
7326 | <LI> | |
7327 | Startup files are read and executed as described in <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>. | |
7328 | <P> | |
7329 | ||
7330 | <LI> | |
7331 | Job Control (see section <A HREF="bashref.html#SEC91">7. Job Control</A>) is enabled by default. When job | |
7332 | control is in effect, Bash ignores the keyboard-generated job control | |
7333 | signals <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>. | |
7334 | <P> | |
7335 | ||
7336 | <LI> | |
7337 | Bash expands and displays <CODE>PS1</CODE> before reading the first line | |
7338 | of a command, and expands and displays <CODE>PS2</CODE> before reading the | |
7339 | second and subsequent lines of a multi-line command. | |
7340 | <P> | |
7341 | ||
7342 | <LI> | |
7343 | Bash executes the value of the <CODE>PROMPT_COMMAND</CODE> variable as a command | |
7344 | before printing the primary prompt, <CODE>$PS1</CODE> | |
7345 | (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
7346 | <P> | |
7347 | ||
7348 | <LI> | |
7349 | Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) is used to read commands from | |
7350 | the user's terminal. | |
7351 | <P> | |
7352 | ||
7353 | <LI> | |
7354 | Bash inspects the value of the <CODE>ignoreeof</CODE> option to <CODE>set -o</CODE> | |
7355 | instead of exiting immediately when it receives an <CODE>EOF</CODE> on its | |
7356 | standard input when reading a command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
7357 | <P> | |
7358 | ||
7359 | <LI> | |
7360 | Command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>) | |
7361 | and history expansion (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>) | |
7362 | are enabled by default. | |
7363 | Bash will save the command history to the file named by <CODE>$HISTFILE</CODE> | |
7364 | when an interactive shell exits. | |
7365 | <P> | |
7366 | ||
7367 | <LI> | |
7368 | Alias expansion (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>) is performed by default. | |
7369 | <P> | |
7370 | ||
7371 | <LI> | |
7372 | In the absence of any traps, Bash ignores <CODE>SIGTERM</CODE> | |
7373 | (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>). | |
7374 | <P> | |
7375 | ||
7376 | <LI> | |
7377 | In the absence of any traps, <CODE>SIGINT</CODE> is caught and handled | |
7378 | ((see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>). | |
7379 | <CODE>SIGINT</CODE> will interrupt some shell builtins. | |
7380 | <P> | |
7381 | ||
7382 | <LI> | |
7383 | An interactive login shell sends a <CODE>SIGHUP</CODE> to all jobs on exit | |
7384 | if the <CODE>huponexit</CODE> shell option has been enabled (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>). | |
7385 | <P> | |
7386 | ||
7387 | <LI> | |
7388 | The <SAMP>`-n'</SAMP> invocation option is ignored, and <SAMP>`set -n'</SAMP> has | |
7389 | no effect (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
7390 | <P> | |
7391 | ||
7392 | <LI> | |
7393 | Bash will check for mail periodically, depending on the values of the | |
7394 | <CODE>MAIL</CODE>, <CODE>MAILPATH</CODE>, and <CODE>MAILCHECK</CODE> shell variables | |
7395 | (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
7396 | <P> | |
7397 | ||
7398 | <LI> | |
7399 | Expansion errors due to references to unbound shell variables after | |
7400 | <SAMP>`set -u'</SAMP> has been enabled will not cause the shell to exit | |
7401 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
7402 | <P> | |
7403 | ||
7404 | <LI> | |
7405 | The shell will not exit on expansion errors caused by <VAR>var</VAR> being unset | |
7406 | or null in <CODE>${<VAR>var</VAR>:?<VAR>word</VAR>}</CODE> expansions | |
7407 | (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
7408 | <P> | |
7409 | ||
7410 | <LI> | |
7411 | Redirection errors encountered by shell builtins will not cause the | |
7412 | shell to exit. | |
7413 | <P> | |
7414 | ||
7415 | <LI> | |
7416 | When running in POSIX mode, a special builtin returning an error | |
7417 | status will not cause the shell to exit (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>). | |
7418 | <P> | |
7419 | ||
7420 | <LI> | |
7421 | A failed <CODE>exec</CODE> will not cause the shell to exit | |
7422 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
7423 | <P> | |
7424 | ||
7425 | <LI> | |
7426 | Parser syntax errors will not cause the shell to exit. | |
7427 | <P> | |
7428 | ||
7429 | <LI> | |
7430 | Simple spelling correction for directory arguments to the <CODE>cd</CODE> | |
7431 | builtin is enabled by default (see the description of the <CODE>cdspell</CODE> | |
7432 | option to the <CODE>shopt</CODE> builtin in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>). | |
7433 | <P> | |
7434 | ||
7435 | <LI> | |
7436 | The shell will check the value of the <CODE>TMOUT</CODE> variable and exit | |
7437 | if a command is not read within the specified number of seconds after | |
7438 | printing <CODE>$PS1</CODE> (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
7439 | <P> | |
7440 | ||
7441 | </OL> | |
7442 | <P> | |
7443 | ||
7444 | <A NAME="Bash Conditional Expressions"></A> | |
7445 | <HR SIZE="6"> | |
7446 | <A NAME="SEC82"></A> | |
7447 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7448 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> < </A>]</TD> | |
7449 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> > </A>]</TD> | |
7450 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> << </A>]</TD> | |
7451 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7452 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7453 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7454 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7455 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7456 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7457 | </TR></TABLE> | |
7458 | <H2> 6.4 Bash Conditional Expressions </H2> | |
7459 | <!--docid::SEC82::--> | |
7460 | <P> | |
7461 | ||
7462 | Conditional expressions are used by the <CODE>[[</CODE> compound command | |
7463 | and the <CODE>test</CODE> and <CODE>[</CODE> builtin commands. | |
7464 | </P><P> | |
7465 | ||
7466 | Expressions may be unary or binary. | |
7467 | Unary expressions are often used to examine the status of a file. | |
7468 | There are string operators and numeric comparison operators as well. | |
7469 | If the <VAR>file</VAR> argument to one of the primaries is of the form | |
7470 | <TT>`/dev/fd/<VAR>N</VAR>'</TT>, then file descriptor <VAR>N</VAR> is checked. | |
7471 | If the <VAR>file</VAR> argument to one of the primaries is one of | |
7472 | <TT>`/dev/stdin'</TT>, <TT>`/dev/stdout'</TT>, or <TT>`/dev/stderr'</TT>, file | |
7473 | descriptor 0, 1, or 2, respectively, is checked. | |
7474 | </P><P> | |
7475 | ||
7476 | Unless otherwise specified, primaries that operate on files follow symbolic | |
7477 | links and operate on the target of the link, rather than the link itself. | |
7478 | </P><P> | |
7479 | ||
7480 | <DL COMPACT> | |
7481 | <DT><CODE>-a <VAR>file</VAR></CODE> | |
7482 | <DD>True if <VAR>file</VAR> exists. | |
7483 | <P> | |
7484 | ||
7485 | <DT><CODE>-b <VAR>file</VAR></CODE> | |
7486 | <DD>True if <VAR>file</VAR> exists and is a block special file. | |
7487 | <P> | |
7488 | ||
7489 | <DT><CODE>-c <VAR>file</VAR></CODE> | |
7490 | <DD>True if <VAR>file</VAR> exists and is a character special file. | |
7491 | <P> | |
7492 | ||
7493 | <DT><CODE>-d <VAR>file</VAR></CODE> | |
7494 | <DD>True if <VAR>file</VAR> exists and is a directory. | |
7495 | <P> | |
7496 | ||
7497 | <DT><CODE>-e <VAR>file</VAR></CODE> | |
7498 | <DD>True if <VAR>file</VAR> exists. | |
7499 | <P> | |
7500 | ||
7501 | <DT><CODE>-f <VAR>file</VAR></CODE> | |
7502 | <DD>True if <VAR>file</VAR> exists and is a regular file. | |
7503 | <P> | |
7504 | ||
7505 | <DT><CODE>-g <VAR>file</VAR></CODE> | |
7506 | <DD>True if <VAR>file</VAR> exists and its set-group-id bit is set. | |
7507 | <P> | |
7508 | ||
7509 | <DT><CODE>-h <VAR>file</VAR></CODE> | |
7510 | <DD>True if <VAR>file</VAR> exists and is a symbolic link. | |
7511 | <P> | |
7512 | ||
7513 | <DT><CODE>-k <VAR>file</VAR></CODE> | |
7514 | <DD>True if <VAR>file</VAR> exists and its "sticky" bit is set. | |
7515 | <P> | |
7516 | ||
7517 | <DT><CODE>-p <VAR>file</VAR></CODE> | |
7518 | <DD>True if <VAR>file</VAR> exists and is a named pipe (FIFO). | |
7519 | <P> | |
7520 | ||
7521 | <DT><CODE>-r <VAR>file</VAR></CODE> | |
7522 | <DD>True if <VAR>file</VAR> exists and is readable. | |
7523 | <P> | |
7524 | ||
7525 | <DT><CODE>-s <VAR>file</VAR></CODE> | |
7526 | <DD>True if <VAR>file</VAR> exists and has a size greater than zero. | |
7527 | <P> | |
7528 | ||
7529 | <DT><CODE>-t <VAR>fd</VAR></CODE> | |
7530 | <DD>True if file descriptor <VAR>fd</VAR> is open and refers to a terminal. | |
7531 | <P> | |
7532 | ||
7533 | <DT><CODE>-u <VAR>file</VAR></CODE> | |
7534 | <DD>True if <VAR>file</VAR> exists and its set-user-id bit is set. | |
7535 | <P> | |
7536 | ||
7537 | <DT><CODE>-w <VAR>file</VAR></CODE> | |
7538 | <DD>True if <VAR>file</VAR> exists and is writable. | |
7539 | <P> | |
7540 | ||
7541 | <DT><CODE>-x <VAR>file</VAR></CODE> | |
7542 | <DD>True if <VAR>file</VAR> exists and is executable. | |
7543 | <P> | |
7544 | ||
7545 | <DT><CODE>-O <VAR>file</VAR></CODE> | |
7546 | <DD>True if <VAR>file</VAR> exists and is owned by the effective user id. | |
7547 | <P> | |
7548 | ||
7549 | <DT><CODE>-G <VAR>file</VAR></CODE> | |
7550 | <DD>True if <VAR>file</VAR> exists and is owned by the effective group id. | |
7551 | <P> | |
7552 | ||
7553 | <DT><CODE>-L <VAR>file</VAR></CODE> | |
7554 | <DD>True if <VAR>file</VAR> exists and is a symbolic link. | |
7555 | <P> | |
7556 | ||
7557 | <DT><CODE>-S <VAR>file</VAR></CODE> | |
7558 | <DD>True if <VAR>file</VAR> exists and is a socket. | |
7559 | <P> | |
7560 | ||
7561 | <DT><CODE>-N <VAR>file</VAR></CODE> | |
7562 | <DD>True if <VAR>file</VAR> exists and has been modified since it was last read. | |
7563 | <P> | |
7564 | ||
7565 | <DT><CODE><VAR>file1</VAR> -nt <VAR>file2</VAR></CODE> | |
7566 | <DD>True if <VAR>file1</VAR> is newer (according to modification date) | |
7567 | than <VAR>file2</VAR>, or if <VAR>file1</VAR> exists and <VAR>file2</VAR> does not. | |
7568 | <P> | |
7569 | ||
7570 | <DT><CODE><VAR>file1</VAR> -ot <VAR>file2</VAR></CODE> | |
7571 | <DD>True if <VAR>file1</VAR> is older than <VAR>file2</VAR>, | |
7572 | or if <VAR>file2</VAR> exists and <VAR>file1</VAR> does not. | |
7573 | <P> | |
7574 | ||
7575 | <DT><CODE><VAR>file1</VAR> -ef <VAR>file2</VAR></CODE> | |
7576 | <DD>True if <VAR>file1</VAR> and <VAR>file2</VAR> refer to the same device and | |
7577 | inode numbers. | |
7578 | <P> | |
7579 | ||
7580 | <DT><CODE>-o <VAR>optname</VAR></CODE> | |
7581 | <DD>True if shell option <VAR>optname</VAR> is enabled. | |
7582 | The list of options appears in the description of the <SAMP>`-o'</SAMP> | |
7583 | option to the <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
7584 | <P> | |
7585 | ||
7586 | <DT><CODE>-z <VAR>string</VAR></CODE> | |
7587 | <DD>True if the length of <VAR>string</VAR> is zero. | |
7588 | <P> | |
7589 | ||
7590 | <DT><CODE>-n <VAR>string</VAR></CODE> | |
7591 | <DD><DT><CODE><VAR>string</VAR></CODE> | |
7592 | <DD>True if the length of <VAR>string</VAR> is non-zero. | |
7593 | <P> | |
7594 | ||
7595 | <DT><CODE><VAR>string1</VAR> == <VAR>string2</VAR></CODE> | |
7596 | <DD>True if the strings are equal. | |
7597 | <SAMP>`='</SAMP> may be used in place of <SAMP>`=='</SAMP> for strict POSIX compliance. | |
7598 | <P> | |
7599 | ||
7600 | <DT><CODE><VAR>string1</VAR> != <VAR>string2</VAR></CODE> | |
7601 | <DD>True if the strings are not equal. | |
7602 | <P> | |
7603 | ||
7604 | <DT><CODE><VAR>string1</VAR> < <VAR>string2</VAR></CODE> | |
7605 | <DD>True if <VAR>string1</VAR> sorts before <VAR>string2</VAR> lexicographically | |
7606 | in the current locale. | |
7607 | <P> | |
7608 | ||
7609 | <DT><CODE><VAR>string1</VAR> > <VAR>string2</VAR></CODE> | |
7610 | <DD>True if <VAR>string1</VAR> sorts after <VAR>string2</VAR> lexicographically | |
7611 | in the current locale. | |
7612 | <P> | |
7613 | ||
7614 | <DT><CODE><VAR>arg1</VAR> OP <VAR>arg2</VAR></CODE> | |
7615 | <DD><CODE>OP</CODE> is one of | |
7616 | <SAMP>`-eq'</SAMP>, <SAMP>`-ne'</SAMP>, <SAMP>`-lt'</SAMP>, <SAMP>`-le'</SAMP>, <SAMP>`-gt'</SAMP>, or <SAMP>`-ge'</SAMP>. | |
7617 | These arithmetic binary operators return true if <VAR>arg1</VAR> | |
7618 | is equal to, not equal to, less than, less than or equal to, | |
7619 | greater than, or greater than or equal to <VAR>arg2</VAR>, | |
7620 | respectively. <VAR>Arg1</VAR> and <VAR>arg2</VAR> | |
7621 | may be positive or negative integers. | |
7622 | <P> | |
7623 | ||
7624 | </DL> | |
7625 | <P> | |
7626 | ||
7627 | <A NAME="Shell Arithmetic"></A> | |
7628 | <HR SIZE="6"> | |
7629 | <A NAME="SEC83"></A> | |
7630 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7631 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> < </A>]</TD> | |
7632 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> > </A>]</TD> | |
7633 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> << </A>]</TD> | |
7634 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7635 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7636 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7637 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7638 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7639 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7640 | </TR></TABLE> | |
7641 | <H2> 6.5 Shell Arithmetic </H2> | |
7642 | <!--docid::SEC83::--> | |
7643 | <P> | |
7644 | ||
7645 | The shell allows arithmetic expressions to be evaluated, as one of | |
7646 | the shell expansions or by the <CODE>let</CODE> and the <SAMP>`-i'</SAMP> option | |
7647 | to the <CODE>declare</CODE> builtins. | |
7648 | </P><P> | |
7649 | ||
7650 | Evaluation is done in fixed-width integers with no check for overflow, | |
7651 | though division by 0 is trapped and flagged as an error. | |
7652 | The operators and their precedence, associativity, and values | |
7653 | are the same as in the C language. | |
7654 | The following list of operators is grouped into levels of | |
7655 | equal-precedence operators. | |
7656 | The levels are listed in order of decreasing precedence. | |
7657 | </P><P> | |
7658 | ||
7659 | <DL COMPACT> | |
7660 | ||
7661 | <DT><CODE><VAR>id</VAR>++ <VAR>id</VAR>--</CODE> | |
7662 | <DD>variable post-increment and post-decrement | |
7663 | <P> | |
7664 | ||
7665 | <DT><CODE>++<VAR>id</VAR> --<VAR>id</VAR></CODE> | |
7666 | <DD>variable pre-increment and pre-decrement | |
7667 | <P> | |
7668 | ||
7669 | <DT><CODE>- +</CODE> | |
7670 | <DD>unary minus and plus | |
7671 | <P> | |
7672 | ||
7673 | <DT><CODE>! ~</CODE> | |
7674 | <DD>logical and bitwise negation | |
7675 | <P> | |
7676 | ||
7677 | <DT><CODE>**</CODE> | |
7678 | <DD>exponentiation | |
7679 | <P> | |
7680 | ||
7681 | <DT><CODE>* / %</CODE> | |
7682 | <DD>multiplication, division, remainder | |
7683 | <P> | |
7684 | ||
7685 | <DT><CODE>+ -</CODE> | |
7686 | <DD>addition, subtraction | |
7687 | <P> | |
7688 | ||
7689 | <DT><CODE><< >></CODE> | |
7690 | <DD>left and right bitwise shifts | |
7691 | <P> | |
7692 | ||
7693 | <DT><CODE><= >= < ></CODE> | |
7694 | <DD>comparison | |
7695 | <P> | |
7696 | ||
7697 | <DT><CODE>== !=</CODE> | |
7698 | <DD>equality and inequality | |
7699 | <P> | |
7700 | ||
7701 | <DT><CODE>&</CODE> | |
7702 | <DD>bitwise AND | |
7703 | <P> | |
7704 | ||
7705 | <DT><CODE>^</CODE> | |
7706 | <DD>bitwise exclusive OR | |
7707 | <P> | |
7708 | ||
7709 | <DT><CODE>|</CODE> | |
7710 | <DD>bitwise OR | |
7711 | <P> | |
7712 | ||
7713 | <DT><CODE>&&</CODE> | |
7714 | <DD>logical AND | |
7715 | <P> | |
7716 | ||
7717 | <DT><CODE>||</CODE> | |
7718 | <DD>logical OR | |
7719 | <P> | |
7720 | ||
7721 | <DT><CODE>expr ? expr : expr</CODE> | |
7722 | <DD>conditional operator | |
7723 | <P> | |
7724 | ||
7725 | <DT><CODE>= *= /= %= += -= <<= >>= &= ^= |=</CODE> | |
7726 | <DD>assignment | |
7727 | <P> | |
7728 | ||
7729 | <DT><CODE>expr1 , expr2</CODE> | |
7730 | <DD>comma | |
7731 | </DL> | |
7732 | <P> | |
7733 | ||
7734 | Shell variables are allowed as operands; parameter expansion is | |
7735 | performed before the expression is evaluated. | |
7736 | Within an expression, shell variables may also be referenced by name | |
7737 | without using the parameter expansion syntax. | |
7738 | A shell variable that is null or unset evaluates to 0 when referenced | |
7739 | by name without using the parameter expansion syntax. | |
7740 | The value of a variable is evaluated as an arithmetic expression | |
7741 | when it is referenced, or when a variable which has been given the | |
7742 | <VAR>integer</VAR> attribute using <SAMP>`declare -i'</SAMP> is assigned a value. | |
7743 | A null value evaluates to 0. | |
7744 | A shell variable need not have its integer attribute turned on | |
7745 | to be used in an expression. | |
7746 | </P><P> | |
7747 | ||
7748 | Constants with a leading 0 are interpreted as octal numbers. | |
7749 | A leading <SAMP>`0x'</SAMP> or <SAMP>`0X'</SAMP> denotes hexadecimal. Otherwise, | |
7750 | numbers take the form [<VAR>base</VAR><CODE>#</CODE>]<VAR>n</VAR>, where <VAR>base</VAR> | |
7751 | is a decimal number between 2 and 64 representing the arithmetic | |
7752 | base, and <VAR>n</VAR> is a number in that base. If <VAR>base</VAR><CODE>#</CODE> is | |
7753 | omitted, then base 10 is used. | |
7754 | The digits greater than 9 are represented by the lowercase letters, | |
7755 | the uppercase letters, <SAMP>`@'</SAMP>, and <SAMP>`_'</SAMP>, in that order. | |
7756 | If <VAR>base</VAR> is less than or equal to 36, lowercase and uppercase | |
7757 | letters may be used interchangeably to represent numbers between 10 | |
7758 | and 35. | |
7759 | </P><P> | |
7760 | ||
7761 | Operators are evaluated in order of precedence. Sub-expressions in | |
7762 | parentheses are evaluated first and may override the precedence | |
7763 | rules above. | |
7764 | </P><P> | |
7765 | ||
7766 | <A NAME="Aliases"></A> | |
7767 | <HR SIZE="6"> | |
7768 | <A NAME="SEC84"></A> | |
7769 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7770 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> < </A>]</TD> | |
7771 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> > </A>]</TD> | |
7772 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> << </A>]</TD> | |
7773 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7774 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7775 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7776 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7777 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7778 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7779 | </TR></TABLE> | |
7780 | <H2> 6.6 Aliases </H2> | |
7781 | <!--docid::SEC84::--> | |
7782 | <P> | |
7783 | ||
7784 | <VAR>Aliases</VAR> allow a string to be substituted for a word when it is used | |
7785 | as the first word of a simple command. | |
7786 | The shell maintains a list of aliases that may be set and unset with | |
7787 | the <CODE>alias</CODE> and <CODE>unalias</CODE> builtin commands. | |
7788 | </P><P> | |
7789 | ||
7790 | The first word of each simple command, if unquoted, is checked to see | |
7791 | if it has an alias. | |
7792 | If so, that word is replaced by the text of the alias. | |
7793 | The characters <SAMP>`/'</SAMP>, <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`='</SAMP> and any of the | |
7794 | shell metacharacters or quoting characters listed above may not appear | |
7795 | in an alias name. | |
7796 | The replacement text may contain any valid | |
7797 | shell input, including shell metacharacters. | |
7798 | The first word of the replacement text is tested for | |
7799 | aliases, but a word that is identical to an alias being expanded | |
7800 | is not expanded a second time. | |
7801 | This means that one may alias <CODE>ls</CODE> to <CODE>"ls -F"</CODE>, | |
7802 | for instance, and Bash does not try to recursively expand the | |
7803 | replacement text. If the last character of the alias value is a | |
7804 | space or tab character, then the next command word following the | |
7805 | alias is also checked for alias expansion. | |
7806 | </P><P> | |
7807 | ||
7808 | Aliases are created and listed with the <CODE>alias</CODE> | |
7809 | command, and removed with the <CODE>unalias</CODE> command. | |
7810 | </P><P> | |
7811 | ||
7812 | There is no mechanism for using arguments in the replacement text, | |
7813 | as in <CODE>csh</CODE>. | |
7814 | If arguments are needed, a shell function should be used | |
7815 | (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>). | |
7816 | </P><P> | |
7817 | ||
7818 | Aliases are not expanded when the shell is not interactive, | |
7819 | unless the <CODE>expand_aliases</CODE> shell option is set using | |
7820 | <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>). | |
7821 | </P><P> | |
7822 | ||
7823 | The rules concerning the definition and use of aliases are | |
7824 | somewhat confusing. Bash | |
7825 | always reads at least one complete line | |
7826 | of input before executing any | |
7827 | of the commands on that line. Aliases are expanded when a | |
7828 | command is read, not when it is executed. Therefore, an | |
7829 | alias definition appearing on the same line as another | |
7830 | command does not take effect until the next line of input is read. | |
7831 | The commands following the alias definition | |
7832 | on that line are not affected by the new alias. | |
7833 | This behavior is also an issue when functions are executed. | |
7834 | Aliases are expanded when a function definition is read, | |
7835 | not when the function is executed, because a function definition | |
7836 | is itself a compound command. As a consequence, aliases | |
7837 | defined in a function are not available until after that | |
7838 | function is executed. To be safe, always put | |
7839 | alias definitions on a separate line, and do not use <CODE>alias</CODE> | |
7840 | in compound commands. | |
7841 | </P><P> | |
7842 | ||
7843 | For almost every purpose, shell functions are preferred over aliases. | |
7844 | </P><P> | |
7845 | ||
7846 | <A NAME="Arrays"></A> | |
7847 | <HR SIZE="6"> | |
7848 | <A NAME="SEC85"></A> | |
7849 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7850 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> < </A>]</TD> | |
7851 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> > </A>]</TD> | |
7852 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> << </A>]</TD> | |
7853 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7854 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
7855 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7856 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7857 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7858 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7859 | </TR></TABLE> | |
7860 | <H2> 6.7 Arrays </H2> | |
7861 | <!--docid::SEC85::--> | |
7862 | <P> | |
7863 | ||
7864 | Bash provides one-dimensional indexed and associative array variables. | |
7865 | Any variable may be used as an indexed array; | |
7866 | the <CODE>declare</CODE> builtin will explicitly declare an array. | |
7867 | There is no maximum | |
7868 | limit on the size of an array, nor any requirement that members | |
7869 | be indexed or assigned contiguously. | |
7870 | Indexed arrays are referenced using integers (including arithmetic | |
7871 | expressions (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) and are zero-based; | |
7872 | associative arrays use arbitrary strings. | |
7873 | </P><P> | |
7874 | ||
7875 | An indexed array is created automatically if any variable is assigned to | |
7876 | using the syntax | |
7877 | <TABLE><tr><td> </td><td class=example><pre>name[<VAR>subscript</VAR>]=<VAR>value</VAR> | |
7878 | </pre></td></tr></table></P><P> | |
7879 | ||
7880 | The <VAR>subscript</VAR> | |
7881 | is treated as an arithmetic expression that must evaluate to a number | |
7882 | greater than or equal to zero. To explicitly declare an array, use | |
7883 | <TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR> | |
7884 | </pre></td></tr></table>The syntax | |
7885 | <TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR>[<VAR>subscript</VAR>] | |
7886 | </pre></td></tr></table>is also accepted; the <VAR>subscript</VAR> is ignored. | |
7887 | </P><P> | |
7888 | ||
7889 | Associative arrays are created using | |
7890 | <TABLE><tr><td> </td><td class=example><pre>declare -A <VAR>name</VAR>. | |
7891 | </pre></td></tr></table></P><P> | |
7892 | ||
7893 | Attributes may be | |
7894 | specified for an array variable using the <CODE>declare</CODE> and | |
7895 | <CODE>readonly</CODE> builtins. Each attribute applies to all members of | |
7896 | an array. | |
7897 | </P><P> | |
7898 | ||
7899 | Arrays are assigned to using compound assignments of the form | |
7900 | <TABLE><tr><td> </td><td class=example><pre>name=(value<VAR>1</VAR> <small>...</small> value<VAR>n</VAR>) | |
7901 | </pre></td></tr></table>where each | |
7902 | <VAR>value</VAR> is of the form <CODE>[<VAR>subscript</VAR>]=</CODE><VAR>string</VAR>. | |
7903 | Indexed array assignments do not require the bracket and subscript. | |
7904 | When assigning to indexed arrays, if | |
7905 | the optional subscript is supplied, that index is assigned to; | |
7906 | otherwise the index of the element assigned is the last index assigned | |
7907 | to by the statement plus one. Indexing starts at zero. | |
7908 | </P><P> | |
7909 | ||
7910 | When assigning to an associative array, the subscript is required. | |
7911 | </P><P> | |
7912 | ||
7913 | This syntax is also accepted by the <CODE>declare</CODE> | |
7914 | builtin. Individual array elements may be assigned to using the | |
7915 | <CODE>name[</CODE><VAR>subscript</VAR><CODE>]=</CODE><VAR>value</VAR> syntax introduced above. | |
7916 | </P><P> | |
7917 | ||
7918 | Any element of an array may be referenced using | |
7919 | <CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>. | |
7920 | The braces are required to avoid | |
7921 | conflicts with the shell's filename expansion operators. If the | |
7922 | <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the word expands to all members | |
7923 | of the array <VAR>name</VAR>. These subscripts differ only when the word | |
7924 | appears within double quotes. | |
7925 | If the word is double-quoted, | |
7926 | <CODE>${name[*]}</CODE> expands to a single word with | |
7927 | the value of each array member separated by the first character of the | |
7928 | <CODE>IFS</CODE> variable, and <CODE>${name[@]}</CODE> expands each element of | |
7929 | <VAR>name</VAR> to a separate word. When there are no array members, | |
7930 | <CODE>${name[@]}</CODE> expands to nothing. | |
7931 | If the double-quoted expansion occurs within a word, the expansion of | |
7932 | the first parameter is joined with the beginning part of the original | |
7933 | word, and the expansion of the last parameter is joined with the last | |
7934 | part of the original word. | |
7935 | This is analogous to the | |
7936 | expansion of the special parameters <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP>. | |
7937 | <CODE>${#name[</CODE><VAR>subscript</VAR><CODE>]}</CODE> expands to the length of | |
7938 | <CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>. | |
7939 | If <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or | |
7940 | <SAMP>`*'</SAMP>, the expansion is the number of elements in the array. | |
7941 | Referencing an array variable without a subscript is equivalent to | |
7942 | referencing with a subscript of 0. | |
7943 | </P><P> | |
7944 | ||
7945 | The <CODE>unset</CODE> builtin is used to destroy arrays. | |
7946 | <CODE>unset</CODE> <VAR>name</VAR>[<VAR>subscript</VAR>] | |
7947 | destroys the array element at index <VAR>subscript</VAR>. | |
7948 | Care must be taken to avoid unwanted side effects caused by filename | |
7949 | generation. | |
7950 | <CODE>unset</CODE> <VAR>name</VAR>, where <VAR>name</VAR> is an array, removes the | |
7951 | entire array. A subscript of <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP> also removes the | |
7952 | entire array. | |
7953 | </P><P> | |
7954 | ||
7955 | The <CODE>declare</CODE>, <CODE>local</CODE>, and <CODE>readonly</CODE> | |
7956 | builtins each accept a <SAMP>`-a'</SAMP> option to specify an indexed | |
7957 | array and a <SAMP>`-A'</SAMP> option to specify an associative array. | |
7958 | The <CODE>read</CODE> builtin accepts a <SAMP>`-a'</SAMP> | |
7959 | option to assign a list of words read from the standard input | |
7960 | to an array, and can read values from the standard input into | |
7961 | individual array elements. The <CODE>set</CODE> and <CODE>declare</CODE> | |
7962 | builtins display array values in a way that allows them to be | |
7963 | reused as input. | |
7964 | </P><P> | |
7965 | ||
7966 | <A NAME="The Directory Stack"></A> | |
7967 | <HR SIZE="6"> | |
7968 | <A NAME="SEC86"></A> | |
7969 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
7970 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> < </A>]</TD> | |
7971 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> > </A>]</TD> | |
7972 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> << </A>]</TD> | |
7973 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
7974 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> >> </A>]</TD> | |
7975 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
7976 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
7977 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
7978 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
7979 | </TR></TABLE> | |
7980 | <H2> 6.8 The Directory Stack </H2> | |
7981 | <!--docid::SEC86::--> | |
7982 | <P> | |
7983 | ||
7984 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
7985 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands to manipulate | |
7986 | the directory stack.</TD></TR> | |
7987 | </TABLE></BLOCKQUOTE> | |
7988 | <P> | |
7989 | ||
7990 | The directory stack is a list of recently-visited directories. The | |
7991 | <CODE>pushd</CODE> builtin adds directories to the stack as it changes | |
7992 | the current directory, and the <CODE>popd</CODE> builtin removes specified | |
7993 | directories from the stack and changes the current directory to | |
7994 | the directory removed. The <CODE>dirs</CODE> builtin displays the contents | |
7995 | of the directory stack. | |
7996 | </P><P> | |
7997 | ||
7998 | The contents of the directory stack are also visible | |
7999 | as the value of the <CODE>DIRSTACK</CODE> shell variable. | |
8000 | </P><P> | |
8001 | ||
8002 | <A NAME="Directory Stack Builtins"></A> | |
8003 | <HR SIZE="6"> | |
8004 | <A NAME="SEC87"></A> | |
8005 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8006 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> < </A>]</TD> | |
8007 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> > </A>]</TD> | |
8008 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> << </A>]</TD> | |
8009 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> Up </A>]</TD> | |
8010 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> >> </A>]</TD> | |
8011 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8012 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8013 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8014 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8015 | </TR></TABLE> | |
8016 | <H3> 6.8.1 Directory Stack Builtins </H3> | |
8017 | <!--docid::SEC87::--> | |
8018 | <P> | |
8019 | ||
8020 | <DL COMPACT> | |
8021 | ||
8022 | <DT><CODE>dirs</CODE> | |
8023 | <DD><A NAME="IDX286"></A> | |
8024 | <TABLE><tr><td> </td><td class=example><pre>dirs [+<VAR>N</VAR> | -<VAR>N</VAR>] [-clpv] | |
8025 | </pre></td></tr></table>Display the list of currently remembered directories. Directories | |
8026 | are added to the list with the <CODE>pushd</CODE> command; the | |
8027 | <CODE>popd</CODE> command removes directories from the list. | |
8028 | <DL COMPACT> | |
8029 | <DT><CODE>+<VAR>N</VAR></CODE> | |
8030 | <DD>Displays the <VAR>N</VAR>th directory (counting from the left of the | |
8031 | list printed by <CODE>dirs</CODE> when invoked without options), starting | |
8032 | with zero. | |
8033 | <DT><CODE>-<VAR>N</VAR></CODE> | |
8034 | <DD>Displays the <VAR>N</VAR>th directory (counting from the right of the | |
8035 | list printed by <CODE>dirs</CODE> when invoked without options), starting | |
8036 | with zero. | |
8037 | <DT><CODE>-c</CODE> | |
8038 | <DD>Clears the directory stack by deleting all of the elements. | |
8039 | <DT><CODE>-l</CODE> | |
8040 | <DD>Produces a longer listing; the default listing format uses a | |
8041 | tilde to denote the home directory. | |
8042 | <DT><CODE>-p</CODE> | |
8043 | <DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per | |
8044 | line. | |
8045 | <DT><CODE>-v</CODE> | |
8046 | <DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per | |
8047 | line, prefixing each entry with its index in the stack. | |
8048 | </DL> | |
8049 | <P> | |
8050 | ||
8051 | <DT><CODE>popd</CODE> | |
8052 | <DD><A NAME="IDX287"></A> | |
8053 | <TABLE><tr><td> </td><td class=example><pre>popd [+<VAR>N</VAR> | -<VAR>N</VAR>] [-n] | |
8054 | </pre></td></tr></table><P> | |
8055 | ||
8056 | Remove the top entry from the directory stack, and <CODE>cd</CODE> | |
8057 | to the new top directory. | |
8058 | When no arguments are given, <CODE>popd</CODE> | |
8059 | removes the top directory from the stack and | |
8060 | performs a <CODE>cd</CODE> to the new top directory. The | |
8061 | elements are numbered from 0 starting at the first directory listed with | |
8062 | <CODE>dirs</CODE>; i.e., <CODE>popd</CODE> is equivalent to <CODE>popd +0</CODE>. | |
8063 | <DL COMPACT> | |
8064 | <DT><CODE>+<VAR>N</VAR></CODE> | |
8065 | <DD>Removes the <VAR>N</VAR>th directory (counting from the left of the | |
8066 | list printed by <CODE>dirs</CODE>), starting with zero. | |
8067 | <DT><CODE>-<VAR>N</VAR></CODE> | |
8068 | <DD>Removes the <VAR>N</VAR>th directory (counting from the right of the | |
8069 | list printed by <CODE>dirs</CODE>), starting with zero. | |
8070 | <DT><CODE>-n</CODE> | |
8071 | <DD>Suppresses the normal change of directory when removing directories | |
8072 | from the stack, so that only the stack is manipulated. | |
8073 | </DL> | |
8074 | <P> | |
8075 | ||
8076 | <A NAME="IDX288"></A> | |
8077 | <DT><CODE>pushd</CODE> | |
8078 | <DD><TABLE><tr><td> </td><td class=example><pre>pushd [-n] [<VAR>+N</VAR> | <VAR>-N</VAR> | <VAR>dir</VAR> ] | |
8079 | </pre></td></tr></table><P> | |
8080 | ||
8081 | Save the current directory on the top of the directory stack | |
8082 | and then <CODE>cd</CODE> to <VAR>dir</VAR>. | |
8083 | With no arguments, <CODE>pushd</CODE> exchanges the top two directories. | |
8084 | </P><P> | |
8085 | ||
8086 | <DL COMPACT> | |
8087 | <DT><CODE>-n</CODE> | |
8088 | <DD>Suppresses the normal change of directory when adding directories | |
8089 | to the stack, so that only the stack is manipulated. | |
8090 | <DT><CODE>+<VAR>N</VAR></CODE> | |
8091 | <DD>Brings the <VAR>N</VAR>th directory (counting from the left of the | |
8092 | list printed by <CODE>dirs</CODE>, starting with zero) to the top of | |
8093 | the list by rotating the stack. | |
8094 | <DT><CODE>-<VAR>N</VAR></CODE> | |
8095 | <DD>Brings the <VAR>N</VAR>th directory (counting from the right of the | |
8096 | list printed by <CODE>dirs</CODE>, starting with zero) to the top of | |
8097 | the list by rotating the stack. | |
8098 | <DT><CODE><VAR>dir</VAR></CODE> | |
8099 | <DD>Makes the current working directory be the top of the stack, and then | |
8100 | executes the equivalent of `<CODE>cd</CODE> <VAR>dir</VAR>'. | |
8101 | <CODE>cd</CODE>s to <VAR>dir</VAR>. | |
8102 | </DL> | |
8103 | <P> | |
8104 | ||
8105 | </DL> | |
8106 | <P> | |
8107 | ||
8108 | <A NAME="Printing a Prompt"></A> | |
8109 | <HR SIZE="6"> | |
8110 | <A NAME="SEC88"></A> | |
8111 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8112 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> < </A>]</TD> | |
8113 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> > </A>]</TD> | |
8114 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> << </A>]</TD> | |
8115 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
8116 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
8117 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8118 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8119 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8120 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8121 | </TR></TABLE> | |
8122 | <H2> 6.9 Controlling the Prompt </H2> | |
8123 | <!--docid::SEC88::--> | |
8124 | <P> | |
8125 | ||
8126 | The value of the variable <CODE>PROMPT_COMMAND</CODE> is examined just before | |
8127 | Bash prints each primary prompt. If <CODE>PROMPT_COMMAND</CODE> is set and | |
8128 | has a non-null value, then the | |
8129 | value is executed just as if it had been typed on the command line. | |
8130 | </P><P> | |
8131 | ||
8132 | In addition, the following table describes the special characters which | |
8133 | can appear in the prompt variables: | |
8134 | </P><P> | |
8135 | ||
8136 | <DL COMPACT> | |
8137 | <DT><CODE>\a</CODE> | |
8138 | <DD>A bell character. | |
8139 | <DT><CODE>\d</CODE> | |
8140 | <DD>The date, in "Weekday Month Date" format (e.g., "Tue May 26"). | |
8141 | <DT><CODE>\D{<VAR>format</VAR>}</CODE> | |
8142 | <DD>The <VAR>format</VAR> is passed to <CODE>strftime</CODE>(3) and the result is inserted | |
8143 | into the prompt string; an empty <VAR>format</VAR> results in a locale-specific | |
8144 | time representation. The braces are required. | |
8145 | <DT><CODE>\e</CODE> | |
8146 | <DD>An escape character. | |
8147 | <DT><CODE>\h</CODE> | |
8148 | <DD>The hostname, up to the first `.'. | |
8149 | <DT><CODE>\H</CODE> | |
8150 | <DD>The hostname. | |
8151 | <DT><CODE>\j</CODE> | |
8152 | <DD>The number of jobs currently managed by the shell. | |
8153 | <DT><CODE>\l</CODE> | |
8154 | <DD>The basename of the shell's terminal device name. | |
8155 | <DT><CODE>\n</CODE> | |
8156 | <DD>A newline. | |
8157 | <DT><CODE>\r</CODE> | |
8158 | <DD>A carriage return. | |
8159 | <DT><CODE>\s</CODE> | |
8160 | <DD>The name of the shell, the basename of <CODE>$0</CODE> (the portion | |
8161 | following the final slash). | |
8162 | <DT><CODE>\t</CODE> | |
8163 | <DD>The time, in 24-hour HH:MM:SS format. | |
8164 | <DT><CODE>\T</CODE> | |
8165 | <DD>The time, in 12-hour HH:MM:SS format. | |
8166 | <DT><CODE>\@</CODE> | |
8167 | <DD>The time, in 12-hour am/pm format. | |
8168 | <DT><CODE>\A</CODE> | |
8169 | <DD>The time, in 24-hour HH:MM format. | |
8170 | <DT><CODE>\u</CODE> | |
8171 | <DD>The username of the current user. | |
8172 | <DT><CODE>\v</CODE> | |
8173 | <DD>The version of Bash (e.g., 2.00) | |
8174 | <DT><CODE>\V</CODE> | |
8175 | <DD>The release of Bash, version + patchlevel (e.g., 2.00.0) | |
8176 | <DT><CODE>\w</CODE> | |
8177 | <DD>The current working directory, with <CODE>$HOME</CODE> abbreviated with a tilde | |
8178 | (uses the <CODE>$PROMPT_DIRTRIM</CODE> variable). | |
8179 | <DT><CODE>\W</CODE> | |
8180 | <DD>The basename of <CODE>$PWD</CODE>, with <CODE>$HOME</CODE> abbreviated with a tilde. | |
8181 | <DT><CODE>\!</CODE> | |
8182 | <DD>The history number of this command. | |
8183 | <DT><CODE>\#</CODE> | |
8184 | <DD>The command number of this command. | |
8185 | <DT><CODE>\$</CODE> | |
8186 | <DD>If the effective uid is 0, <CODE>#</CODE>, otherwise <CODE>$</CODE>. | |
8187 | <DT><CODE>\<VAR>nnn</VAR></CODE> | |
8188 | <DD>The character whose ASCII code is the octal value <VAR>nnn</VAR>. | |
8189 | <DT><CODE>\\</CODE> | |
8190 | <DD>A backslash. | |
8191 | <DT><CODE>\[</CODE> | |
8192 | <DD>Begin a sequence of non-printing characters. This could be used to | |
8193 | embed a terminal control sequence into the prompt. | |
8194 | <DT><CODE>\]</CODE> | |
8195 | <DD>End a sequence of non-printing characters. | |
8196 | </DL> | |
8197 | <P> | |
8198 | ||
8199 | The command number and the history number are usually different: | |
8200 | the history number of a command is its position in the history | |
8201 | list, which may include commands restored from the history file | |
8202 | (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>), while the command number is | |
8203 | the position in the sequence of commands executed during the current | |
8204 | shell session. | |
8205 | </P><P> | |
8206 | ||
8207 | After the string is decoded, it is expanded via | |
8208 | parameter expansion, command substitution, arithmetic | |
8209 | expansion, and quote removal, subject to the value of the | |
8210 | <CODE>promptvars</CODE> shell option (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
8211 | </P><P> | |
8212 | ||
8213 | <A NAME="The Restricted Shell"></A> | |
8214 | <HR SIZE="6"> | |
8215 | <A NAME="SEC89"></A> | |
8216 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8217 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> < </A>]</TD> | |
8218 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> > </A>]</TD> | |
8219 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> << </A>]</TD> | |
8220 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
8221 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
8222 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8223 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8224 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8225 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8226 | </TR></TABLE> | |
8227 | <H2> 6.10 The Restricted Shell </H2> | |
8228 | <!--docid::SEC89::--> | |
8229 | <P> | |
8230 | ||
8231 | If Bash is started with the name <CODE>rbash</CODE>, or the | |
8232 | <SAMP>`--restricted'</SAMP> | |
8233 | or | |
8234 | <SAMP>`-r'</SAMP> | |
8235 | option is supplied at invocation, the shell becomes restricted. | |
8236 | A restricted shell is used to | |
8237 | set up an environment more controlled than the standard shell. | |
8238 | A restricted shell behaves identically to <CODE>bash</CODE> | |
8239 | with the exception that the following are disallowed or not performed: | |
8240 | </P><P> | |
8241 | ||
8242 | <UL> | |
8243 | <LI> | |
8244 | Changing directories with the <CODE>cd</CODE> builtin. | |
8245 | <LI> | |
8246 | Setting or unsetting the values of the <CODE>SHELL</CODE>, <CODE>PATH</CODE>, | |
8247 | <CODE>ENV</CODE>, or <CODE>BASH_ENV</CODE> variables. | |
8248 | <LI> | |
8249 | Specifying command names containing slashes. | |
8250 | <LI> | |
8251 | Specifying a filename containing a slash as an argument to the <CODE>.</CODE> | |
8252 | builtin command. | |
8253 | <LI> | |
8254 | Specifying a filename containing a slash as an argument to the <SAMP>`-p'</SAMP> | |
8255 | option to the <CODE>hash</CODE> builtin command. | |
8256 | <LI> | |
8257 | Importing function definitions from the shell environment at startup. | |
8258 | <LI> | |
8259 | Parsing the value of <CODE>SHELLOPTS</CODE> from the shell environment at startup. | |
8260 | <LI> | |
8261 | Redirecting output using the <SAMP>`>'</SAMP>, <SAMP>`>|'</SAMP>, <SAMP>`<>'</SAMP>, <SAMP>`>&'</SAMP>, | |
8262 | <SAMP>`&>'</SAMP>, and <SAMP>`>>'</SAMP> redirection operators. | |
8263 | <LI> | |
8264 | Using the <CODE>exec</CODE> builtin to replace the shell with another command. | |
8265 | <LI> | |
8266 | Adding or deleting builtin commands with the | |
8267 | <SAMP>`-f'</SAMP> and <SAMP>`-d'</SAMP> options to the <CODE>enable</CODE> builtin. | |
8268 | <LI> | |
8269 | Using the <CODE>enable</CODE> builtin command to enable disabled shell builtins. | |
8270 | <LI> | |
8271 | Specifying the <SAMP>`-p'</SAMP> option to the <CODE>command</CODE> builtin. | |
8272 | <LI> | |
8273 | Turning off restricted mode with <SAMP>`set +r'</SAMP> or <SAMP>`set +o restricted'</SAMP>. | |
8274 | </UL> | |
8275 | <P> | |
8276 | ||
8277 | These restrictions are enforced after any startup files are read. | |
8278 | </P><P> | |
8279 | ||
8280 | When a command that is found to be a shell script is executed | |
8281 | (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>rbash</CODE> turns off any restrictions in | |
8282 | the shell spawned to execute the script. | |
8283 | </P><P> | |
8284 | ||
8285 | <A NAME="Bash POSIX Mode"></A> | |
8286 | <HR SIZE="6"> | |
8287 | <A NAME="SEC90"></A> | |
8288 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8289 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> < </A>]</TD> | |
8290 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> > </A>]</TD> | |
8291 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> << </A>]</TD> | |
8292 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD> | |
8293 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> | |
8294 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8295 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8296 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8297 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8298 | </TR></TABLE> | |
8299 | <H2> 6.11 Bash POSIX Mode </H2> | |
8300 | <!--docid::SEC90::--> | |
8301 | <P> | |
8302 | ||
8303 | Starting Bash with the <SAMP>`--posix'</SAMP> command-line option or executing | |
8304 | <SAMP>`set -o posix'</SAMP> while Bash is running will cause Bash to conform more | |
8305 | closely to the POSIX standard by changing the behavior to | |
8306 | match that specified by POSIX in areas where the Bash default differs. | |
8307 | </P><P> | |
8308 | ||
8309 | When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after reading the | |
8310 | startup files. | |
8311 | </P><P> | |
8312 | ||
8313 | The following list is what's changed when `POSIX mode' is in effect: | |
8314 | </P><P> | |
8315 | ||
8316 | <OL> | |
8317 | <LI> | |
8318 | When a command in the hash table no longer exists, Bash will re-search | |
8319 | <CODE>$PATH</CODE> to find the new location. This is also available with | |
8320 | <SAMP>`shopt -s checkhash'</SAMP>. | |
8321 | <P> | |
8322 | ||
8323 | <LI> | |
8324 | The message printed by the job control code and builtins when a job | |
8325 | exits with a non-zero status is `Done(status)'. | |
8326 | <P> | |
8327 | ||
8328 | <LI> | |
8329 | The message printed by the job control code and builtins when a job | |
8330 | is stopped is `Stopped(<VAR>signame</VAR>)', where <VAR>signame</VAR> is, for | |
8331 | example, <CODE>SIGTSTP</CODE>. | |
8332 | <P> | |
8333 | ||
8334 | <LI> | |
8335 | The <CODE>bg</CODE> builtin uses the required format to describe each job placed | |
8336 | in the background, which does not include an indication of whether the job | |
8337 | is the current or previous job. | |
8338 | <P> | |
8339 | ||
8340 | <LI> | |
8341 | Reserved words appearing in a context where reserved words are recognized | |
8342 | do not undergo alias expansion. | |
8343 | <P> | |
8344 | ||
8345 | <LI> | |
8346 | The POSIX <CODE>PS1</CODE> and <CODE>PS2</CODE> expansions of <SAMP>`!'</SAMP> to | |
8347 | the history number and <SAMP>`!!'</SAMP> to <SAMP>`!'</SAMP> are enabled, | |
8348 | and parameter expansion is performed on the values of <CODE>PS1</CODE> and | |
8349 | <CODE>PS2</CODE> regardless of the setting of the <CODE>promptvars</CODE> option. | |
8350 | <P> | |
8351 | ||
8352 | <LI> | |
8353 | The POSIX startup files are executed (<CODE>$ENV</CODE>) rather than | |
8354 | the normal Bash files. | |
8355 | <P> | |
8356 | ||
8357 | <LI> | |
8358 | Tilde expansion is only performed on assignments preceding a command | |
8359 | name, rather than on all assignment statements on the line. | |
8360 | <P> | |
8361 | ||
8362 | <LI> | |
8363 | The default history file is <TT>`~/.sh_history'</TT> (this is the | |
8364 | default value of <CODE>$HISTFILE</CODE>). | |
8365 | <P> | |
8366 | ||
8367 | <LI> | |
8368 | The output of <SAMP>`kill -l'</SAMP> prints all the signal names on a single line, | |
8369 | separated by spaces, without the <SAMP>`SIG'</SAMP> prefix. | |
8370 | <P> | |
8371 | ||
8372 | <LI> | |
8373 | The <CODE>kill</CODE> builtin does not accept signal names with a <SAMP>`SIG'</SAMP> | |
8374 | prefix. | |
8375 | <P> | |
8376 | ||
8377 | <LI> | |
8378 | Non-interactive shells exit if <VAR>filename</VAR> in <CODE>.</CODE> <VAR>filename</VAR> | |
8379 | is not found. | |
8380 | <P> | |
8381 | ||
8382 | <LI> | |
8383 | Non-interactive shells exit if a syntax error in an arithmetic expansion | |
8384 | results in an invalid expression. | |
8385 | <P> | |
8386 | ||
8387 | <LI> | |
8388 | Redirection operators do not perform filename expansion on the word | |
8389 | in the redirection unless the shell is interactive. | |
8390 | <P> | |
8391 | ||
8392 | <LI> | |
8393 | Redirection operators do not perform word splitting on the word in the | |
8394 | redirection. | |
8395 | <P> | |
8396 | ||
8397 | <LI> | |
8398 | Function names must be valid shell <CODE>name</CODE>s. That is, they may not | |
8399 | contain characters other than letters, digits, and underscores, and | |
8400 | may not start with a digit. Declaring a function with an invalid name | |
8401 | causes a fatal syntax error in non-interactive shells. | |
8402 | <P> | |
8403 | ||
8404 | <LI> | |
8405 | POSIX special builtins are found before shell functions | |
8406 | during command lookup. | |
8407 | <P> | |
8408 | ||
8409 | <LI> | |
8410 | If a POSIX special builtin returns an error status, a | |
8411 | non-interactive shell exits. The fatal errors are those listed in | |
8412 | the POSIX standard, and include things like passing incorrect options, | |
8413 | redirection errors, variable assignment errors for assignments preceding | |
8414 | the command name, and so on. | |
8415 | <P> | |
8416 | ||
8417 | <LI> | |
8418 | If <CODE>CDPATH</CODE> is set, the <CODE>cd</CODE> builtin will not implicitly | |
8419 | append the current directory to it. This means that <CODE>cd</CODE> will | |
8420 | fail if no valid directory name can be constructed from | |
8421 | any of the entries in <CODE>$CDPATH</CODE>, even if the a directory with | |
8422 | the same name as the name given as an argument to <CODE>cd</CODE> exists | |
8423 | in the current directory. | |
8424 | <P> | |
8425 | ||
8426 | <LI> | |
8427 | A non-interactive shell exits with an error status if a variable | |
8428 | assignment error occurs when no command name follows the assignment | |
8429 | statements. | |
8430 | A variable assignment error occurs, for example, when trying to assign | |
8431 | a value to a readonly variable. | |
8432 | <P> | |
8433 | ||
8434 | <LI> | |
8435 | A non-interactive shell exits with an error status if the iteration | |
8436 | variable in a <CODE>for</CODE> statement or the selection variable in a | |
8437 | <CODE>select</CODE> statement is a readonly variable. | |
8438 | <P> | |
8439 | ||
8440 | <LI> | |
8441 | Process substitution is not available. | |
8442 | <P> | |
8443 | ||
8444 | <LI> | |
8445 | Assignment statements preceding POSIX special builtins | |
8446 | persist in the shell environment after the builtin completes. | |
8447 | <P> | |
8448 | ||
8449 | <LI> | |
8450 | Assignment statements preceding shell function calls persist in the | |
8451 | shell environment after the function returns, as if a POSIX | |
8452 | special builtin command had been executed. | |
8453 | <P> | |
8454 | ||
8455 | <LI> | |
8456 | The <CODE>export</CODE> and <CODE>readonly</CODE> builtin commands display their | |
8457 | output in the format required by POSIX. | |
8458 | <P> | |
8459 | ||
8460 | <LI> | |
8461 | The <CODE>trap</CODE> builtin displays signal names without the leading | |
8462 | <CODE>SIG</CODE>. | |
8463 | <P> | |
8464 | ||
8465 | <LI> | |
8466 | The <CODE>trap</CODE> builtin doesn't check the first argument for a possible | |
8467 | signal specification and revert the signal handling to the original | |
8468 | disposition if it is, unless that argument consists solely of digits and | |
8469 | is a valid signal number. If users want to reset the handler for a given | |
8470 | signal to the original disposition, they should use <SAMP>`-'</SAMP> as the | |
8471 | first argument. | |
8472 | <P> | |
8473 | ||
8474 | <LI> | |
8475 | The <CODE>.</CODE> and <CODE>source</CODE> builtins do not search the current directory | |
8476 | for the filename argument if it is not found by searching <CODE>PATH</CODE>. | |
8477 | <P> | |
8478 | ||
8479 | <LI> | |
8480 | Subshells spawned to execute command substitutions inherit the value of | |
8481 | the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode, | |
8482 | Bash clears the <SAMP>`-e'</SAMP> option in such subshells. | |
8483 | <P> | |
8484 | ||
8485 | <LI> | |
8486 | Alias expansion is always enabled, even in non-interactive shells. | |
8487 | <P> | |
8488 | ||
8489 | <LI> | |
8490 | When the <CODE>alias</CODE> builtin displays alias definitions, it does not | |
8491 | display them with a leading <SAMP>`alias '</SAMP> unless the <SAMP>`-p'</SAMP> option | |
8492 | is supplied. | |
8493 | <P> | |
8494 | ||
8495 | <LI> | |
8496 | When the <CODE>set</CODE> builtin is invoked without options, it does not display | |
8497 | shell function names and definitions. | |
8498 | <P> | |
8499 | ||
8500 | <LI> | |
8501 | When the <CODE>set</CODE> builtin is invoked without options, it displays | |
8502 | variable values without quotes, unless they contain shell metacharacters, | |
8503 | even if the result contains nonprinting characters. | |
8504 | <P> | |
8505 | ||
8506 | <LI> | |
8507 | When the <CODE>cd</CODE> builtin is invoked in <VAR>logical</VAR> mode, and the pathname | |
8508 | constructed from <CODE>$PWD</CODE> and the directory name supplied as an argument | |
8509 | does not refer to an existing directory, <CODE>cd</CODE> will fail instead of | |
8510 | falling back to <VAR>physical</VAR> mode. | |
8511 | <P> | |
8512 | ||
8513 | <LI> | |
8514 | When the <CODE>pwd</CODE> builtin is supplied the <SAMP>`-P'</SAMP> option, it resets | |
8515 | <CODE>$PWD</CODE> to a pathname containing no symlinks. | |
8516 | <P> | |
8517 | ||
8518 | <LI> | |
8519 | The <CODE>pwd</CODE> builtin verifies that the value it prints is the same as the | |
8520 | current directory, even if it is not asked to check the file system with the | |
8521 | <SAMP>`-P'</SAMP> option. | |
8522 | <P> | |
8523 | ||
8524 | <LI> | |
8525 | When listing the history, the <CODE>fc</CODE> builtin does not include an | |
8526 | indication of whether or not a history entry has been modified. | |
8527 | <P> | |
8528 | ||
8529 | <LI> | |
8530 | The default editor used by <CODE>fc</CODE> is <CODE>ed</CODE>. | |
8531 | <P> | |
8532 | ||
8533 | <LI> | |
8534 | The <CODE>type</CODE> and <CODE>command</CODE> builtins will not report a non-executable | |
8535 | file as having been found, though the shell will attempt to execute such a | |
8536 | file if it is the only so-named file found in <CODE>$PATH</CODE>. | |
8537 | <P> | |
8538 | ||
8539 | <LI> | |
8540 | The <CODE>vi</CODE> editing mode will invoke the <CODE>vi</CODE> editor directly when | |
8541 | the <SAMP>`v'</SAMP> command is run, instead of checking <CODE>$VISUAL</CODE> and | |
8542 | <CODE>$EDITOR</CODE>. | |
8543 | <P> | |
8544 | ||
8545 | <LI> | |
8546 | When the <CODE>xpg_echo</CODE> option is enabled, Bash does not attempt to interpret | |
8547 | any arguments to <CODE>echo</CODE> as options. Each argument is displayed, after | |
8548 | escape characters are converted. | |
8549 | <P> | |
8550 | ||
8551 | <LI> | |
8552 | The <CODE>ulimit</CODE> builtin uses a block size of 512 bytes for the <SAMP>`-c'</SAMP> | |
8553 | and <SAMP>`-f'</SAMP> options. | |
8554 | <P> | |
8555 | ||
8556 | </OL> | |
8557 | <P> | |
8558 | ||
8559 | There is other POSIX behavior that Bash does not implement by | |
8560 | default even when in POSIX mode. | |
8561 | Specifically: | |
8562 | </P><P> | |
8563 | ||
8564 | <OL> | |
8565 | ||
8566 | <LI> | |
8567 | The <CODE>fc</CODE> builtin checks <CODE>$EDITOR</CODE> as a program to edit history | |
8568 | entries if <CODE>FCEDIT</CODE> is unset, rather than defaulting directly to | |
8569 | <CODE>ed</CODE>. <CODE>fc</CODE> uses <CODE>ed</CODE> if <CODE>EDITOR</CODE> is unset. | |
8570 | <P> | |
8571 | ||
8572 | <LI> | |
8573 | As noted above, Bash requires the <CODE>xpg_echo</CODE> option to be enabled for | |
8574 | the <CODE>echo</CODE> builtin to be fully conformant. | |
8575 | <P> | |
8576 | ||
8577 | </OL> | |
8578 | <P> | |
8579 | ||
8580 | Bash can be configured to be POSIX-conformant by default, by specifying | |
8581 | the <SAMP>`--enable-strict-posix-default'</SAMP> to <CODE>configure</CODE> when building | |
8582 | (see section <A HREF="bashref.html#SEC134">10.8 Optional Features</A>). | |
8583 | </P><P> | |
8584 | ||
8585 | <A NAME="Job Control"></A> | |
8586 | <HR SIZE="6"> | |
8587 | <A NAME="SEC91"></A> | |
8588 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8589 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> < </A>]</TD> | |
8590 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> > </A>]</TD> | |
8591 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD> | |
8592 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
8593 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD> | |
8594 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8595 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8596 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8597 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8598 | </TR></TABLE> | |
8599 | <H1> 7. Job Control </H1> | |
8600 | <!--docid::SEC91::--> | |
8601 | <P> | |
8602 | ||
8603 | This chapter discusses what job control is, how it works, and how | |
8604 | Bash allows you to access its facilities. | |
8605 | </P><P> | |
8606 | ||
8607 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
8608 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How job control works.</TD></TR> | |
8609 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands used to interact | |
8610 | with job control.</TD></TR> | |
8611 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables Bash uses to customize job | |
8612 | control.</TD></TR> | |
8613 | </TABLE></BLOCKQUOTE> | |
8614 | <P> | |
8615 | ||
8616 | <A NAME="Job Control Basics"></A> | |
8617 | <HR SIZE="6"> | |
8618 | <A NAME="SEC92"></A> | |
8619 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8620 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> < </A>]</TD> | |
8621 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> > </A>]</TD> | |
8622 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD> | |
8623 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> | |
8624 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD> | |
8625 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8626 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8627 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8628 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8629 | </TR></TABLE> | |
8630 | <H2> 7.1 Job Control Basics </H2> | |
8631 | <!--docid::SEC92::--> | |
8632 | <P> | |
8633 | ||
8634 | Job control | |
8635 | refers to the ability to selectively stop (suspend) | |
8636 | the execution of processes and continue (resume) | |
8637 | their execution at a later point. A user typically employs | |
8638 | this facility via an interactive interface supplied jointly | |
8639 | by the system's terminal driver and Bash. | |
8640 | </P><P> | |
8641 | ||
8642 | The shell associates a <VAR>job</VAR> with each pipeline. It keeps a | |
8643 | table of currently executing jobs, which may be listed with the | |
8644 | <CODE>jobs</CODE> command. When Bash starts a job | |
8645 | asynchronously, it prints a line that looks | |
8646 | like: | |
8647 | <TABLE><tr><td> </td><td class=example><pre>[1] 25647 | |
8648 | </pre></td></tr></table>indicating that this job is job number 1 and that the process ID | |
8649 | of the last process in the pipeline associated with this job is | |
8650 | 25647. All of the processes in a single pipeline are members of | |
8651 | the same job. Bash uses the <VAR>job</VAR> abstraction as the | |
8652 | basis for job control. | |
8653 | </P><P> | |
8654 | ||
8655 | To facilitate the implementation of the user interface to job | |
8656 | control, the operating system maintains the notion of a current terminal | |
8657 | process group ID. Members of this process group (processes whose | |
8658 | process group ID is equal to the current terminal process group | |
8659 | ID) receive keyboard-generated signals such as <CODE>SIGINT</CODE>. | |
8660 | These processes are said to be in the foreground. Background | |
8661 | processes are those whose process group ID differs from the | |
8662 | terminal's; such processes are immune to keyboard-generated | |
8663 | signals. Only foreground processes are allowed to read from or | |
8664 | write to the terminal. Background processes which attempt to | |
8665 | read from (write to) the terminal are sent a <CODE>SIGTTIN</CODE> | |
8666 | (<CODE>SIGTTOU</CODE>) signal by the terminal driver, which, unless | |
8667 | caught, suspends the process. | |
8668 | </P><P> | |
8669 | ||
8670 | If the operating system on which Bash is running supports | |
8671 | job control, Bash contains facilities to use it. Typing the | |
8672 | <VAR>suspend</VAR> character (typically <SAMP>`^Z'</SAMP>, Control-Z) while a | |
8673 | process is running causes that process to be stopped and returns | |
8674 | control to Bash. Typing the <VAR>delayed suspend</VAR> character | |
8675 | (typically <SAMP>`^Y'</SAMP>, Control-Y) causes the process to be stopped | |
8676 | when it attempts to read input from the terminal, and control to | |
8677 | be returned to Bash. The user then manipulates the state of | |
8678 | this job, using the <CODE>bg</CODE> command to continue it in the | |
8679 | background, the <CODE>fg</CODE> command to continue it in the | |
8680 | foreground, or the <CODE>kill</CODE> command to kill it. A <SAMP>`^Z'</SAMP> | |
8681 | takes effect immediately, and has the additional side effect of | |
8682 | causing pending output and typeahead to be discarded. | |
8683 | </P><P> | |
8684 | ||
8685 | There are a number of ways to refer to a job in the shell. The | |
8686 | character <SAMP>`%'</SAMP> introduces a job specification (<VAR>jobspec</VAR>). | |
8687 | </P><P> | |
8688 | ||
8689 | Job number <CODE>n</CODE> may be referred to as <SAMP>`%n'</SAMP>. | |
8690 | The symbols <SAMP>`%%'</SAMP> and <SAMP>`%+'</SAMP> refer to the shell's notion of the | |
8691 | current job, which is the last job stopped while it was in the foreground | |
8692 | or started in the background. | |
8693 | A single <SAMP>`%'</SAMP> (with no accompanying job specification) also refers | |
8694 | to the current job. | |
8695 | The previous job may be referenced using <SAMP>`%-'</SAMP>. | |
8696 | If there is only a single job, <SAMP>`%+'</SAMP> and <SAMP>`%-'</SAMP> can both be used | |
8697 | to refer to that job. | |
8698 | In output pertaining to jobs (e.g., the output of the <CODE>jobs</CODE> | |
8699 | command), the current job is always flagged with a <SAMP>`+'</SAMP>, and the | |
8700 | previous job with a <SAMP>`-'</SAMP>. | |
8701 | </P><P> | |
8702 | ||
8703 | A job may also be referred to | |
8704 | using a prefix of the name used to start it, or using a substring | |
8705 | that appears in its command line. For example, <SAMP>`%ce'</SAMP> refers | |
8706 | to a stopped <CODE>ce</CODE> job. Using <SAMP>`%?ce'</SAMP>, on the | |
8707 | other hand, refers to any job containing the string <SAMP>`ce'</SAMP> in | |
8708 | its command line. If the prefix or substring matches more than one job, | |
8709 | Bash reports an error. | |
8710 | </P><P> | |
8711 | ||
8712 | Simply naming a job can be used to bring it into the foreground: | |
8713 | <SAMP>`%1'</SAMP> is a synonym for <SAMP>`fg %1'</SAMP>, bringing job 1 from the | |
8714 | background into the foreground. Similarly, <SAMP>`%1 &'</SAMP> resumes | |
8715 | job 1 in the background, equivalent to <SAMP>`bg %1'</SAMP> | |
8716 | </P><P> | |
8717 | ||
8718 | The shell learns immediately whenever a job changes state. | |
8719 | Normally, Bash waits until it is about to print a prompt | |
8720 | before reporting changes in a job's status so as to not interrupt | |
8721 | any other output. | |
8722 | If the <SAMP>`-b'</SAMP> option to the <CODE>set</CODE> builtin is enabled, | |
8723 | Bash reports such changes immediately (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
8724 | Any trap on <CODE>SIGCHLD</CODE> is executed for each child process | |
8725 | that exits. | |
8726 | </P><P> | |
8727 | ||
8728 | If an attempt to exit Bash is made while jobs are stopped, (or running, if | |
8729 | the <CODE>checkjobs</CODE> option is enabled -- see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the | |
8730 | shell prints a warning message, and if the <CODE>checkjobs</CODE> option is | |
8731 | enabled, lists the jobs and their statuses. | |
8732 | The <CODE>jobs</CODE> command may then be used to inspect their status. | |
8733 | If a second attempt to exit is made without an intervening command, | |
8734 | Bash does not print another warning, and any stopped jobs are terminated. | |
8735 | </P><P> | |
8736 | ||
8737 | <A NAME="Job Control Builtins"></A> | |
8738 | <HR SIZE="6"> | |
8739 | <A NAME="SEC93"></A> | |
8740 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8741 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> < </A>]</TD> | |
8742 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> > </A>]</TD> | |
8743 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> << </A>]</TD> | |
8744 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> | |
8745 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD> | |
8746 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8747 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8748 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8749 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8750 | </TR></TABLE> | |
8751 | <H2> 7.2 Job Control Builtins </H2> | |
8752 | <!--docid::SEC93::--> | |
8753 | <P> | |
8754 | ||
8755 | <DL COMPACT> | |
8756 | ||
8757 | <DT><CODE>bg</CODE> | |
8758 | <DD><A NAME="IDX289"></A> | |
8759 | <TABLE><tr><td> </td><td class=example><pre>bg [<VAR>jobspec</VAR> <small>...</small>] | |
8760 | </pre></td></tr></table>Resume each suspended job <VAR>jobspec</VAR> in the background, as if it | |
8761 | had been started with <SAMP>`&'</SAMP>. | |
8762 | If <VAR>jobspec</VAR> is not supplied, the current job is used. | |
8763 | The return status is zero unless it is run when job control is not | |
8764 | enabled, or, when run with job control enabled, any | |
8765 | <VAR>jobspec</VAR> was not found or specifies a job | |
8766 | that was started without job control. | |
8767 | <P> | |
8768 | ||
8769 | <DT><CODE>fg</CODE> | |
8770 | <DD><A NAME="IDX290"></A> | |
8771 | <TABLE><tr><td> </td><td class=example><pre>fg [<VAR>jobspec</VAR>] | |
8772 | </pre></td></tr></table>Resume the job <VAR>jobspec</VAR> in the foreground and make it the current job. | |
8773 | If <VAR>jobspec</VAR> is not supplied, the current job is used. | |
8774 | The return status is that of the command placed into the foreground, | |
8775 | or non-zero if run when job control is disabled or, when run with | |
8776 | job control enabled, <VAR>jobspec</VAR> does not specify a valid job or | |
8777 | <VAR>jobspec</VAR> specifies a job that was started without job control. | |
8778 | <P> | |
8779 | ||
8780 | <DT><CODE>jobs</CODE> | |
8781 | <DD><A NAME="IDX291"></A> | |
8782 | <TABLE><tr><td> </td><td class=example><pre>jobs [-lnprs] [<VAR>jobspec</VAR>] | |
8783 | jobs -x <VAR>command</VAR> [<VAR>arguments</VAR>] | |
8784 | </pre></td></tr></table><P> | |
8785 | ||
8786 | The first form lists the active jobs. The options have the | |
8787 | following meanings: | |
8788 | </P><P> | |
8789 | ||
8790 | <DL COMPACT> | |
8791 | <DT><CODE>-l</CODE> | |
8792 | <DD>List process IDs in addition to the normal information. | |
8793 | <P> | |
8794 | ||
8795 | <DT><CODE>-n</CODE> | |
8796 | <DD>Display information only about jobs that have changed status since | |
8797 | the user was last notified of their status. | |
8798 | <P> | |
8799 | ||
8800 | <DT><CODE>-p</CODE> | |
8801 | <DD>List only the process ID of the job's process group leader. | |
8802 | <P> | |
8803 | ||
8804 | <DT><CODE>-r</CODE> | |
8805 | <DD>Restrict output to running jobs. | |
8806 | <P> | |
8807 | ||
8808 | <DT><CODE>-s</CODE> | |
8809 | <DD>Restrict output to stopped jobs. | |
8810 | </DL> | |
8811 | <P> | |
8812 | ||
8813 | If <VAR>jobspec</VAR> is given, | |
8814 | output is restricted to information about that job. | |
8815 | If <VAR>jobspec</VAR> is not supplied, the status of all jobs is | |
8816 | listed. | |
8817 | </P><P> | |
8818 | ||
8819 | If the <SAMP>`-x'</SAMP> option is supplied, <CODE>jobs</CODE> replaces any | |
8820 | <VAR>jobspec</VAR> found in <VAR>command</VAR> or <VAR>arguments</VAR> with the | |
8821 | corresponding process group ID, and executes <VAR>command</VAR>, | |
8822 | passing it <VAR>argument</VAR>s, returning its exit status. | |
8823 | </P><P> | |
8824 | ||
8825 | <DT><CODE>kill</CODE> | |
8826 | <DD><A NAME="IDX292"></A> | |
8827 | <TABLE><tr><td> </td><td class=example><pre>kill [-s <VAR>sigspec</VAR>] [-n <VAR>signum</VAR>] [-<VAR>sigspec</VAR>] <VAR>jobspec</VAR> or <VAR>pid</VAR> | |
8828 | kill -l [<VAR>exit_status</VAR>] | |
8829 | </pre></td></tr></table>Send a signal specified by <VAR>sigspec</VAR> or <VAR>signum</VAR> to the process | |
8830 | named by job specification <VAR>jobspec</VAR> or process ID <VAR>pid</VAR>. | |
8831 | <VAR>sigspec</VAR> is either a case-insensitive signal name such as | |
8832 | <CODE>SIGINT</CODE> (with or without the <CODE>SIG</CODE> prefix) | |
8833 | or a signal number; <VAR>signum</VAR> is a signal number. | |
8834 | If <VAR>sigspec</VAR> and <VAR>signum</VAR> are not present, <CODE>SIGTERM</CODE> is used. | |
8835 | The <SAMP>`-l'</SAMP> option lists the signal names. | |
8836 | If any arguments are supplied when <SAMP>`-l'</SAMP> is given, the names of the | |
8837 | signals corresponding to the arguments are listed, and the return status | |
8838 | is zero. | |
8839 | <VAR>exit_status</VAR> is a number specifying a signal number or the exit | |
8840 | status of a process terminated by a signal. | |
8841 | The return status is zero if at least one signal was successfully sent, | |
8842 | or non-zero if an error occurs or an invalid option is encountered. | |
8843 | <P> | |
8844 | ||
8845 | <DT><CODE>wait</CODE> | |
8846 | <DD><A NAME="IDX293"></A> | |
8847 | <TABLE><tr><td> </td><td class=example><pre>wait [<VAR>jobspec</VAR> or <VAR>pid</VAR> ...] | |
8848 | </pre></td></tr></table>Wait until the child process specified by each process ID <VAR>pid</VAR> | |
8849 | or job specification <VAR>jobspec</VAR> exits and return the exit status of the | |
8850 | last command waited for. | |
8851 | If a job spec is given, all processes in the job are waited for. | |
8852 | If no arguments are given, all currently active child processes are | |
8853 | waited for, and the return status is zero. | |
8854 | If neither <VAR>jobspec</VAR> nor <VAR>pid</VAR> specifies an active child process | |
8855 | of the shell, the return status is 127. | |
8856 | <P> | |
8857 | ||
8858 | <DT><CODE>disown</CODE> | |
8859 | <DD><A NAME="IDX294"></A> | |
8860 | <TABLE><tr><td> </td><td class=example><pre>disown [-ar] [-h] [<VAR>jobspec</VAR> <small>...</small>] | |
8861 | </pre></td></tr></table>Without options, each <VAR>jobspec</VAR> is removed from the table of | |
8862 | active jobs. | |
8863 | If the <SAMP>`-h'</SAMP> option is given, the job is not removed from the table, | |
8864 | but is marked so that <CODE>SIGHUP</CODE> is not sent to the job if the shell | |
8865 | receives a <CODE>SIGHUP</CODE>. | |
8866 | If <VAR>jobspec</VAR> is not present, and neither the <SAMP>`-a'</SAMP> nor <SAMP>`-r'</SAMP> | |
8867 | option is supplied, the current job is used. | |
8868 | If no <VAR>jobspec</VAR> is supplied, the <SAMP>`-a'</SAMP> option means to remove or | |
8869 | mark all jobs; the <SAMP>`-r'</SAMP> option without a <VAR>jobspec</VAR> | |
8870 | argument restricts operation to running jobs. | |
8871 | <P> | |
8872 | ||
8873 | <DT><CODE>suspend</CODE> | |
8874 | <DD><A NAME="IDX295"></A> | |
8875 | <TABLE><tr><td> </td><td class=example><pre>suspend [-f] | |
8876 | </pre></td></tr></table>Suspend the execution of this shell until it receives a | |
8877 | <CODE>SIGCONT</CODE> signal. | |
8878 | A login shell cannot be suspended; the <SAMP>`-f'</SAMP> | |
8879 | option can be used to override this and force the suspension. | |
8880 | <P> | |
8881 | ||
8882 | </DL> | |
8883 | <P> | |
8884 | ||
8885 | When job control is not active, the <CODE>kill</CODE> and <CODE>wait</CODE> | |
8886 | builtins do not accept <VAR>jobspec</VAR> arguments. They must be | |
8887 | supplied process IDs. | |
8888 | </P><P> | |
8889 | ||
8890 | <A NAME="Job Control Variables"></A> | |
8891 | <HR SIZE="6"> | |
8892 | <A NAME="SEC94"></A> | |
8893 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8894 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> < </A>]</TD> | |
8895 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> > </A>]</TD> | |
8896 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD> | |
8897 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> | |
8898 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD> | |
8899 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8900 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8901 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8902 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8903 | </TR></TABLE> | |
8904 | <H2> 7.3 Job Control Variables </H2> | |
8905 | <!--docid::SEC94::--> | |
8906 | <P> | |
8907 | ||
8908 | <DL COMPACT> | |
8909 | ||
8910 | <A NAME="IDX296"></A> | |
8911 | <DT><CODE>auto_resume</CODE> | |
8912 | <DD><A NAME="IDX297"></A> | |
8913 | This variable controls how the shell interacts with the user and | |
8914 | job control. If this variable exists then single word simple | |
8915 | commands without redirections are treated as candidates for resumption | |
8916 | of an existing job. There is no ambiguity allowed; if there is | |
8917 | more than one job beginning with the string typed, then | |
8918 | the most recently accessed job will be selected. | |
8919 | The name of a stopped job, in this context, is the command line | |
8920 | used to start it. If this variable is set to the value <SAMP>`exact'</SAMP>, | |
8921 | the string supplied must match the name of a stopped job exactly; | |
8922 | if set to <SAMP>`substring'</SAMP>, | |
8923 | the string supplied needs to match a substring of the name of a | |
8924 | stopped job. The <SAMP>`substring'</SAMP> value provides functionality | |
8925 | analogous to the <SAMP>`%?'</SAMP> job ID (see section <A HREF="bashref.html#SEC92">7.1 Job Control Basics</A>). | |
8926 | If set to any other value, the supplied string must | |
8927 | be a prefix of a stopped job's name; this provides functionality | |
8928 | analogous to the <SAMP>`%'</SAMP> job ID. | |
8929 | <P> | |
8930 | ||
8931 | </DL> | |
8932 | <P> | |
8933 | ||
8934 | <A NAME="IDX298"></A> | |
8935 | </P><P> | |
8936 | ||
8937 | <A NAME="Command Line Editing"></A> | |
8938 | <HR SIZE="6"> | |
8939 | <A NAME="SEC95"></A> | |
8940 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8941 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> < </A>]</TD> | |
8942 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> > </A>]</TD> | |
8943 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> << </A>]</TD> | |
8944 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
8945 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
8946 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8947 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8948 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8949 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8950 | </TR></TABLE> | |
8951 | <H1> 8. Command Line Editing </H1> | |
8952 | <!--docid::SEC95::--> | |
8953 | <P> | |
8954 | ||
8955 | This chapter describes the basic features of the GNU | |
8956 | command line editing interface. | |
8957 | Command line editing is provided by the Readline library, which is | |
8958 | used by several different programs, including Bash. | |
8959 | Command line editing is enabled by default when using an interactive shell, | |
8960 | unless the <SAMP>`--noediting'</SAMP> option is supplied at shell invocation. | |
8961 | Line editing is also used when using the <SAMP>`-e'</SAMP> option to the | |
8962 | <CODE>read</CODE> builtin command (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
8963 | By default, the line editing commands are similar to those of emacs. | |
8964 | A vi-style line editing interface is also available. | |
8965 | Line editing can be enabled at any time using the <SAMP>`-o emacs'</SAMP> or | |
8966 | <SAMP>`-o vi'</SAMP> options to the <CODE>set</CODE> builtin command | |
8967 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), or disabled using the <SAMP>`+o emacs'</SAMP> or | |
8968 | <SAMP>`+o vi'</SAMP> options to <CODE>set</CODE>. | |
8969 | </P><P> | |
8970 | ||
8971 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
8972 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC96">8.1 Introduction to Line Editing</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Notation used in this text.</TD></TR> | |
8973 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC97">8.2 Readline Interaction</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The minimum set of commands for editing a line.</TD></TR> | |
8974 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC103">8.3 Readline Init File</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Customizing Readline from a user's view.</TD></TR> | |
8975 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A description of most of the Readline commands | |
8976 | available for binding</TD></TR> | |
8977 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC116">8.5 Readline vi Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A short description of how to make Readline | |
8978 | behave like the vi editor.</TD></TR> | |
8979 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC117">8.6 Programmable Completion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify the possible completions for | |
8980 | a specific command.</TD></TR> | |
8981 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands to specify how to | |
8982 | complete arguments for a particular command.</TD></TR> | |
8983 | </TABLE></BLOCKQUOTE> | |
8984 | <P> | |
8985 | ||
8986 | <A NAME="Introduction and Notation"></A> | |
8987 | <HR SIZE="6"> | |
8988 | <A NAME="SEC96"></A> | |
8989 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
8990 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> < </A>]</TD> | |
8991 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> > </A>]</TD> | |
8992 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD> | |
8993 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
8994 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
8995 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
8996 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
8997 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
8998 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
8999 | </TR></TABLE> | |
9000 | <H2> 8.1 Introduction to Line Editing </H2> | |
9001 | <!--docid::SEC96::--> | |
9002 | <P> | |
9003 | ||
9004 | The following paragraphs describe the notation used to represent | |
9005 | keystrokes. | |
9006 | </P><P> | |
9007 | ||
9008 | The text <KBD>C-k</KBD> is read as `Control-K' and describes the character | |
9009 | produced when the <KBD>k</KBD> key is pressed while the Control key | |
9010 | is depressed. | |
9011 | </P><P> | |
9012 | ||
9013 | The text <KBD>M-k</KBD> is read as `Meta-K' and describes the character | |
9014 | produced when the Meta key (if you have one) is depressed, and the <KBD>k</KBD> | |
9015 | key is pressed. | |
9016 | The Meta key is labeled <KBD>ALT</KBD> on many keyboards. | |
9017 | On keyboards with two keys labeled <KBD>ALT</KBD> (usually to either side of | |
9018 | the space bar), the <KBD>ALT</KBD> on the left side is generally set to | |
9019 | work as a Meta key. | |
9020 | The <KBD>ALT</KBD> key on the right may also be configured to work as a | |
9021 | Meta key or may be configured as some other modifier, such as a | |
9022 | Compose key for typing accented characters. | |
9023 | </P><P> | |
9024 | ||
9025 | If you do not have a Meta or <KBD>ALT</KBD> key, or another key working as | |
9026 | a Meta key, the identical keystroke can be generated by typing <KBD>ESC</KBD> | |
9027 | <EM>first</EM>, and then typing <KBD>k</KBD>. | |
9028 | Either process is known as <EM>metafying</EM> the <KBD>k</KBD> key. | |
9029 | </P><P> | |
9030 | ||
9031 | The text <KBD>M-C-k</KBD> is read as `Meta-Control-k' and describes the | |
9032 | character produced by <EM>metafying</EM> <KBD>C-k</KBD>. | |
9033 | </P><P> | |
9034 | ||
9035 | In addition, several keys have their own names. Specifically, | |
9036 | <KBD>DEL</KBD>, <KBD>ESC</KBD>, <KBD>LFD</KBD>, <KBD>SPC</KBD>, <KBD>RET</KBD>, and <KBD>TAB</KBD> all | |
9037 | stand for themselves when seen in this text, or in an init file | |
9038 | (see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>). | |
9039 | If your keyboard lacks a <KBD>LFD</KBD> key, typing <KBD>C-j</KBD> will | |
9040 | produce the desired character. | |
9041 | The <KBD>RET</KBD> key may be labeled <KBD>Return</KBD> or <KBD>Enter</KBD> on | |
9042 | some keyboards. | |
9043 | </P><P> | |
9044 | ||
9045 | <A NAME="Readline Interaction"></A> | |
9046 | <HR SIZE="6"> | |
9047 | <A NAME="SEC97"></A> | |
9048 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9049 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> < </A>]</TD> | |
9050 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> > </A>]</TD> | |
9051 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD> | |
9052 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
9053 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9054 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9055 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9056 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9057 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9058 | </TR></TABLE> | |
9059 | <H2> 8.2 Readline Interaction </H2> | |
9060 | <!--docid::SEC97::--> | |
9061 | <P> | |
9062 | ||
9063 | Often during an interactive session you type in a long line of text, | |
9064 | only to notice that the first word on the line is misspelled. The | |
9065 | Readline library gives you a set of commands for manipulating the text | |
9066 | as you type it in, allowing you to just fix your typo, and not forcing | |
9067 | you to retype the majority of the line. Using these editing commands, | |
9068 | you move the cursor to the place that needs correction, and delete or | |
9069 | insert the text of the corrections. Then, when you are satisfied with | |
9070 | the line, you simply press <KBD>RET</KBD>. You do not have to be at the | |
9071 | end of the line to press <KBD>RET</KBD>; the entire line is accepted | |
9072 | regardless of the location of the cursor within the line. | |
9073 | </P><P> | |
9074 | ||
9075 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
9076 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The least you need to know about Readline.</TD></TR> | |
9077 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC99">8.2.2 Readline Movement Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the input line.</TD></TR> | |
9078 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to delete text, and how to get it back!</TD></TR> | |
9079 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC101">8.2.4 Readline Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Giving numeric arguments to commands.</TD></TR> | |
9080 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Searching through previous lines.</TD></TR> | |
9081 | </TABLE></BLOCKQUOTE> | |
9082 | <P> | |
9083 | ||
9084 | <A NAME="Readline Bare Essentials"></A> | |
9085 | <HR SIZE="6"> | |
9086 | <A NAME="SEC98"></A> | |
9087 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9088 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> < </A>]</TD> | |
9089 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> > </A>]</TD> | |
9090 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD> | |
9091 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9092 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9093 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9094 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9095 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9096 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9097 | </TR></TABLE> | |
9098 | <H3> 8.2.1 Readline Bare Essentials </H3> | |
9099 | <!--docid::SEC98::--> | |
9100 | <P> | |
9101 | ||
9102 | In order to enter characters into the line, simply type them. The typed | |
9103 | character appears where the cursor was, and then the cursor moves one | |
9104 | space to the right. If you mistype a character, you can use your | |
9105 | erase character to back up and delete the mistyped character. | |
9106 | </P><P> | |
9107 | ||
9108 | Sometimes you may mistype a character, and | |
9109 | not notice the error until you have typed several other characters. In | |
9110 | that case, you can type <KBD>C-b</KBD> to move the cursor to the left, and then | |
9111 | correct your mistake. Afterwards, you can move the cursor to the right | |
9112 | with <KBD>C-f</KBD>. | |
9113 | </P><P> | |
9114 | ||
9115 | When you add text in the middle of a line, you will notice that characters | |
9116 | to the right of the cursor are `pushed over' to make room for the text | |
9117 | that you have inserted. Likewise, when you delete text behind the cursor, | |
9118 | characters to the right of the cursor are `pulled back' to fill in the | |
9119 | blank space created by the removal of the text. A list of the bare | |
9120 | essentials for editing the text of an input line follows. | |
9121 | </P><P> | |
9122 | ||
9123 | <DL COMPACT> | |
9124 | <DT><KBD>C-b</KBD> | |
9125 | <DD>Move back one character. | |
9126 | <DT><KBD>C-f</KBD> | |
9127 | <DD>Move forward one character. | |
9128 | <DT><KBD>DEL</KBD> or <KBD>Backspace</KBD> | |
9129 | <DD>Delete the character to the left of the cursor. | |
9130 | <DT><KBD>C-d</KBD> | |
9131 | <DD>Delete the character underneath the cursor. | |
9132 | <DT>Printing characters | |
9133 | <DD>Insert the character into the line at the cursor. | |
9134 | <DT><KBD>C-_</KBD> or <KBD>C-x C-u</KBD> | |
9135 | <DD>Undo the last editing command. You can undo all the way back to an | |
9136 | empty line. | |
9137 | </DL> | |
9138 | <P> | |
9139 | ||
9140 | (Depending on your configuration, the <KBD>Backspace</KBD> key be set to | |
9141 | delete the character to the left of the cursor and the <KBD>DEL</KBD> key set | |
9142 | to delete the character underneath the cursor, like <KBD>C-d</KBD>, rather | |
9143 | than the character to the left of the cursor.) | |
9144 | </P><P> | |
9145 | ||
9146 | <A NAME="Readline Movement Commands"></A> | |
9147 | <HR SIZE="6"> | |
9148 | <A NAME="SEC99"></A> | |
9149 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9150 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> < </A>]</TD> | |
9151 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> > </A>]</TD> | |
9152 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> << </A>]</TD> | |
9153 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9154 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9155 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9156 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9157 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9158 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9159 | </TR></TABLE> | |
9160 | <H3> 8.2.2 Readline Movement Commands </H3> | |
9161 | <!--docid::SEC99::--> | |
9162 | <P> | |
9163 | ||
9164 | The above table describes the most basic keystrokes that you need | |
9165 | in order to do editing of the input line. For your convenience, many | |
9166 | other commands have been added in addition to <KBD>C-b</KBD>, <KBD>C-f</KBD>, | |
9167 | <KBD>C-d</KBD>, and <KBD>DEL</KBD>. Here are some commands for moving more rapidly | |
9168 | about the line. | |
9169 | </P><P> | |
9170 | ||
9171 | <DL COMPACT> | |
9172 | <DT><KBD>C-a</KBD> | |
9173 | <DD>Move to the start of the line. | |
9174 | <DT><KBD>C-e</KBD> | |
9175 | <DD>Move to the end of the line. | |
9176 | <DT><KBD>M-f</KBD> | |
9177 | <DD>Move forward a word, where a word is composed of letters and digits. | |
9178 | <DT><KBD>M-b</KBD> | |
9179 | <DD>Move backward a word. | |
9180 | <DT><KBD>C-l</KBD> | |
9181 | <DD>Clear the screen, reprinting the current line at the top. | |
9182 | </DL> | |
9183 | <P> | |
9184 | ||
9185 | Notice how <KBD>C-f</KBD> moves forward a character, while <KBD>M-f</KBD> moves | |
9186 | forward a word. It is a loose convention that control keystrokes | |
9187 | operate on characters while meta keystrokes operate on words. | |
9188 | </P><P> | |
9189 | ||
9190 | <A NAME="Readline Killing Commands"></A> | |
9191 | <HR SIZE="6"> | |
9192 | <A NAME="SEC100"></A> | |
9193 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9194 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> < </A>]</TD> | |
9195 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> > </A>]</TD> | |
9196 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> << </A>]</TD> | |
9197 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9198 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9199 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9200 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9201 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9202 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9203 | </TR></TABLE> | |
9204 | <H3> 8.2.3 Readline Killing Commands </H3> | |
9205 | <!--docid::SEC100::--> | |
9206 | <P> | |
9207 | ||
9208 | <A NAME="IDX299"></A> | |
9209 | <A NAME="IDX300"></A> | |
9210 | </P><P> | |
9211 | ||
9212 | <EM>Killing</EM> text means to delete the text from the line, but to save | |
9213 | it away for later use, usually by <EM>yanking</EM> (re-inserting) | |
9214 | it back into the line. | |
9215 | (`Cut' and `paste' are more recent jargon for `kill' and `yank'.) | |
9216 | </P><P> | |
9217 | ||
9218 | If the description for a command says that it `kills' text, then you can | |
9219 | be sure that you can get the text back in a different (or the same) | |
9220 | place later. | |
9221 | </P><P> | |
9222 | ||
9223 | When you use a kill command, the text is saved in a <EM>kill-ring</EM>. | |
9224 | Any number of consecutive kills save all of the killed text together, so | |
9225 | that when you yank it back, you get it all. The kill | |
9226 | ring is not line specific; the text that you killed on a previously | |
9227 | typed line is available to be yanked back later, when you are typing | |
9228 | another line. | |
9229 | <A NAME="IDX301"></A> | |
9230 | </P><P> | |
9231 | ||
9232 | Here is the list of commands for killing text. | |
9233 | </P><P> | |
9234 | ||
9235 | <DL COMPACT> | |
9236 | <DT><KBD>C-k</KBD> | |
9237 | <DD>Kill the text from the current cursor position to the end of the line. | |
9238 | <P> | |
9239 | ||
9240 | <DT><KBD>M-d</KBD> | |
9241 | <DD>Kill from the cursor to the end of the current word, or, if between | |
9242 | words, to the end of the next word. | |
9243 | Word boundaries are the same as those used by <KBD>M-f</KBD>. | |
9244 | <P> | |
9245 | ||
9246 | <DT><KBD>M-<KBD>DEL</KBD></KBD> | |
9247 | <DD>Kill from the cursor the start of the current word, or, if between | |
9248 | words, to the start of the previous word. | |
9249 | Word boundaries are the same as those used by <KBD>M-b</KBD>. | |
9250 | <P> | |
9251 | ||
9252 | <DT><KBD>C-w</KBD> | |
9253 | <DD>Kill from the cursor to the previous whitespace. This is different than | |
9254 | <KBD>M-<KBD>DEL</KBD></KBD> because the word boundaries differ. | |
9255 | <P> | |
9256 | ||
9257 | </DL> | |
9258 | <P> | |
9259 | ||
9260 | Here is how to <EM>yank</EM> the text back into the line. Yanking | |
9261 | means to copy the most-recently-killed text from the kill buffer. | |
9262 | </P><P> | |
9263 | ||
9264 | <DL COMPACT> | |
9265 | <DT><KBD>C-y</KBD> | |
9266 | <DD>Yank the most recently killed text back into the buffer at the cursor. | |
9267 | <P> | |
9268 | ||
9269 | <DT><KBD>M-y</KBD> | |
9270 | <DD>Rotate the kill-ring, and yank the new top. You can only do this if | |
9271 | the prior command is <KBD>C-y</KBD> or <KBD>M-y</KBD>. | |
9272 | </DL> | |
9273 | <P> | |
9274 | ||
9275 | <A NAME="Readline Arguments"></A> | |
9276 | <HR SIZE="6"> | |
9277 | <A NAME="SEC101"></A> | |
9278 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9279 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> < </A>]</TD> | |
9280 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> > </A>]</TD> | |
9281 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> << </A>]</TD> | |
9282 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9283 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9284 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9285 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9286 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9287 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9288 | </TR></TABLE> | |
9289 | <H3> 8.2.4 Readline Arguments </H3> | |
9290 | <!--docid::SEC101::--> | |
9291 | <P> | |
9292 | ||
9293 | You can pass numeric arguments to Readline commands. Sometimes the | |
9294 | argument acts as a repeat count, other times it is the <I>sign</I> of the | |
9295 | argument that is significant. If you pass a negative argument to a | |
9296 | command which normally acts in a forward direction, that command will | |
9297 | act in a backward direction. For example, to kill text back to the | |
9298 | start of the line, you might type <SAMP>`M-- C-k'</SAMP>. | |
9299 | </P><P> | |
9300 | ||
9301 | The general way to pass numeric arguments to a command is to type meta | |
9302 | digits before the command. If the first `digit' typed is a minus | |
9303 | sign (<SAMP>`-'</SAMP>), then the sign of the argument will be negative. Once | |
9304 | you have typed one meta digit to get the argument started, you can type | |
9305 | the remainder of the digits, and then the command. For example, to give | |
9306 | the <KBD>C-d</KBD> command an argument of 10, you could type <SAMP>`M-1 0 C-d'</SAMP>, | |
9307 | which will delete the next ten characters on the input line. | |
9308 | </P><P> | |
9309 | ||
9310 | <A NAME="Searching"></A> | |
9311 | <HR SIZE="6"> | |
9312 | <A NAME="SEC102"></A> | |
9313 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9314 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> < </A>]</TD> | |
9315 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> > </A>]</TD> | |
9316 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD> | |
9317 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD> | |
9318 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> | |
9319 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9320 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9321 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9322 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9323 | </TR></TABLE> | |
9324 | <H3> 8.2.5 Searching for Commands in the History </H3> | |
9325 | <!--docid::SEC102::--> | |
9326 | <P> | |
9327 | ||
9328 | Readline provides commands for searching through the command history | |
9329 | (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>) | |
9330 | for lines containing a specified string. | |
9331 | There are two search modes: <EM>incremental</EM> and <EM>non-incremental</EM>. | |
9332 | </P><P> | |
9333 | ||
9334 | Incremental searches begin before the user has finished typing the | |
9335 | search string. | |
9336 | As each character of the search string is typed, Readline displays | |
9337 | the next entry from the history matching the string typed so far. | |
9338 | An incremental search requires only as many characters as needed to | |
9339 | find the desired history entry. | |
9340 | To search backward in the history for a particular string, type | |
9341 | <KBD>C-r</KBD>. Typing <KBD>C-s</KBD> searches forward through the history. | |
9342 | The characters present in the value of the <CODE>isearch-terminators</CODE> variable | |
9343 | are used to terminate an incremental search. | |
9344 | If that variable has not been assigned a value, the <KBD>ESC</KBD> and | |
9345 | <KBD>C-J</KBD> characters will terminate an incremental search. | |
9346 | <KBD>C-g</KBD> will abort an incremental search and restore the original line. | |
9347 | When the search is terminated, the history entry containing the | |
9348 | search string becomes the current line. | |
9349 | </P><P> | |
9350 | ||
9351 | To find other matching entries in the history list, type <KBD>C-r</KBD> or | |
9352 | <KBD>C-s</KBD> as appropriate. | |
9353 | This will search backward or forward in the history for the next | |
9354 | entry matching the search string typed so far. | |
9355 | Any other key sequence bound to a Readline command will terminate | |
9356 | the search and execute that command. | |
9357 | For instance, a <KBD>RET</KBD> will terminate the search and accept | |
9358 | the line, thereby executing the command from the history list. | |
9359 | A movement command will terminate the search, make the last line found | |
9360 | the current line, and begin editing. | |
9361 | </P><P> | |
9362 | ||
9363 | Readline remembers the last incremental search string. If two | |
9364 | <KBD>C-r</KBD>s are typed without any intervening characters defining a new | |
9365 | search string, any remembered search string is used. | |
9366 | </P><P> | |
9367 | ||
9368 | Non-incremental searches read the entire search string before starting | |
9369 | to search for matching history lines. The search string may be | |
9370 | typed by the user or be part of the contents of the current line. | |
9371 | </P><P> | |
9372 | ||
9373 | <A NAME="Readline Init File"></A> | |
9374 | <HR SIZE="6"> | |
9375 | <A NAME="SEC103"></A> | |
9376 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9377 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> < </A>]</TD> | |
9378 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> > </A>]</TD> | |
9379 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD> | |
9380 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
9381 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD> | |
9382 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9383 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9384 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9385 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9386 | </TR></TABLE> | |
9387 | <H2> 8.3 Readline Init File </H2> | |
9388 | <!--docid::SEC103::--> | |
9389 | <P> | |
9390 | ||
9391 | Although the Readline library comes with a set of Emacs-like | |
9392 | keybindings installed by default, it is possible to use a different set | |
9393 | of keybindings. | |
9394 | Any user can customize programs that use Readline by putting | |
9395 | commands in an <EM>inputrc</EM> file, conventionally in his home directory. | |
9396 | The name of this | |
9397 | file is taken from the value of the shell variable <CODE>INPUTRC</CODE>. If | |
9398 | that variable is unset, the default is <TT>`~/.inputrc'</TT>. If that | |
9399 | file does not exist or cannot be read, the ultimate default is | |
9400 | <TT>`/etc/inputrc'</TT>. | |
9401 | </P><P> | |
9402 | ||
9403 | When a program which uses the Readline library starts up, the | |
9404 | init file is read, and the key bindings are set. | |
9405 | </P><P> | |
9406 | ||
9407 | In addition, the <CODE>C-x C-r</CODE> command re-reads this init file, thus | |
9408 | incorporating any changes that you might have made to it. | |
9409 | </P><P> | |
9410 | ||
9411 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
9412 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Syntax for the commands in the inputrc file.</TD></TR> | |
9413 | </TABLE> | |
9414 | ||
9415 | <br> | |
9416 | <TABLE BORDER=0 CELLSPACING=0> | |
9417 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Conditional key bindings in the inputrc file.</TD></TR> | |
9418 | </TABLE> | |
9419 | ||
9420 | <br> | |
9421 | <TABLE BORDER=0 CELLSPACING=0> | |
9422 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC106">8.3.3 Sample Init File</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">An example inputrc file.</TD></TR> | |
9423 | </TABLE></BLOCKQUOTE> | |
9424 | <P> | |
9425 | ||
9426 | <A NAME="Readline Init File Syntax"></A> | |
9427 | <HR SIZE="6"> | |
9428 | <A NAME="SEC104"></A> | |
9429 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9430 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> < </A>]</TD> | |
9431 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> > </A>]</TD> | |
9432 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD> | |
9433 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> | |
9434 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD> | |
9435 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9436 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9437 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9438 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9439 | </TR></TABLE> | |
9440 | <H3> 8.3.1 Readline Init File Syntax </H3> | |
9441 | <!--docid::SEC104::--> | |
9442 | <P> | |
9443 | ||
9444 | There are only a few basic constructs allowed in the | |
9445 | Readline init file. Blank lines are ignored. | |
9446 | Lines beginning with a <SAMP>`#'</SAMP> are comments. | |
9447 | Lines beginning with a <SAMP>`$'</SAMP> indicate conditional | |
9448 | constructs (see section <A HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A>). Other lines | |
9449 | denote variable settings and key bindings. | |
9450 | </P><P> | |
9451 | ||
9452 | <DL COMPACT> | |
9453 | <DT>Variable Settings | |
9454 | <DD>You can modify the run-time behavior of Readline by | |
9455 | altering the values of variables in Readline | |
9456 | using the <CODE>set</CODE> command within the init file. | |
9457 | The syntax is simple: | |
9458 | <P> | |
9459 | ||
9460 | <TABLE><tr><td> </td><td class=example><pre>set <VAR>variable</VAR> <VAR>value</VAR> | |
9461 | </pre></td></tr></table></P><P> | |
9462 | ||
9463 | Here, for example, is how to | |
9464 | change from the default Emacs-like key binding to use | |
9465 | <CODE>vi</CODE> line editing commands: | |
9466 | </P><P> | |
9467 | ||
9468 | <TABLE><tr><td> </td><td class=example><pre>set editing-mode vi | |
9469 | </pre></td></tr></table></P><P> | |
9470 | ||
9471 | Variable names and values, where appropriate, are recognized without regard | |
9472 | to case. Unrecognized variable names are ignored. | |
9473 | </P><P> | |
9474 | ||
9475 | Boolean variables (those that can be set to on or off) are set to on if | |
9476 | the value is null or empty, <VAR>on</VAR> (case-insensitive), or 1. Any other | |
9477 | value results in the variable being set to off. | |
9478 | </P><P> | |
9479 | ||
9480 | The <CODE>bind -V</CODE> command lists the current Readline variable names | |
9481 | and values. See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>. | |
9482 | </P><P> | |
9483 | ||
9484 | A great deal of run-time behavior is changeable with the following | |
9485 | variables. | |
9486 | </P><P> | |
9487 | ||
9488 | <A NAME="IDX302"></A> | |
9489 | <DL COMPACT> | |
9490 | ||
9491 | <DT><CODE>bell-style</CODE> | |
9492 | <DD><A NAME="IDX303"></A> | |
9493 | Controls what happens when Readline wants to ring the terminal bell. | |
9494 | If set to <SAMP>`none'</SAMP>, Readline never rings the bell. If set to | |
9495 | <SAMP>`visible'</SAMP>, Readline uses a visible bell if one is available. | |
9496 | If set to <SAMP>`audible'</SAMP> (the default), Readline attempts to ring | |
9497 | the terminal's bell. | |
9498 | <P> | |
9499 | ||
9500 | <DT><CODE>bind-tty-special-chars</CODE> | |
9501 | <DD><A NAME="IDX304"></A> | |
9502 | If set to <SAMP>`on'</SAMP>, Readline attempts to bind the control characters | |
9503 | treated specially by the kernel's terminal driver to their Readline | |
9504 | equivalents. | |
9505 | <P> | |
9506 | ||
9507 | <DT><CODE>comment-begin</CODE> | |
9508 | <DD><A NAME="IDX305"></A> | |
9509 | The string to insert at the beginning of the line when the | |
9510 | <CODE>insert-comment</CODE> command is executed. The default value | |
9511 | is <CODE>"#"</CODE>. | |
9512 | <P> | |
9513 | ||
9514 | <DT><CODE>completion-ignore-case</CODE> | |
9515 | <DD>If set to <SAMP>`on'</SAMP>, Readline performs filename matching and completion | |
9516 | in a case-insensitive fashion. | |
9517 | The default value is <SAMP>`off'</SAMP>. | |
9518 | <P> | |
9519 | ||
9520 | <DT><CODE>completion-prefix-display-length</CODE> | |
9521 | <DD><A NAME="IDX306"></A> | |
9522 | The length in characters of the common prefix of a list of possible | |
9523 | completions that is displayed without modification. When set to a | |
9524 | value greater than zero, common prefixes longer than this value are | |
9525 | replaced with an ellipsis when displaying possible completions. | |
9526 | <P> | |
9527 | ||
9528 | <DT><CODE>completion-query-items</CODE> | |
9529 | <DD><A NAME="IDX307"></A> | |
9530 | The number of possible completions that determines when the user is | |
9531 | asked whether the list of possibilities should be displayed. | |
9532 | If the number of possible completions is greater than this value, | |
9533 | Readline will ask the user whether or not he wishes to view | |
9534 | them; otherwise, they are simply listed. | |
9535 | This variable must be set to an integer value greater than or equal to 0. | |
9536 | A negative value means Readline should never ask. | |
9537 | The default limit is <CODE>100</CODE>. | |
9538 | <P> | |
9539 | ||
9540 | <DT><CODE>convert-meta</CODE> | |
9541 | <DD><A NAME="IDX308"></A> | |
9542 | If set to <SAMP>`on'</SAMP>, Readline will convert characters with the | |
9543 | eighth bit set to an ASCII key sequence by stripping the eighth | |
9544 | bit and prefixing an <KBD>ESC</KBD> character, converting them to a | |
9545 | meta-prefixed key sequence. The default value is <SAMP>`on'</SAMP>. | |
9546 | <P> | |
9547 | ||
9548 | <DT><CODE>disable-completion</CODE> | |
9549 | <DD><A NAME="IDX309"></A> | |
9550 | If set to <SAMP>`On'</SAMP>, Readline will inhibit word completion. | |
9551 | Completion characters will be inserted into the line as if they had | |
9552 | been mapped to <CODE>self-insert</CODE>. The default is <SAMP>`off'</SAMP>. | |
9553 | <P> | |
9554 | ||
9555 | <DT><CODE>editing-mode</CODE> | |
9556 | <DD><A NAME="IDX310"></A> | |
9557 | The <CODE>editing-mode</CODE> variable controls which default set of | |
9558 | key bindings is used. By default, Readline starts up in Emacs editing | |
9559 | mode, where the keystrokes are most similar to Emacs. This variable can be | |
9560 | set to either <SAMP>`emacs'</SAMP> or <SAMP>`vi'</SAMP>. | |
9561 | <P> | |
9562 | ||
9563 | <DT><CODE>enable-keypad</CODE> | |
9564 | <DD><A NAME="IDX311"></A> | |
9565 | When set to <SAMP>`on'</SAMP>, Readline will try to enable the application | |
9566 | keypad when it is called. Some systems need this to enable the | |
9567 | arrow keys. The default is <SAMP>`off'</SAMP>. | |
9568 | <P> | |
9569 | ||
9570 | <DT><CODE>expand-tilde</CODE> | |
9571 | <DD><A NAME="IDX312"></A> | |
9572 | If set to <SAMP>`on'</SAMP>, tilde expansion is performed when Readline | |
9573 | attempts word completion. The default is <SAMP>`off'</SAMP>. | |
9574 | <P> | |
9575 | ||
9576 | <DT><CODE>history-preserve-point</CODE> | |
9577 | <DD><A NAME="IDX313"></A> | |
9578 | If set to <SAMP>`on'</SAMP>, the history code attempts to place the point (the | |
9579 | current cursor position) at the | |
9580 | same location on each history line retrieved with <CODE>previous-history</CODE> | |
9581 | or <CODE>next-history</CODE>. The default is <SAMP>`off'</SAMP>. | |
9582 | <P> | |
9583 | ||
9584 | <DT><CODE>history-size</CODE> | |
9585 | <DD><A NAME="IDX314"></A> | |
9586 | Set the maximum number of history entries saved in the history list. If | |
9587 | set to zero, the number of entries in the history list is not limited. | |
9588 | <P> | |
9589 | ||
9590 | <DT><CODE>horizontal-scroll-mode</CODE> | |
9591 | <DD><A NAME="IDX315"></A> | |
9592 | This variable can be set to either <SAMP>`on'</SAMP> or <SAMP>`off'</SAMP>. Setting it | |
9593 | to <SAMP>`on'</SAMP> means that the text of the lines being edited will scroll | |
9594 | horizontally on a single screen line when they are longer than the width | |
9595 | of the screen, instead of wrapping onto a new screen line. By default, | |
9596 | this variable is set to <SAMP>`off'</SAMP>. | |
9597 | <P> | |
9598 | ||
9599 | <DT><CODE>input-meta</CODE> | |
9600 | <DD><A NAME="IDX316"></A> | |
9601 | <A NAME="IDX317"></A> | |
9602 | If set to <SAMP>`on'</SAMP>, Readline will enable eight-bit input (it | |
9603 | will not clear the eighth bit in the characters it reads), | |
9604 | regardless of what the terminal claims it can support. The | |
9605 | default value is <SAMP>`off'</SAMP>. The name <CODE>meta-flag</CODE> is a | |
9606 | synonym for this variable. | |
9607 | <P> | |
9608 | ||
9609 | <DT><CODE>isearch-terminators</CODE> | |
9610 | <DD><A NAME="IDX318"></A> | |
9611 | The string of characters that should terminate an incremental search without | |
9612 | subsequently executing the character as a command (see section <A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A>). | |
9613 | If this variable has not been given a value, the characters <KBD>ESC</KBD> and | |
9614 | <KBD>C-J</KBD> will terminate an incremental search. | |
9615 | <P> | |
9616 | ||
9617 | <DT><CODE>keymap</CODE> | |
9618 | <DD><A NAME="IDX319"></A> | |
9619 | Sets Readline's idea of the current keymap for key binding commands. | |
9620 | Acceptable <CODE>keymap</CODE> names are | |
9621 | <CODE>emacs</CODE>, | |
9622 | <CODE>emacs-standard</CODE>, | |
9623 | <CODE>emacs-meta</CODE>, | |
9624 | <CODE>emacs-ctlx</CODE>, | |
9625 | <CODE>vi</CODE>, | |
9626 | <CODE>vi-move</CODE>, | |
9627 | <CODE>vi-command</CODE>, and | |
9628 | <CODE>vi-insert</CODE>. | |
9629 | <CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>; <CODE>emacs</CODE> is | |
9630 | equivalent to <CODE>emacs-standard</CODE>. The default value is <CODE>emacs</CODE>. | |
9631 | The value of the <CODE>editing-mode</CODE> variable also affects the | |
9632 | default keymap. | |
9633 | <P> | |
9634 | ||
9635 | <DT><CODE>mark-directories</CODE> | |
9636 | <DD>If set to <SAMP>`on'</SAMP>, completed directory names have a slash | |
9637 | appended. The default is <SAMP>`on'</SAMP>. | |
9638 | <P> | |
9639 | ||
9640 | <DT><CODE>mark-modified-lines</CODE> | |
9641 | <DD><A NAME="IDX320"></A> | |
9642 | This variable, when set to <SAMP>`on'</SAMP>, causes Readline to display an | |
9643 | asterisk (<SAMP>`*'</SAMP>) at the start of history lines which have been modified. | |
9644 | This variable is <SAMP>`off'</SAMP> by default. | |
9645 | <P> | |
9646 | ||
9647 | <DT><CODE>mark-symlinked-directories</CODE> | |
9648 | <DD><A NAME="IDX321"></A> | |
9649 | If set to <SAMP>`on'</SAMP>, completed names which are symbolic links | |
9650 | to directories have a slash appended (subject to the value of | |
9651 | <CODE>mark-directories</CODE>). | |
9652 | The default is <SAMP>`off'</SAMP>. | |
9653 | <P> | |
9654 | ||
9655 | <DT><CODE>match-hidden-files</CODE> | |
9656 | <DD><A NAME="IDX322"></A> | |
9657 | This variable, when set to <SAMP>`on'</SAMP>, causes Readline to match files whose | |
9658 | names begin with a <SAMP>`.'</SAMP> (hidden files) when performing filename | |
9659 | completion, unless the leading <SAMP>`.'</SAMP> is | |
9660 | supplied by the user in the filename to be completed. | |
9661 | This variable is <SAMP>`on'</SAMP> by default. | |
9662 | <P> | |
9663 | ||
9664 | <DT><CODE>output-meta</CODE> | |
9665 | <DD><A NAME="IDX323"></A> | |
9666 | If set to <SAMP>`on'</SAMP>, Readline will display characters with the | |
9667 | eighth bit set directly rather than as a meta-prefixed escape | |
9668 | sequence. The default is <SAMP>`off'</SAMP>. | |
9669 | <P> | |
9670 | ||
9671 | <DT><CODE>page-completions</CODE> | |
9672 | <DD><A NAME="IDX324"></A> | |
9673 | If set to <SAMP>`on'</SAMP>, Readline uses an internal <CODE>more</CODE>-like pager | |
9674 | to display a screenful of possible completions at a time. | |
9675 | This variable is <SAMP>`on'</SAMP> by default. | |
9676 | <P> | |
9677 | ||
9678 | <DT><CODE>print-completions-horizontally</CODE> | |
9679 | <DD>If set to <SAMP>`on'</SAMP>, Readline will display completions with matches | |
9680 | sorted horizontally in alphabetical order, rather than down the screen. | |
9681 | The default is <SAMP>`off'</SAMP>. | |
9682 | <P> | |
9683 | ||
9684 | <DT><CODE>revert-all-at-newline</CODE> | |
9685 | <DD><A NAME="IDX325"></A> | |
9686 | If set to <SAMP>`on'</SAMP>, Readline will undo all changes to history lines | |
9687 | before returning when <CODE>accept-line</CODE> is executed. By default, | |
9688 | history lines may be modified and retain individual undo lists across | |
9689 | calls to <CODE>readline</CODE>. The default is <SAMP>`off'</SAMP>. | |
9690 | <P> | |
9691 | ||
9692 | <DT><CODE>show-all-if-ambiguous</CODE> | |
9693 | <DD><A NAME="IDX326"></A> | |
9694 | This alters the default behavior of the completion functions. If | |
9695 | set to <SAMP>`on'</SAMP>, | |
9696 | words which have more than one possible completion cause the | |
9697 | matches to be listed immediately instead of ringing the bell. | |
9698 | The default value is <SAMP>`off'</SAMP>. | |
9699 | <P> | |
9700 | ||
9701 | <DT><CODE>show-all-if-unmodified</CODE> | |
9702 | <DD><A NAME="IDX327"></A> | |
9703 | This alters the default behavior of the completion functions in | |
9704 | a fashion similar to <VAR>show-all-if-ambiguous</VAR>. | |
9705 | If set to <SAMP>`on'</SAMP>, | |
9706 | words which have more than one possible completion without any | |
9707 | possible partial completion (the possible completions don't share | |
9708 | a common prefix) cause the matches to be listed immediately instead | |
9709 | of ringing the bell. | |
9710 | The default value is <SAMP>`off'</SAMP>. | |
9711 | <P> | |
9712 | ||
9713 | <DT><CODE>visible-stats</CODE> | |
9714 | <DD><A NAME="IDX328"></A> | |
9715 | If set to <SAMP>`on'</SAMP>, a character denoting a file's type | |
9716 | is appended to the filename when listing possible | |
9717 | completions. The default is <SAMP>`off'</SAMP>. | |
9718 | <P> | |
9719 | ||
9720 | </DL> | |
9721 | <P> | |
9722 | ||
9723 | <DT>Key Bindings | |
9724 | <DD>The syntax for controlling key bindings in the init file is | |
9725 | simple. First you need to find the name of the command that you | |
9726 | want to change. The following sections contain tables of the command | |
9727 | name, the default keybinding, if any, and a short description of what | |
9728 | the command does. | |
9729 | <P> | |
9730 | ||
9731 | Once you know the name of the command, simply place on a line | |
9732 | in the init file the name of the key | |
9733 | you wish to bind the command to, a colon, and then the name of the | |
9734 | command. | |
9735 | There can be no space between the key name and the colon -- that will be | |
9736 | interpreted as part of the key name. | |
9737 | The name of the key can be expressed in different ways, depending on | |
9738 | what you find most comfortable. | |
9739 | </P><P> | |
9740 | ||
9741 | In addition to command names, readline allows keys to be bound | |
9742 | to a string that is inserted when the key is pressed (a <VAR>macro</VAR>). | |
9743 | </P><P> | |
9744 | ||
9745 | The <CODE>bind -p</CODE> command displays Readline function names and | |
9746 | bindings in a format that can put directly into an initialization file. | |
9747 | See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>. | |
9748 | </P><P> | |
9749 | ||
9750 | <DL COMPACT> | |
9751 | <DT><VAR>keyname</VAR>: <VAR>function-name</VAR> or <VAR>macro</VAR> | |
9752 | <DD><VAR>keyname</VAR> is the name of a key spelled out in English. For example: | |
9753 | <TABLE><tr><td> </td><td class=example><pre>Control-u: universal-argument | |
9754 | Meta-Rubout: backward-kill-word | |
9755 | Control-o: "> output" | |
9756 | </pre></td></tr></table><P> | |
9757 | ||
9758 | In the above example, <KBD>C-u</KBD> is bound to the function | |
9759 | <CODE>universal-argument</CODE>, | |
9760 | <KBD>M-DEL</KBD> is bound to the function <CODE>backward-kill-word</CODE>, and | |
9761 | <KBD>C-o</KBD> is bound to run the macro | |
9762 | expressed on the right hand side (that is, to insert the text | |
9763 | <SAMP>`> output'</SAMP> into the line). | |
9764 | </P><P> | |
9765 | ||
9766 | A number of symbolic character names are recognized while | |
9767 | processing this key binding syntax: | |
9768 | <VAR>DEL</VAR>, | |
9769 | <VAR>ESC</VAR>, | |
9770 | <VAR>ESCAPE</VAR>, | |
9771 | <VAR>LFD</VAR>, | |
9772 | <VAR>NEWLINE</VAR>, | |
9773 | <VAR>RET</VAR>, | |
9774 | <VAR>RETURN</VAR>, | |
9775 | <VAR>RUBOUT</VAR>, | |
9776 | <VAR>SPACE</VAR>, | |
9777 | <VAR>SPC</VAR>, | |
9778 | and | |
9779 | <VAR>TAB</VAR>. | |
9780 | </P><P> | |
9781 | ||
9782 | <DT>"<VAR>keyseq</VAR>": <VAR>function-name</VAR> or <VAR>macro</VAR> | |
9783 | <DD><VAR>keyseq</VAR> differs from <VAR>keyname</VAR> above in that strings | |
9784 | denoting an entire key sequence can be specified, by placing | |
9785 | the key sequence in double quotes. Some GNU Emacs style key | |
9786 | escapes can be used, as in the following example, but the | |
9787 | special character names are not recognized. | |
9788 | <P> | |
9789 | ||
9790 | <TABLE><tr><td> </td><td class=example><pre>"\C-u": universal-argument | |
9791 | "\C-x\C-r": re-read-init-file | |
9792 | "\e[11~": "Function Key 1" | |
9793 | </pre></td></tr></table></P><P> | |
9794 | ||
9795 | In the above example, <KBD>C-u</KBD> is again bound to the function | |
9796 | <CODE>universal-argument</CODE> (just as it was in the first example), | |
9797 | <SAMP>`<KBD>C-x</KBD> <KBD>C-r</KBD>'</SAMP> is bound to the function <CODE>re-read-init-file</CODE>, | |
9798 | and <SAMP>`<KBD>ESC</KBD> <KBD>[</KBD> <KBD>1</KBD> <KBD>1</KBD> <KBD>~</KBD>'</SAMP> is bound to insert | |
9799 | the text <SAMP>`Function Key 1'</SAMP>. | |
9800 | </P><P> | |
9801 | ||
9802 | </DL> | |
9803 | <P> | |
9804 | ||
9805 | The following GNU Emacs style escape sequences are available when | |
9806 | specifying key sequences: | |
9807 | </P><P> | |
9808 | ||
9809 | <DL COMPACT> | |
9810 | <DT><CODE><KBD>\C-</KBD></CODE> | |
9811 | <DD>control prefix | |
9812 | <DT><CODE><KBD>\M-</KBD></CODE> | |
9813 | <DD>meta prefix | |
9814 | <DT><CODE><KBD>\e</KBD></CODE> | |
9815 | <DD>an escape character | |
9816 | <DT><CODE><KBD>\\</KBD></CODE> | |
9817 | <DD>backslash | |
9818 | <DT><CODE><KBD>\"</KBD></CODE> | |
9819 | <DD><KBD>"</KBD>, a double quotation mark | |
9820 | <DT><CODE><KBD>\'</KBD></CODE> | |
9821 | <DD><KBD>'</KBD>, a single quote or apostrophe | |
9822 | </DL> | |
9823 | <P> | |
9824 | ||
9825 | In addition to the GNU Emacs style escape sequences, a second | |
9826 | set of backslash escapes is available: | |
9827 | </P><P> | |
9828 | ||
9829 | <DL COMPACT> | |
9830 | <DT><CODE>\a</CODE> | |
9831 | <DD>alert (bell) | |
9832 | <DT><CODE>\b</CODE> | |
9833 | <DD>backspace | |
9834 | <DT><CODE>\d</CODE> | |
9835 | <DD>delete | |
9836 | <DT><CODE>\f</CODE> | |
9837 | <DD>form feed | |
9838 | <DT><CODE>\n</CODE> | |
9839 | <DD>newline | |
9840 | <DT><CODE>\r</CODE> | |
9841 | <DD>carriage return | |
9842 | <DT><CODE>\t</CODE> | |
9843 | <DD>horizontal tab | |
9844 | <DT><CODE>\v</CODE> | |
9845 | <DD>vertical tab | |
9846 | <DT><CODE>\<VAR>nnn</VAR></CODE> | |
9847 | <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR> | |
9848 | (one to three digits) | |
9849 | <DT><CODE>\x<VAR>HH</VAR></CODE> | |
9850 | <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR> | |
9851 | (one or two hex digits) | |
9852 | </DL> | |
9853 | <P> | |
9854 | ||
9855 | When entering the text of a macro, single or double quotes must | |
9856 | be used to indicate a macro definition. | |
9857 | Unquoted text is assumed to be a function name. | |
9858 | In the macro body, the backslash escapes described above are expanded. | |
9859 | Backslash will quote any other character in the macro text, | |
9860 | including <SAMP>`"'</SAMP> and <SAMP>`''</SAMP>. | |
9861 | For example, the following binding will make <SAMP>`<KBD>C-x</KBD> \'</SAMP> | |
9862 | insert a single <SAMP>`\'</SAMP> into the line: | |
9863 | <TABLE><tr><td> </td><td class=example><pre>"\C-x\\": "\\" | |
9864 | </pre></td></tr></table></P><P> | |
9865 | ||
9866 | </DL> | |
9867 | <P> | |
9868 | ||
9869 | <A NAME="Conditional Init Constructs"></A> | |
9870 | <HR SIZE="6"> | |
9871 | <A NAME="SEC105"></A> | |
9872 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9873 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> < </A>]</TD> | |
9874 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> > </A>]</TD> | |
9875 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> << </A>]</TD> | |
9876 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> | |
9877 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD> | |
9878 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9879 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9880 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9881 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9882 | </TR></TABLE> | |
9883 | <H3> 8.3.2 Conditional Init Constructs </H3> | |
9884 | <!--docid::SEC105::--> | |
9885 | <P> | |
9886 | ||
9887 | Readline implements a facility similar in spirit to the conditional | |
9888 | compilation features of the C preprocessor which allows key | |
9889 | bindings and variable settings to be performed as the result | |
9890 | of tests. There are four parser directives used. | |
9891 | </P><P> | |
9892 | ||
9893 | <DL COMPACT> | |
9894 | <DT><CODE>$if</CODE> | |
9895 | <DD>The <CODE>$if</CODE> construct allows bindings to be made based on the | |
9896 | editing mode, the terminal being used, or the application using | |
9897 | Readline. The text of the test extends to the end of the line; | |
9898 | no characters are required to isolate it. | |
9899 | <P> | |
9900 | ||
9901 | <DL COMPACT> | |
9902 | <DT><CODE>mode</CODE> | |
9903 | <DD>The <CODE>mode=</CODE> form of the <CODE>$if</CODE> directive is used to test | |
9904 | whether Readline is in <CODE>emacs</CODE> or <CODE>vi</CODE> mode. | |
9905 | This may be used in conjunction | |
9906 | with the <SAMP>`set keymap'</SAMP> command, for instance, to set bindings in | |
9907 | the <CODE>emacs-standard</CODE> and <CODE>emacs-ctlx</CODE> keymaps only if | |
9908 | Readline is starting out in <CODE>emacs</CODE> mode. | |
9909 | <P> | |
9910 | ||
9911 | <DT><CODE>term</CODE> | |
9912 | <DD>The <CODE>term=</CODE> form may be used to include terminal-specific | |
9913 | key bindings, perhaps to bind the key sequences output by the | |
9914 | terminal's function keys. The word on the right side of the | |
9915 | <SAMP>`='</SAMP> is tested against both the full name of the terminal and | |
9916 | the portion of the terminal name before the first <SAMP>`-'</SAMP>. This | |
9917 | allows <CODE>sun</CODE> to match both <CODE>sun</CODE> and <CODE>sun-cmd</CODE>, | |
9918 | for instance. | |
9919 | <P> | |
9920 | ||
9921 | <DT><CODE>application</CODE> | |
9922 | <DD>The <VAR>application</VAR> construct is used to include | |
9923 | application-specific settings. Each program using the Readline | |
9924 | library sets the <VAR>application name</VAR>, and you can test for | |
9925 | a particular value. | |
9926 | This could be used to bind key sequences to functions useful for | |
9927 | a specific program. For instance, the following command adds a | |
9928 | key sequence that quotes the current or previous word in Bash: | |
9929 | <TABLE><tr><td> </td><td class=example><pre>$if Bash | |
9930 | # Quote the current or previous word | |
9931 | "\C-xq": "\eb\"\ef\"" | |
9932 | $endif | |
9933 | </pre></td></tr></table></DL> | |
9934 | <P> | |
9935 | ||
9936 | <DT><CODE>$endif</CODE> | |
9937 | <DD>This command, as seen in the previous example, terminates an | |
9938 | <CODE>$if</CODE> command. | |
9939 | <P> | |
9940 | ||
9941 | <DT><CODE>$else</CODE> | |
9942 | <DD>Commands in this branch of the <CODE>$if</CODE> directive are executed if | |
9943 | the test fails. | |
9944 | <P> | |
9945 | ||
9946 | <DT><CODE>$include</CODE> | |
9947 | <DD>This directive takes a single filename as an argument and reads commands | |
9948 | and bindings from that file. | |
9949 | For example, the following directive reads from <TT>`/etc/inputrc'</TT>: | |
9950 | <TABLE><tr><td> </td><td class=example><pre>$include /etc/inputrc | |
9951 | </pre></td></tr></table></DL> | |
9952 | <P> | |
9953 | ||
9954 | <A NAME="Sample Init File"></A> | |
9955 | <HR SIZE="6"> | |
9956 | <A NAME="SEC106"></A> | |
9957 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
9958 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> < </A>]</TD> | |
9959 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> > </A>]</TD> | |
9960 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD> | |
9961 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> | |
9962 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD> | |
9963 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
9964 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
9965 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
9966 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
9967 | </TR></TABLE> | |
9968 | <H3> 8.3.3 Sample Init File </H3> | |
9969 | <!--docid::SEC106::--> | |
9970 | <P> | |
9971 | ||
9972 | Here is an example of an <VAR>inputrc</VAR> file. This illustrates key | |
9973 | binding, variable assignment, and conditional syntax. | |
9974 | </P><P> | |
9975 | ||
9976 | <TABLE><tr><td> </td><td class=example><pre># This file controls the behaviour of line input editing for | |
9977 | # programs that use the GNU Readline library. Existing | |
9978 | # programs include FTP, Bash, and GDB. | |
9979 | # | |
9980 | # You can re-read the inputrc file with C-x C-r. | |
9981 | # Lines beginning with '#' are comments. | |
9982 | # | |
9983 | # First, include any systemwide bindings and variable | |
9984 | # assignments from /etc/Inputrc | |
9985 | $include /etc/Inputrc | |
9986 | ||
9987 | # | |
9988 | # Set various bindings for emacs mode. | |
9989 | ||
9990 | set editing-mode emacs | |
9991 | ||
9992 | $if mode=emacs | |
9993 | ||
9994 | Meta-Control-h: backward-kill-word Text after the function name is ignored | |
9995 | ||
9996 | # | |
9997 | # Arrow keys in keypad mode | |
9998 | # | |
9999 | #"\M-OD": backward-char | |
10000 | #"\M-OC": forward-char | |
10001 | #"\M-OA": previous-history | |
10002 | #"\M-OB": next-history | |
10003 | # | |
10004 | # Arrow keys in ANSI mode | |
10005 | # | |
10006 | "\M-[D": backward-char | |
10007 | "\M-[C": forward-char | |
10008 | "\M-[A": previous-history | |
10009 | "\M-[B": next-history | |
10010 | # | |
10011 | # Arrow keys in 8 bit keypad mode | |
10012 | # | |
10013 | #"\M-\C-OD": backward-char | |
10014 | #"\M-\C-OC": forward-char | |
10015 | #"\M-\C-OA": previous-history | |
10016 | #"\M-\C-OB": next-history | |
10017 | # | |
10018 | # Arrow keys in 8 bit ANSI mode | |
10019 | # | |
10020 | #"\M-\C-[D": backward-char | |
10021 | #"\M-\C-[C": forward-char | |
10022 | #"\M-\C-[A": previous-history | |
10023 | #"\M-\C-[B": next-history | |
10024 | ||
10025 | C-q: quoted-insert | |
10026 | ||
10027 | $endif | |
10028 | ||
10029 | # An old-style binding. This happens to be the default. | |
10030 | TAB: complete | |
10031 | ||
10032 | # Macros that are convenient for shell interaction | |
10033 | $if Bash | |
10034 | # edit the path | |
10035 | "\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f" | |
10036 | # prepare to type a quoted word -- | |
10037 | # insert open and close double quotes | |
10038 | # and move to just after the open quote | |
10039 | "\C-x\"": "\"\"\C-b" | |
10040 | # insert a backslash (testing backslash escapes | |
10041 | # in sequences and macros) | |
10042 | "\C-x\\": "\\" | |
10043 | # Quote the current or previous word | |
10044 | "\C-xq": "\eb\"\ef\"" | |
10045 | # Add a binding to refresh the line, which is unbound | |
10046 | "\C-xr": redraw-current-line | |
10047 | # Edit variable on current line. | |
10048 | "\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y=" | |
10049 | $endif | |
10050 | ||
10051 | # use a visible bell if one is available | |
10052 | set bell-style visible | |
10053 | ||
10054 | # don't strip characters to 7 bits when reading | |
10055 | set input-meta on | |
10056 | ||
10057 | # allow iso-latin1 characters to be inserted rather | |
10058 | # than converted to prefix-meta sequences | |
10059 | set convert-meta off | |
10060 | ||
10061 | # display characters with the eighth bit set directly | |
10062 | # rather than as meta-prefixed characters | |
10063 | set output-meta on | |
10064 | ||
10065 | # if there are more than 150 possible completions for | |
10066 | # a word, ask the user if he wants to see all of them | |
10067 | set completion-query-items 150 | |
10068 | ||
10069 | # For FTP | |
10070 | $if Ftp | |
10071 | "\C-xg": "get \M-?" | |
10072 | "\C-xt": "put \M-?" | |
10073 | "\M-.": yank-last-arg | |
10074 | $endif | |
10075 | </pre></td></tr></table></P><P> | |
10076 | ||
10077 | <A NAME="Bindable Readline Commands"></A> | |
10078 | <HR SIZE="6"> | |
10079 | <A NAME="SEC107"></A> | |
10080 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
10081 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> < </A>]</TD> | |
10082 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> > </A>]</TD> | |
10083 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD> | |
10084 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
10085 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10086 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10087 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10088 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10089 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10090 | </TR></TABLE> | |
10091 | <H2> 8.4 Bindable Readline Commands </H2> | |
10092 | <!--docid::SEC107::--> | |
10093 | <P> | |
10094 | ||
10095 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
10096 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the line.</TD></TR> | |
10097 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Getting at previous lines.</TD></TR> | |
10098 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for changing text.</TD></TR> | |
10099 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for killing and yanking.</TD></TR> | |
10100 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying numeric arguments, repeat counts.</TD></TR> | |
10101 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Getting Readline to do the typing for you.</TD></TR> | |
10102 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Saving and re-executing typed characters</TD></TR> | |
10103 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Other miscellaneous commands.</TD></TR> | |
10104 | </TABLE></BLOCKQUOTE> | |
10105 | <P> | |
10106 | ||
10107 | This section describes Readline commands that may be bound to key | |
10108 | sequences. | |
10109 | You can list your key bindings by executing | |
10110 | <CODE>bind -P</CODE> or, for a more terse format, suitable for an | |
10111 | <VAR>inputrc</VAR> file, <CODE>bind -p</CODE>. (See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.) | |
10112 | Command names without an accompanying key sequence are unbound by default. | |
10113 | </P><P> | |
10114 | ||
10115 | In the following descriptions, <EM>point</EM> refers to the current cursor | |
10116 | position, and <EM>mark</EM> refers to a cursor position saved by the | |
10117 | <CODE>set-mark</CODE> command. | |
10118 | The text between the point and mark is referred to as the <EM>region</EM>. | |
10119 | </P><P> | |
10120 | ||
10121 | <A NAME="Commands For Moving"></A> | |
10122 | <HR SIZE="6"> | |
10123 | <A NAME="SEC108"></A> | |
10124 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
10125 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> < </A>]</TD> | |
10126 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> > </A>]</TD> | |
10127 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD> | |
10128 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10129 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10130 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10131 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10132 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10133 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10134 | </TR></TABLE> | |
10135 | <H3> 8.4.1 Commands For Moving </H3> | |
10136 | <!--docid::SEC108::--> | |
10137 | <DL COMPACT> | |
10138 | <A NAME="IDX329"></A> | |
10139 | <DT><CODE>beginning-of-line (C-a)</CODE> | |
10140 | <DD><A NAME="IDX330"></A> | |
10141 | Move to the start of the current line. | |
10142 | <P> | |
10143 | ||
10144 | <A NAME="IDX331"></A> | |
10145 | <DT><CODE>end-of-line (C-e)</CODE> | |
10146 | <DD><A NAME="IDX332"></A> | |
10147 | Move to the end of the line. | |
10148 | <P> | |
10149 | ||
10150 | <A NAME="IDX333"></A> | |
10151 | <DT><CODE>forward-char (C-f)</CODE> | |
10152 | <DD><A NAME="IDX334"></A> | |
10153 | Move forward a character. | |
10154 | <P> | |
10155 | ||
10156 | <A NAME="IDX335"></A> | |
10157 | <DT><CODE>backward-char (C-b)</CODE> | |
10158 | <DD><A NAME="IDX336"></A> | |
10159 | Move back a character. | |
10160 | <P> | |
10161 | ||
10162 | <A NAME="IDX337"></A> | |
10163 | <DT><CODE>forward-word (M-f)</CODE> | |
10164 | <DD><A NAME="IDX338"></A> | |
10165 | Move forward to the end of the next word. | |
10166 | Words are composed of letters and digits. | |
10167 | <P> | |
10168 | ||
10169 | <A NAME="IDX339"></A> | |
10170 | <DT><CODE>backward-word (M-b)</CODE> | |
10171 | <DD><A NAME="IDX340"></A> | |
10172 | Move back to the start of the current or previous word. | |
10173 | Words are composed of letters and digits. | |
10174 | <P> | |
10175 | ||
10176 | <A NAME="IDX341"></A> | |
10177 | <DT><CODE>shell-forward-word ()</CODE> | |
10178 | <DD><A NAME="IDX342"></A> | |
10179 | Move forward to the end of the next word. | |
10180 | Words are delimited by non-quoted shell metacharacters. | |
10181 | <P> | |
10182 | ||
10183 | <A NAME="IDX343"></A> | |
10184 | <DT><CODE>shell-backward-word ()</CODE> | |
10185 | <DD><A NAME="IDX344"></A> | |
10186 | Move back to the start of the current or previous word. | |
10187 | Words are delimited by non-quoted shell metacharacters. | |
10188 | <P> | |
10189 | ||
10190 | <A NAME="IDX345"></A> | |
10191 | <DT><CODE>clear-screen (C-l)</CODE> | |
10192 | <DD><A NAME="IDX346"></A> | |
10193 | Clear the screen and redraw the current line, | |
10194 | leaving the current line at the top of the screen. | |
10195 | <P> | |
10196 | ||
10197 | <A NAME="IDX347"></A> | |
10198 | <DT><CODE>redraw-current-line ()</CODE> | |
10199 | <DD><A NAME="IDX348"></A> | |
10200 | Refresh the current line. By default, this is unbound. | |
10201 | <P> | |
10202 | ||
10203 | </DL> | |
10204 | <P> | |
10205 | ||
10206 | <A NAME="Commands For History"></A> | |
10207 | <HR SIZE="6"> | |
10208 | <A NAME="SEC109"></A> | |
10209 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
10210 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> < </A>]</TD> | |
10211 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> > </A>]</TD> | |
10212 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> << </A>]</TD> | |
10213 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10214 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10215 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10216 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10217 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10218 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10219 | </TR></TABLE> | |
10220 | <H3> 8.4.2 Commands For Manipulating The History </H3> | |
10221 | <!--docid::SEC109::--> | |
10222 | <P> | |
10223 | ||
10224 | <DL COMPACT> | |
10225 | <A NAME="IDX349"></A> | |
10226 | <DT><CODE>accept-line (Newline or Return)</CODE> | |
10227 | <DD><A NAME="IDX350"></A> | |
10228 | Accept the line regardless of where the cursor is. | |
10229 | If this line is | |
10230 | non-empty, add it to the history list according to the setting of | |
10231 | the <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> variables. | |
10232 | If this line is a modified history line, then restore the history line | |
10233 | to its original state. | |
10234 | <P> | |
10235 | ||
10236 | <A NAME="IDX351"></A> | |
10237 | <DT><CODE>previous-history (C-p)</CODE> | |
10238 | <DD><A NAME="IDX352"></A> | |
10239 | Move `back' through the history list, fetching the previous command. | |
10240 | <P> | |
10241 | ||
10242 | <A NAME="IDX353"></A> | |
10243 | <DT><CODE>next-history (C-n)</CODE> | |
10244 | <DD><A NAME="IDX354"></A> | |
10245 | Move `forward' through the history list, fetching the next command. | |
10246 | <P> | |
10247 | ||
10248 | <A NAME="IDX355"></A> | |
10249 | <DT><CODE>beginning-of-history (M-<)</CODE> | |
10250 | <DD><A NAME="IDX356"></A> | |
10251 | Move to the first line in the history. | |
10252 | <P> | |
10253 | ||
10254 | <A NAME="IDX357"></A> | |
10255 | <DT><CODE>end-of-history (M->)</CODE> | |
10256 | <DD><A NAME="IDX358"></A> | |
10257 | Move to the end of the input history, i.e., the line currently | |
10258 | being entered. | |
10259 | <P> | |
10260 | ||
10261 | <A NAME="IDX359"></A> | |
10262 | <DT><CODE>reverse-search-history (C-r)</CODE> | |
10263 | <DD><A NAME="IDX360"></A> | |
10264 | Search backward starting at the current line and moving `up' through | |
10265 | the history as necessary. This is an incremental search. | |
10266 | <P> | |
10267 | ||
10268 | <A NAME="IDX361"></A> | |
10269 | <DT><CODE>forward-search-history (C-s)</CODE> | |
10270 | <DD><A NAME="IDX362"></A> | |
10271 | Search forward starting at the current line and moving `down' through | |
10272 | the the history as necessary. This is an incremental search. | |
10273 | <P> | |
10274 | ||
10275 | <A NAME="IDX363"></A> | |
10276 | <DT><CODE>non-incremental-reverse-search-history (M-p)</CODE> | |
10277 | <DD><A NAME="IDX364"></A> | |
10278 | Search backward starting at the current line and moving `up' | |
10279 | through the history as necessary using a non-incremental search | |
10280 | for a string supplied by the user. | |
10281 | <P> | |
10282 | ||
10283 | <A NAME="IDX365"></A> | |
10284 | <DT><CODE>non-incremental-forward-search-history (M-n)</CODE> | |
10285 | <DD><A NAME="IDX366"></A> | |
10286 | Search forward starting at the current line and moving `down' | |
10287 | through the the history as necessary using a non-incremental search | |
10288 | for a string supplied by the user. | |
10289 | <P> | |
10290 | ||
10291 | <A NAME="IDX367"></A> | |
10292 | <DT><CODE>history-search-forward ()</CODE> | |
10293 | <DD><A NAME="IDX368"></A> | |
10294 | Search forward through the history for the string of characters | |
10295 | between the start of the current line and the point. | |
10296 | This is a non-incremental search. | |
10297 | By default, this command is unbound. | |
10298 | <P> | |
10299 | ||
10300 | <A NAME="IDX369"></A> | |
10301 | <DT><CODE>history-search-backward ()</CODE> | |
10302 | <DD><A NAME="IDX370"></A> | |
10303 | Search backward through the history for the string of characters | |
10304 | between the start of the current line and the point. This | |
10305 | is a non-incremental search. By default, this command is unbound. | |
10306 | <P> | |
10307 | ||
10308 | <A NAME="IDX371"></A> | |
10309 | <DT><CODE>yank-nth-arg (M-C-y)</CODE> | |
10310 | <DD><A NAME="IDX372"></A> | |
10311 | Insert the first argument to the previous command (usually | |
10312 | the second word on the previous line) at point. | |
10313 | With an argument <VAR>n</VAR>, | |
10314 | insert the <VAR>n</VAR>th word from the previous command (the words | |
10315 | in the previous command begin with word 0). A negative argument | |
10316 | inserts the <VAR>n</VAR>th word from the end of the previous command. | |
10317 | Once the argument <VAR>n</VAR> is computed, the argument is extracted | |
10318 | as if the <SAMP>`!<VAR>n</VAR>'</SAMP> history expansion had been specified. | |
10319 | <P> | |
10320 | ||
10321 | <A NAME="IDX373"></A> | |
10322 | <DT><CODE>yank-last-arg (M-. or M-_)</CODE> | |
10323 | <DD><A NAME="IDX374"></A> | |
10324 | Insert last argument to the previous command (the last word of the | |
10325 | previous history entry). With an | |
10326 | argument, behave exactly like <CODE>yank-nth-arg</CODE>. | |
10327 | Successive calls to <CODE>yank-last-arg</CODE> move back through the history | |
10328 | list, inserting the last argument of each line in turn. | |
10329 | The history expansion facilities are used to extract the last argument, | |
10330 | as if the <SAMP>`!$'</SAMP> history expansion had been specified. | |
10331 | <P> | |
10332 | ||
10333 | </DL> | |
10334 | <P> | |
10335 | ||
10336 | <A NAME="Commands For Text"></A> | |
10337 | <HR SIZE="6"> | |
10338 | <A NAME="SEC110"></A> | |
10339 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
10340 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> < </A>]</TD> | |
10341 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> > </A>]</TD> | |
10342 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> << </A>]</TD> | |
10343 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10344 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10345 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10346 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10347 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10348 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10349 | </TR></TABLE> | |
10350 | <H3> 8.4.3 Commands For Changing Text </H3> | |
10351 | <!--docid::SEC110::--> | |
10352 | <P> | |
10353 | ||
10354 | <DL COMPACT> | |
10355 | <A NAME="IDX375"></A> | |
10356 | <DT><CODE>delete-char (C-d)</CODE> | |
10357 | <DD><A NAME="IDX376"></A> | |
10358 | Delete the character at point. If point is at the | |
10359 | beginning of the line, there are no characters in the line, and | |
10360 | the last character typed was not bound to <CODE>delete-char</CODE>, then | |
10361 | return EOF. | |
10362 | <P> | |
10363 | ||
10364 | <A NAME="IDX377"></A> | |
10365 | <DT><CODE>backward-delete-char (Rubout)</CODE> | |
10366 | <DD><A NAME="IDX378"></A> | |
10367 | Delete the character behind the cursor. A numeric argument means | |
10368 | to kill the characters instead of deleting them. | |
10369 | <P> | |
10370 | ||
10371 | <A NAME="IDX379"></A> | |
10372 | <DT><CODE>forward-backward-delete-char ()</CODE> | |
10373 | <DD><A NAME="IDX380"></A> | |
10374 | Delete the character under the cursor, unless the cursor is at the | |
10375 | end of the line, in which case the character behind the cursor is | |
10376 | deleted. By default, this is not bound to a key. | |
10377 | <P> | |
10378 | ||
10379 | <A NAME="IDX381"></A> | |
10380 | <DT><CODE>quoted-insert (C-q or C-v)</CODE> | |
10381 | <DD><A NAME="IDX382"></A> | |
10382 | Add the next character typed to the line verbatim. This is | |
10383 | how to insert key sequences like <KBD>C-q</KBD>, for example. | |
10384 | <P> | |
10385 | ||
10386 | <A NAME="IDX383"></A> | |
10387 | <DT><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE> | |
10388 | <DD><A NAME="IDX384"></A> | |
10389 | Insert yourself. | |
10390 | <P> | |
10391 | ||
10392 | <A NAME="IDX385"></A> | |
10393 | <DT><CODE>transpose-chars (C-t)</CODE> | |
10394 | <DD><A NAME="IDX386"></A> | |
10395 | Drag the character before the cursor forward over | |
10396 | the character at the cursor, moving the | |
10397 | cursor forward as well. If the insertion point | |
10398 | is at the end of the line, then this | |
10399 | transposes the last two characters of the line. | |
10400 | Negative arguments have no effect. | |
10401 | <P> | |
10402 | ||
10403 | <A NAME="IDX387"></A> | |
10404 | <DT><CODE>transpose-words (M-t)</CODE> | |
10405 | <DD><A NAME="IDX388"></A> | |
10406 | Drag the word before point past the word after point, | |
10407 | moving point past that word as well. | |
10408 | If the insertion point is at the end of the line, this transposes | |
10409 | the last two words on the line. | |
10410 | <P> | |
10411 | ||
10412 | <A NAME="IDX389"></A> | |
10413 | <DT><CODE>upcase-word (M-u)</CODE> | |
10414 | <DD><A NAME="IDX390"></A> | |
10415 | Uppercase the current (or following) word. With a negative argument, | |
10416 | uppercase the previous word, but do not move the cursor. | |
10417 | <P> | |
10418 | ||
10419 | <A NAME="IDX391"></A> | |
10420 | <DT><CODE>downcase-word (M-l)</CODE> | |
10421 | <DD><A NAME="IDX392"></A> | |
10422 | Lowercase the current (or following) word. With a negative argument, | |
10423 | lowercase the previous word, but do not move the cursor. | |
10424 | <P> | |
10425 | ||
10426 | <A NAME="IDX393"></A> | |
10427 | <DT><CODE>capitalize-word (M-c)</CODE> | |
10428 | <DD><A NAME="IDX394"></A> | |
10429 | Capitalize the current (or following) word. With a negative argument, | |
10430 | capitalize the previous word, but do not move the cursor. | |
10431 | <P> | |
10432 | ||
10433 | <A NAME="IDX395"></A> | |
10434 | <DT><CODE>overwrite-mode ()</CODE> | |
10435 | <DD><A NAME="IDX396"></A> | |
10436 | Toggle overwrite mode. With an explicit positive numeric argument, | |
10437 | switches to overwrite mode. With an explicit non-positive numeric | |
10438 | argument, switches to insert mode. This command affects only | |
10439 | <CODE>emacs</CODE> mode; <CODE>vi</CODE> mode does overwrite differently. | |
10440 | Each call to <CODE>readline()</CODE> starts in insert mode. | |
10441 | <P> | |
10442 | ||
10443 | In overwrite mode, characters bound to <CODE>self-insert</CODE> replace | |
10444 | the text at point rather than pushing the text to the right. | |
10445 | Characters bound to <CODE>backward-delete-char</CODE> replace the character | |
10446 | before point with a space. | |
10447 | </P><P> | |
10448 | ||
10449 | By default, this command is unbound. | |
10450 | </P><P> | |
10451 | ||
10452 | </DL> | |
10453 | <P> | |
10454 | ||
10455 | <A NAME="Commands For Killing"></A> | |
10456 | <HR SIZE="6"> | |
10457 | <A NAME="SEC111"></A> | |
10458 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
10459 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> < </A>]</TD> | |
10460 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> > </A>]</TD> | |
10461 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> << </A>]</TD> | |
10462 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10463 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10464 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10465 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10466 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10467 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10468 | </TR></TABLE> | |
10469 | <H3> 8.4.4 Killing And Yanking </H3> | |
10470 | <!--docid::SEC111::--> | |
10471 | <P> | |
10472 | ||
10473 | <DL COMPACT> | |
10474 | ||
10475 | <A NAME="IDX397"></A> | |
10476 | <DT><CODE>kill-line (C-k)</CODE> | |
10477 | <DD><A NAME="IDX398"></A> | |
10478 | Kill the text from point to the end of the line. | |
10479 | <P> | |
10480 | ||
10481 | <A NAME="IDX399"></A> | |
10482 | <DT><CODE>backward-kill-line (C-x Rubout)</CODE> | |
10483 | <DD><A NAME="IDX400"></A> | |
10484 | Kill backward to the beginning of the line. | |
10485 | <P> | |
10486 | ||
10487 | <A NAME="IDX401"></A> | |
10488 | <DT><CODE>unix-line-discard (C-u)</CODE> | |
10489 | <DD><A NAME="IDX402"></A> | |
10490 | Kill backward from the cursor to the beginning of the current line. | |
10491 | <P> | |
10492 | ||
10493 | <A NAME="IDX403"></A> | |
10494 | <DT><CODE>kill-whole-line ()</CODE> | |
10495 | <DD><A NAME="IDX404"></A> | |
10496 | Kill all characters on the current line, no matter where point is. | |
10497 | By default, this is unbound. | |
10498 | <P> | |
10499 | ||
10500 | <A NAME="IDX405"></A> | |
10501 | <DT><CODE>kill-word (M-d)</CODE> | |
10502 | <DD><A NAME="IDX406"></A> | |
10503 | Kill from point to the end of the current word, or if between | |
10504 | words, to the end of the next word. | |
10505 | Word boundaries are the same as <CODE>forward-word</CODE>. | |
10506 | <P> | |
10507 | ||
10508 | <A NAME="IDX407"></A> | |
10509 | <DT><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE> | |
10510 | <DD><A NAME="IDX408"></A> | |
10511 | Kill the word behind point. | |
10512 | Word boundaries are the same as <CODE>backward-word</CODE>. | |
10513 | <P> | |
10514 | ||
10515 | <A NAME="IDX409"></A> | |
10516 | <DT><CODE>shell-kill-word ()</CODE> | |
10517 | <DD><A NAME="IDX410"></A> | |
10518 | Kill from point to the end of the current word, or if between | |
10519 | words, to the end of the next word. | |
10520 | Word boundaries are the same as <CODE>shell-forward-word</CODE>. | |
10521 | <P> | |
10522 | ||
10523 | <A NAME="IDX411"></A> | |
10524 | <DT><CODE>backward-kill-word ()</CODE> | |
10525 | <DD><A NAME="IDX412"></A> | |
10526 | Kill the word behind point. | |
10527 | Word boundaries are the same as <CODE>shell-backward-word</CODE>. | |
10528 | <P> | |
10529 | ||
10530 | <A NAME="IDX413"></A> | |
10531 | <DT><CODE>unix-word-rubout (C-w)</CODE> | |
10532 | <DD><A NAME="IDX414"></A> | |
10533 | Kill the word behind point, using white space as a word boundary. | |
10534 | The killed text is saved on the kill-ring. | |
10535 | <P> | |
10536 | ||
10537 | <A NAME="IDX415"></A> | |
10538 | <DT><CODE>unix-filename-rubout ()</CODE> | |
10539 | <DD><A NAME="IDX416"></A> | |
10540 | Kill the word behind point, using white space and the slash character | |
10541 | as the word boundaries. | |
10542 | The killed text is saved on the kill-ring. | |
10543 | <P> | |
10544 | ||
10545 | <A NAME="IDX417"></A> | |
10546 | <DT><CODE>delete-horizontal-space ()</CODE> | |
10547 | <DD><A NAME="IDX418"></A> | |
10548 | Delete all spaces and tabs around point. By default, this is unbound. | |
10549 | <P> | |
10550 | ||
10551 | <A NAME="IDX419"></A> | |
10552 | <DT><CODE>kill-region ()</CODE> | |
10553 | <DD><A NAME="IDX420"></A> | |
10554 | Kill the text in the current region. | |
10555 | By default, this command is unbound. | |
10556 | <P> | |
10557 | ||
10558 | <A NAME="IDX421"></A> | |
10559 | <DT><CODE>copy-region-as-kill ()</CODE> | |
10560 | <DD><A NAME="IDX422"></A> | |
10561 | Copy the text in the region to the kill buffer, so it can be yanked | |
10562 | right away. By default, this command is unbound. | |
10563 | <P> | |
10564 | ||
10565 | <A NAME="IDX423"></A> | |
10566 | <DT><CODE>copy-backward-word ()</CODE> | |
10567 | <DD><A NAME="IDX424"></A> | |
10568 | Copy the word before point to the kill buffer. | |
10569 | The word boundaries are the same as <CODE>backward-word</CODE>. | |
10570 | By default, this command is unbound. | |
10571 | <P> | |
10572 | ||
10573 | <A NAME="IDX425"></A> | |
10574 | <DT><CODE>copy-forward-word ()</CODE> | |
10575 | <DD><A NAME="IDX426"></A> | |
10576 | Copy the word following point to the kill buffer. | |
10577 | The word boundaries are the same as <CODE>forward-word</CODE>. | |
10578 | By default, this command is unbound. | |
10579 | <P> | |
10580 | ||
10581 | <A NAME="IDX427"></A> | |
10582 | <DT><CODE>yank (C-y)</CODE> | |
10583 | <DD><A NAME="IDX428"></A> | |
10584 | Yank the top of the kill ring into the buffer at point. | |
10585 | <P> | |
10586 | ||
10587 | <A NAME="IDX429"></A> | |
10588 | <DT><CODE>yank-pop (M-y)</CODE> | |
10589 | <DD><A NAME="IDX430"></A> | |
10590 | Rotate the kill-ring, and yank the new top. You can only do this if | |
10591 | the prior command is <CODE>yank</CODE> or <CODE>yank-pop</CODE>. | |
10592 | </DL> | |
10593 | <P> | |
10594 | ||
10595 | <A NAME="Numeric Arguments"></A> | |
10596 | <HR SIZE="6"> | |
10597 | <A NAME="SEC112"></A> | |
10598 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
10599 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> < </A>]</TD> | |
10600 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> > </A>]</TD> | |
10601 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> << </A>]</TD> | |
10602 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10603 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10604 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10605 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10606 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10607 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10608 | </TR></TABLE> | |
10609 | <H3> 8.4.5 Specifying Numeric Arguments </H3> | |
10610 | <!--docid::SEC112::--> | |
10611 | <DL COMPACT> | |
10612 | ||
10613 | <A NAME="IDX431"></A> | |
10614 | <DT><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE> | |
10615 | <DD><A NAME="IDX432"></A> | |
10616 | Add this digit to the argument already accumulating, or start a new | |
10617 | argument. <KBD>M--</KBD> starts a negative argument. | |
10618 | <P> | |
10619 | ||
10620 | <A NAME="IDX433"></A> | |
10621 | <DT><CODE>universal-argument ()</CODE> | |
10622 | <DD><A NAME="IDX434"></A> | |
10623 | This is another way to specify an argument. | |
10624 | If this command is followed by one or more digits, optionally with a | |
10625 | leading minus sign, those digits define the argument. | |
10626 | If the command is followed by digits, executing <CODE>universal-argument</CODE> | |
10627 | again ends the numeric argument, but is otherwise ignored. | |
10628 | As a special case, if this command is immediately followed by a | |
10629 | character that is neither a digit or minus sign, the argument count | |
10630 | for the next command is multiplied by four. | |
10631 | The argument count is initially one, so executing this function the | |
10632 | first time makes the argument count four, a second time makes the | |
10633 | argument count sixteen, and so on. | |
10634 | By default, this is not bound to a key. | |
10635 | </DL> | |
10636 | <P> | |
10637 | ||
10638 | <A NAME="Commands For Completion"></A> | |
10639 | <HR SIZE="6"> | |
10640 | <A NAME="SEC113"></A> | |
10641 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
10642 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> < </A>]</TD> | |
10643 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> > </A>]</TD> | |
10644 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> << </A>]</TD> | |
10645 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10646 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10647 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10648 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10649 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10650 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10651 | </TR></TABLE> | |
10652 | <H3> 8.4.6 Letting Readline Type For You </H3> | |
10653 | <!--docid::SEC113::--> | |
10654 | <P> | |
10655 | ||
10656 | <DL COMPACT> | |
10657 | <A NAME="IDX435"></A> | |
10658 | <DT><CODE>complete (<KBD>TAB</KBD>)</CODE> | |
10659 | <DD><A NAME="IDX436"></A> | |
10660 | Attempt to perform completion on the text before point. | |
10661 | The actual completion performed is application-specific. | |
10662 | Bash attempts completion treating the text as a variable (if the | |
10663 | text begins with <SAMP>`$'</SAMP>), username (if the text begins with | |
10664 | <SAMP>`~'</SAMP>), hostname (if the text begins with <SAMP>`@'</SAMP>), or | |
10665 | command (including aliases and functions) in turn. If none | |
10666 | of these produces a match, filename completion is attempted. | |
10667 | <P> | |
10668 | ||
10669 | <A NAME="IDX437"></A> | |
10670 | <DT><CODE>possible-completions (M-?)</CODE> | |
10671 | <DD><A NAME="IDX438"></A> | |
10672 | List the possible completions of the text before point. | |
10673 | <P> | |
10674 | ||
10675 | <A NAME="IDX439"></A> | |
10676 | <DT><CODE>insert-completions (M-*)</CODE> | |
10677 | <DD><A NAME="IDX440"></A> | |
10678 | Insert all completions of the text before point that would have | |
10679 | been generated by <CODE>possible-completions</CODE>. | |
10680 | <P> | |
10681 | ||
10682 | <A NAME="IDX441"></A> | |
10683 | <DT><CODE>menu-complete ()</CODE> | |
10684 | <DD><A NAME="IDX442"></A> | |
10685 | Similar to <CODE>complete</CODE>, but replaces the word to be completed | |
10686 | with a single match from the list of possible completions. | |
10687 | Repeated execution of <CODE>menu-complete</CODE> steps through the list | |
10688 | of possible completions, inserting each match in turn. | |
10689 | At the end of the list of completions, the bell is rung | |
10690 | (subject to the setting of <CODE>bell-style</CODE>) | |
10691 | and the original text is restored. | |
10692 | An argument of <VAR>n</VAR> moves <VAR>n</VAR> positions forward in the list | |
10693 | of matches; a negative argument may be used to move backward | |
10694 | through the list. | |
10695 | This command is intended to be bound to <KBD>TAB</KBD>, but is unbound | |
10696 | by default. | |
10697 | <P> | |
10698 | ||
10699 | <A NAME="IDX443"></A> | |
10700 | <DT><CODE>delete-char-or-list ()</CODE> | |
10701 | <DD><A NAME="IDX444"></A> | |
10702 | Deletes the character under the cursor if not at the beginning or | |
10703 | end of the line (like <CODE>delete-char</CODE>). | |
10704 | If at the end of the line, behaves identically to | |
10705 | <CODE>possible-completions</CODE>. | |
10706 | This command is unbound by default. | |
10707 | <P> | |
10708 | ||
10709 | <A NAME="IDX445"></A> | |
10710 | <DT><CODE>complete-filename (M-/)</CODE> | |
10711 | <DD><A NAME="IDX446"></A> | |
10712 | Attempt filename completion on the text before point. | |
10713 | <P> | |
10714 | ||
10715 | <A NAME="IDX447"></A> | |
10716 | <DT><CODE>possible-filename-completions (C-x /)</CODE> | |
10717 | <DD><A NAME="IDX448"></A> | |
10718 | List the possible completions of the text before point, | |
10719 | treating it as a filename. | |
10720 | <P> | |
10721 | ||
10722 | <A NAME="IDX449"></A> | |
10723 | <DT><CODE>complete-username (M-~)</CODE> | |
10724 | <DD><A NAME="IDX450"></A> | |
10725 | Attempt completion on the text before point, treating | |
10726 | it as a username. | |
10727 | <P> | |
10728 | ||
10729 | <A NAME="IDX451"></A> | |
10730 | <DT><CODE>possible-username-completions (C-x ~)</CODE> | |
10731 | <DD><A NAME="IDX452"></A> | |
10732 | List the possible completions of the text before point, | |
10733 | treating it as a username. | |
10734 | <P> | |
10735 | ||
10736 | <A NAME="IDX453"></A> | |
10737 | <DT><CODE>complete-variable (M-$)</CODE> | |
10738 | <DD><A NAME="IDX454"></A> | |
10739 | Attempt completion on the text before point, treating | |
10740 | it as a shell variable. | |
10741 | <P> | |
10742 | ||
10743 | <A NAME="IDX455"></A> | |
10744 | <DT><CODE>possible-variable-completions (C-x $)</CODE> | |
10745 | <DD><A NAME="IDX456"></A> | |
10746 | List the possible completions of the text before point, | |
10747 | treating it as a shell variable. | |
10748 | <P> | |
10749 | ||
10750 | <A NAME="IDX457"></A> | |
10751 | <DT><CODE>complete-hostname (M-@)</CODE> | |
10752 | <DD><A NAME="IDX458"></A> | |
10753 | Attempt completion on the text before point, treating | |
10754 | it as a hostname. | |
10755 | <P> | |
10756 | ||
10757 | <A NAME="IDX459"></A> | |
10758 | <DT><CODE>possible-hostname-completions (C-x @)</CODE> | |
10759 | <DD><A NAME="IDX460"></A> | |
10760 | List the possible completions of the text before point, | |
10761 | treating it as a hostname. | |
10762 | <P> | |
10763 | ||
10764 | <A NAME="IDX461"></A> | |
10765 | <DT><CODE>complete-command (M-!)</CODE> | |
10766 | <DD><A NAME="IDX462"></A> | |
10767 | Attempt completion on the text before point, treating | |
10768 | it as a command name. Command completion attempts to | |
10769 | match the text against aliases, reserved words, shell | |
10770 | functions, shell builtins, and finally executable filenames, | |
10771 | in that order. | |
10772 | <P> | |
10773 | ||
10774 | <A NAME="IDX463"></A> | |
10775 | <DT><CODE>possible-command-completions (C-x !)</CODE> | |
10776 | <DD><A NAME="IDX464"></A> | |
10777 | List the possible completions of the text before point, | |
10778 | treating it as a command name. | |
10779 | <P> | |
10780 | ||
10781 | <A NAME="IDX465"></A> | |
10782 | <DT><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE> | |
10783 | <DD><A NAME="IDX466"></A> | |
10784 | Attempt completion on the text before point, comparing | |
10785 | the text against lines from the history list for possible | |
10786 | completion matches. | |
10787 | <P> | |
10788 | ||
10789 | <A NAME="IDX467"></A> | |
10790 | <DT><CODE>dabbrev-expand ()</CODE> | |
10791 | <DD><A NAME="IDX468"></A> | |
10792 | Attempt menu completion on the text before point, comparing | |
10793 | the text against lines from the history list for possible | |
10794 | completion matches. | |
10795 | <P> | |
10796 | ||
10797 | <A NAME="IDX469"></A> | |
10798 | <DT><CODE>complete-into-braces (M-{)</CODE> | |
10799 | <DD><A NAME="IDX470"></A> | |
10800 | Perform filename completion and insert the list of possible completions | |
10801 | enclosed within braces so the list is available to the shell | |
10802 | (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>). | |
10803 | <P> | |
10804 | ||
10805 | </DL> | |
10806 | <P> | |
10807 | ||
10808 | <A NAME="Keyboard Macros"></A> | |
10809 | <HR SIZE="6"> | |
10810 | <A NAME="SEC114"></A> | |
10811 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
10812 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> < </A>]</TD> | |
10813 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> > </A>]</TD> | |
10814 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> << </A>]</TD> | |
10815 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10816 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10817 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10818 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10819 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10820 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10821 | </TR></TABLE> | |
10822 | <H3> 8.4.7 Keyboard Macros </H3> | |
10823 | <!--docid::SEC114::--> | |
10824 | <DL COMPACT> | |
10825 | ||
10826 | <A NAME="IDX471"></A> | |
10827 | <DT><CODE>start-kbd-macro (C-x ()</CODE> | |
10828 | <DD><A NAME="IDX472"></A> | |
10829 | Begin saving the characters typed into the current keyboard macro. | |
10830 | <P> | |
10831 | ||
10832 | <A NAME="IDX473"></A> | |
10833 | <DT><CODE>end-kbd-macro (C-x ))</CODE> | |
10834 | <DD><A NAME="IDX474"></A> | |
10835 | Stop saving the characters typed into the current keyboard macro | |
10836 | and save the definition. | |
10837 | <P> | |
10838 | ||
10839 | <A NAME="IDX475"></A> | |
10840 | <DT><CODE>call-last-kbd-macro (C-x e)</CODE> | |
10841 | <DD><A NAME="IDX476"></A> | |
10842 | Re-execute the last keyboard macro defined, by making the characters | |
10843 | in the macro appear as if typed at the keyboard. | |
10844 | <P> | |
10845 | ||
10846 | </DL> | |
10847 | <P> | |
10848 | ||
10849 | <A NAME="Miscellaneous Commands"></A> | |
10850 | <HR SIZE="6"> | |
10851 | <A NAME="SEC115"></A> | |
10852 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
10853 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> < </A>]</TD> | |
10854 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> > </A>]</TD> | |
10855 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD> | |
10856 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD> | |
10857 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD> | |
10858 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
10859 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
10860 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
10861 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
10862 | </TR></TABLE> | |
10863 | <H3> 8.4.8 Some Miscellaneous Commands </H3> | |
10864 | <!--docid::SEC115::--> | |
10865 | <DL COMPACT> | |
10866 | ||
10867 | <A NAME="IDX477"></A> | |
10868 | <DT><CODE>re-read-init-file (C-x C-r)</CODE> | |
10869 | <DD><A NAME="IDX478"></A> | |
10870 | Read in the contents of the <VAR>inputrc</VAR> file, and incorporate | |
10871 | any bindings or variable assignments found there. | |
10872 | <P> | |
10873 | ||
10874 | <A NAME="IDX479"></A> | |
10875 | <DT><CODE>abort (C-g)</CODE> | |
10876 | <DD><A NAME="IDX480"></A> | |
10877 | Abort the current editing command and | |
10878 | ring the terminal's bell (subject to the setting of | |
10879 | <CODE>bell-style</CODE>). | |
10880 | <P> | |
10881 | ||
10882 | <A NAME="IDX481"></A> | |
10883 | <DT><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE> | |
10884 | <DD><A NAME="IDX482"></A> | |
10885 | If the metafied character <VAR>x</VAR> is lowercase, run the command | |
10886 | that is bound to the corresponding uppercase character. | |
10887 | <P> | |
10888 | ||
10889 | <A NAME="IDX483"></A> | |
10890 | <DT><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE> | |
10891 | <DD><A NAME="IDX484"></A> | |
10892 | Metafy the next character typed. This is for keyboards | |
10893 | without a meta key. Typing <SAMP>`<KBD>ESC</KBD> f'</SAMP> is equivalent to typing | |
10894 | <KBD>M-f</KBD>. | |
10895 | <P> | |
10896 | ||
10897 | <A NAME="IDX485"></A> | |
10898 | <DT><CODE>undo (C-_ or C-x C-u)</CODE> | |
10899 | <DD><A NAME="IDX486"></A> | |
10900 | Incremental undo, separately remembered for each line. | |
10901 | <P> | |
10902 | ||
10903 | <A NAME="IDX487"></A> | |
10904 | <DT><CODE>revert-line (M-r)</CODE> | |
10905 | <DD><A NAME="IDX488"></A> | |
10906 | Undo all changes made to this line. This is like executing the <CODE>undo</CODE> | |
10907 | command enough times to get back to the beginning. | |
10908 | <P> | |
10909 | ||
10910 | <A NAME="IDX489"></A> | |
10911 | <DT><CODE>tilde-expand (M-&)</CODE> | |
10912 | <DD><A NAME="IDX490"></A> | |
10913 | Perform tilde expansion on the current word. | |
10914 | <P> | |
10915 | ||
10916 | <A NAME="IDX491"></A> | |
10917 | <DT><CODE>set-mark (C-@)</CODE> | |
10918 | <DD><A NAME="IDX492"></A> | |
10919 | Set the mark to the point. If a | |
10920 | numeric argument is supplied, the mark is set to that position. | |
10921 | <P> | |
10922 | ||
10923 | <A NAME="IDX493"></A> | |
10924 | <DT><CODE>exchange-point-and-mark (C-x C-x)</CODE> | |
10925 | <DD><A NAME="IDX494"></A> | |
10926 | Swap the point with the mark. The current cursor position is set to | |
10927 | the saved position, and the old cursor position is saved as the mark. | |
10928 | <P> | |
10929 | ||
10930 | <A NAME="IDX495"></A> | |
10931 | <DT><CODE>character-search (C-])</CODE> | |
10932 | <DD><A NAME="IDX496"></A> | |
10933 | A character is read and point is moved to the next occurrence of that | |
10934 | character. A negative count searches for previous occurrences. | |
10935 | <P> | |
10936 | ||
10937 | <A NAME="IDX497"></A> | |
10938 | <DT><CODE>character-search-backward (M-C-])</CODE> | |
10939 | <DD><A NAME="IDX498"></A> | |
10940 | A character is read and point is moved to the previous occurrence | |
10941 | of that character. A negative count searches for subsequent | |
10942 | occurrences. | |
10943 | <P> | |
10944 | ||
10945 | <A NAME="IDX499"></A> | |
10946 | <DT><CODE>insert-comment (M-#)</CODE> | |
10947 | <DD><A NAME="IDX500"></A> | |
10948 | Without a numeric argument, the value of the <CODE>comment-begin</CODE> | |
10949 | variable is inserted at the beginning of the current line. | |
10950 | If a numeric argument is supplied, this command acts as a toggle: if | |
10951 | the characters at the beginning of the line do not match the value | |
10952 | of <CODE>comment-begin</CODE>, the value is inserted, otherwise | |
10953 | the characters in <CODE>comment-begin</CODE> are deleted from the beginning of | |
10954 | the line. | |
10955 | In either case, the line is accepted as if a newline had been typed. | |
10956 | The default value of <CODE>comment-begin</CODE> causes this command | |
10957 | to make the current line a shell comment. | |
10958 | If a numeric argument causes the comment character to be removed, the line | |
10959 | will be executed by the shell. | |
10960 | <P> | |
10961 | ||
10962 | <A NAME="IDX501"></A> | |
10963 | <DT><CODE>dump-functions ()</CODE> | |
10964 | <DD><A NAME="IDX502"></A> | |
10965 | Print all of the functions and their key bindings to the | |
10966 | Readline output stream. If a numeric argument is supplied, | |
10967 | the output is formatted in such a way that it can be made part | |
10968 | of an <VAR>inputrc</VAR> file. This command is unbound by default. | |
10969 | <P> | |
10970 | ||
10971 | <A NAME="IDX503"></A> | |
10972 | <DT><CODE>dump-variables ()</CODE> | |
10973 | <DD><A NAME="IDX504"></A> | |
10974 | Print all of the settable variables and their values to the | |
10975 | Readline output stream. If a numeric argument is supplied, | |
10976 | the output is formatted in such a way that it can be made part | |
10977 | of an <VAR>inputrc</VAR> file. This command is unbound by default. | |
10978 | <P> | |
10979 | ||
10980 | <A NAME="IDX505"></A> | |
10981 | <DT><CODE>dump-macros ()</CODE> | |
10982 | <DD><A NAME="IDX506"></A> | |
10983 | Print all of the Readline key sequences bound to macros and the | |
10984 | strings they output. If a numeric argument is supplied, | |
10985 | the output is formatted in such a way that it can be made part | |
10986 | of an <VAR>inputrc</VAR> file. This command is unbound by default. | |
10987 | <P> | |
10988 | ||
10989 | <A NAME="IDX507"></A> | |
10990 | <DT><CODE>glob-complete-word (M-g)</CODE> | |
10991 | <DD><A NAME="IDX508"></A> | |
10992 | The word before point is treated as a pattern for pathname expansion, | |
10993 | with an asterisk implicitly appended. This pattern is used to | |
10994 | generate a list of matching file names for possible completions. | |
10995 | <P> | |
10996 | ||
10997 | <A NAME="IDX509"></A> | |
10998 | <DT><CODE>glob-expand-word (C-x *)</CODE> | |
10999 | <DD><A NAME="IDX510"></A> | |
11000 | The word before point is treated as a pattern for pathname expansion, | |
11001 | and the list of matching file names is inserted, replacing the word. | |
11002 | If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before | |
11003 | pathname expansion. | |
11004 | <P> | |
11005 | ||
11006 | <A NAME="IDX511"></A> | |
11007 | <DT><CODE>glob-list-expansions (C-x g)</CODE> | |
11008 | <DD><A NAME="IDX512"></A> | |
11009 | The list of expansions that would have been generated by | |
11010 | <CODE>glob-expand-word</CODE> is displayed, and the line is redrawn. | |
11011 | If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before | |
11012 | pathname expansion. | |
11013 | <P> | |
11014 | ||
11015 | <A NAME="IDX513"></A> | |
11016 | <DT><CODE>display-shell-version (C-x C-v)</CODE> | |
11017 | <DD><A NAME="IDX514"></A> | |
11018 | Display version information about the current instance of Bash. | |
11019 | <P> | |
11020 | ||
11021 | <A NAME="IDX515"></A> | |
11022 | <DT><CODE>shell-expand-line (M-C-e)</CODE> | |
11023 | <DD><A NAME="IDX516"></A> | |
11024 | Expand the line as the shell does. | |
11025 | This performs alias and history expansion as well as all of the shell | |
11026 | word expansions (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>). | |
11027 | <P> | |
11028 | ||
11029 | <A NAME="IDX517"></A> | |
11030 | <DT><CODE>history-expand-line (M-^)</CODE> | |
11031 | <DD><A NAME="IDX518"></A> | |
11032 | Perform history expansion on the current line. | |
11033 | <P> | |
11034 | ||
11035 | <A NAME="IDX519"></A> | |
11036 | <DT><CODE>magic-space ()</CODE> | |
11037 | <DD><A NAME="IDX520"></A> | |
11038 | Perform history expansion on the current line and insert a space | |
11039 | (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>). | |
11040 | <P> | |
11041 | ||
11042 | <A NAME="IDX521"></A> | |
11043 | <DT><CODE>alias-expand-line ()</CODE> | |
11044 | <DD><A NAME="IDX522"></A> | |
11045 | Perform alias expansion on the current line (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>). | |
11046 | <P> | |
11047 | ||
11048 | <A NAME="IDX523"></A> | |
11049 | <DT><CODE>history-and-alias-expand-line ()</CODE> | |
11050 | <DD><A NAME="IDX524"></A> | |
11051 | Perform history and alias expansion on the current line. | |
11052 | <P> | |
11053 | ||
11054 | <A NAME="IDX525"></A> | |
11055 | <DT><CODE>insert-last-argument (M-. or M-_)</CODE> | |
11056 | <DD><A NAME="IDX526"></A> | |
11057 | A synonym for <CODE>yank-last-arg</CODE>. | |
11058 | <P> | |
11059 | ||
11060 | <A NAME="IDX527"></A> | |
11061 | <DT><CODE>operate-and-get-next (C-o)</CODE> | |
11062 | <DD><A NAME="IDX528"></A> | |
11063 | Accept the current line for execution and fetch the next line | |
11064 | relative to the current line from the history for editing. Any | |
11065 | argument is ignored. | |
11066 | <P> | |
11067 | ||
11068 | <A NAME="IDX529"></A> | |
11069 | <DT><CODE>edit-and-execute-command (C-xC-e)</CODE> | |
11070 | <DD><A NAME="IDX530"></A> | |
11071 | Invoke an editor on the current command line, and execute the result as shell | |
11072 | commands. | |
11073 | Bash attempts to invoke | |
11074 | <CODE>$VISUAL</CODE>, <CODE>$EDITOR</CODE>, and <CODE>emacs</CODE> | |
11075 | as the editor, in that order. | |
11076 | <P> | |
11077 | ||
11078 | </DL> | |
11079 | <P> | |
11080 | ||
11081 | <A NAME="Readline vi Mode"></A> | |
11082 | <HR SIZE="6"> | |
11083 | <A NAME="SEC116"></A> | |
11084 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
11085 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> < </A>]</TD> | |
11086 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> > </A>]</TD> | |
11087 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> << </A>]</TD> | |
11088 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
11089 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
11090 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11091 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11092 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11093 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11094 | </TR></TABLE> | |
11095 | <H2> 8.5 Readline vi Mode </H2> | |
11096 | <!--docid::SEC116::--> | |
11097 | <P> | |
11098 | ||
11099 | While the Readline library does not have a full set of <CODE>vi</CODE> | |
11100 | editing functions, it does contain enough to allow simple editing | |
11101 | of the line. The Readline <CODE>vi</CODE> mode behaves as specified in | |
11102 | the POSIX 1003.2 standard. | |
11103 | </P><P> | |
11104 | ||
11105 | In order to switch interactively between <CODE>emacs</CODE> and <CODE>vi</CODE> | |
11106 | editing modes, use the <SAMP>`set -o emacs'</SAMP> and <SAMP>`set -o vi'</SAMP> | |
11107 | commands (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
11108 | The Readline default is <CODE>emacs</CODE> mode. | |
11109 | </P><P> | |
11110 | ||
11111 | When you enter a line in <CODE>vi</CODE> mode, you are already placed in | |
11112 | `insertion' mode, as if you had typed an <SAMP>`i'</SAMP>. Pressing <KBD>ESC</KBD> | |
11113 | switches you into `command' mode, where you can edit the text of the | |
11114 | line with the standard <CODE>vi</CODE> movement keys, move to previous | |
11115 | history lines with <SAMP>`k'</SAMP> and subsequent lines with <SAMP>`j'</SAMP>, and | |
11116 | so forth. | |
11117 | </P><P> | |
11118 | ||
11119 | <A NAME="Programmable Completion"></A> | |
11120 | <HR SIZE="6"> | |
11121 | <A NAME="SEC117"></A> | |
11122 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
11123 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> < </A>]</TD> | |
11124 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> > </A>]</TD> | |
11125 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> << </A>]</TD> | |
11126 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
11127 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
11128 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11129 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11130 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11131 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11132 | </TR></TABLE> | |
11133 | <H2> 8.6 Programmable Completion </H2> | |
11134 | <!--docid::SEC117::--> | |
11135 | <P> | |
11136 | ||
11137 | When word completion is attempted for an argument to a command for | |
11138 | which a completion specification (a <VAR>compspec</VAR>) has been defined | |
11139 | using the <CODE>complete</CODE> builtin (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>), | |
11140 | the programmable completion facilities are invoked. | |
11141 | </P><P> | |
11142 | ||
11143 | First, the command name is identified. | |
11144 | If a compspec has been defined for that command, the | |
11145 | compspec is used to generate the list of possible completions for the word. | |
11146 | If the command word is a full pathname, a compspec for the full | |
11147 | pathname is searched for first. | |
11148 | If no compspec is found for the full pathname, an attempt is made to | |
11149 | find a compspec for the portion following the final slash. | |
11150 | </P><P> | |
11151 | ||
11152 | Once a compspec has been found, it is used to generate the list of | |
11153 | matching words. | |
11154 | If a compspec is not found, the default Bash completion | |
11155 | described above (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>) is performed. | |
11156 | </P><P> | |
11157 | ||
11158 | First, the actions specified by the compspec are used. | |
11159 | Only matches which are prefixed by the word being completed are | |
11160 | returned. | |
11161 | When the <SAMP>`-f'</SAMP> or <SAMP>`-d'</SAMP> option is used for filename or | |
11162 | directory name completion, the shell variable <CODE>FIGNORE</CODE> is | |
11163 | used to filter the matches. | |
11164 | See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>. | |
11165 | </P><P> | |
11166 | ||
11167 | Any completions specified by a filename expansion pattern to the | |
11168 | <SAMP>`-G'</SAMP> option are generated next. | |
11169 | The words generated by the pattern need not match the word being completed. | |
11170 | The <CODE>GLOBIGNORE</CODE> shell variable is not used to filter the matches, | |
11171 | but the <CODE>FIGNORE</CODE> shell variable is used. | |
11172 | </P><P> | |
11173 | ||
11174 | Next, the string specified as the argument to the <SAMP>`-W'</SAMP> option | |
11175 | is considered. | |
11176 | The string is first split using the characters in the <CODE>IFS</CODE> | |
11177 | special variable as delimiters. | |
11178 | Shell quoting is honored. | |
11179 | Each word is then expanded using | |
11180 | brace expansion, tilde expansion, parameter and variable expansion, | |
11181 | command substitution, and arithmetic expansion, | |
11182 | as described above (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>). | |
11183 | The results are split using the rules described above | |
11184 | (see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>). | |
11185 | The results of the expansion are prefix-matched against the word being | |
11186 | completed, and the matching words become the possible completions. | |
11187 | </P><P> | |
11188 | ||
11189 | After these matches have been generated, any shell function or command | |
11190 | specified with the <SAMP>`-F'</SAMP> and <SAMP>`-C'</SAMP> options is invoked. | |
11191 | When the command or function is invoked, the <CODE>COMP_LINE</CODE>, | |
11192 | <CODE>COMP_POINT</CODE>, <CODE>COMP_KEY</CODE>, and <CODE>COMP_TYPE</CODE> variables are | |
11193 | assigned values as described above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
11194 | If a shell function is being invoked, the <CODE>COMP_WORDS</CODE> and | |
11195 | <CODE>COMP_CWORD</CODE> variables are also set. | |
11196 | When the function or command is invoked, the first argument is the | |
11197 | name of the command whose arguments are being completed, the | |
11198 | second argument is the word being completed, and the third argument | |
11199 | is the word preceding the word being completed on the current command line. | |
11200 | No filtering of the generated completions against the word being completed | |
11201 | is performed; the function or command has complete freedom in generating | |
11202 | the matches. | |
11203 | </P><P> | |
11204 | ||
11205 | Any function specified with <SAMP>`-F'</SAMP> is invoked first. | |
11206 | The function may use any of the shell facilities, including the | |
11207 | <CODE>compgen</CODE> and <CODE>compopt</CODE> builtins described below | |
11208 | (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>), to generate the matches. | |
11209 | It must put the possible completions in the <CODE>COMPREPLY</CODE> array | |
11210 | variable. | |
11211 | </P><P> | |
11212 | ||
11213 | Next, any command specified with the <SAMP>`-C'</SAMP> option is invoked | |
11214 | in an environment equivalent to command substitution. | |
11215 | It should print a list of completions, one per line, to | |
11216 | the standard output. | |
11217 | Backslash may be used to escape a newline, if necessary. | |
11218 | </P><P> | |
11219 | ||
11220 | After all of the possible completions are generated, any filter | |
11221 | specified with the <SAMP>`-X'</SAMP> option is applied to the list. | |
11222 | The filter is a pattern as used for pathname expansion; a <SAMP>`&'</SAMP> | |
11223 | in the pattern is replaced with the text of the word being completed. | |
11224 | A literal <SAMP>`&'</SAMP> may be escaped with a backslash; the backslash | |
11225 | is removed before attempting a match. | |
11226 | Any completion that matches the pattern will be removed from the list. | |
11227 | A leading <SAMP>`!'</SAMP> negates the pattern; in this case any completion | |
11228 | not matching the pattern will be removed. | |
11229 | </P><P> | |
11230 | ||
11231 | Finally, any prefix and suffix specified with the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> | |
11232 | options are added to each member of the completion list, and the result is | |
11233 | returned to the Readline completion code as the list of possible | |
11234 | completions. | |
11235 | </P><P> | |
11236 | ||
11237 | If the previously-applied actions do not generate any matches, and the | |
11238 | <SAMP>`-o dirnames'</SAMP> option was supplied to <CODE>complete</CODE> when the | |
11239 | compspec was defined, directory name completion is attempted. | |
11240 | </P><P> | |
11241 | ||
11242 | If the <SAMP>`-o plusdirs'</SAMP> option was supplied to <CODE>complete</CODE> when | |
11243 | the compspec was defined, directory name completion is attempted and any | |
11244 | matches are added to the results of the other actions. | |
11245 | </P><P> | |
11246 | ||
11247 | By default, if a compspec is found, whatever it generates is returned to | |
11248 | the completion code as the full set of possible completions. | |
11249 | The default Bash completions are not attempted, and the Readline default | |
11250 | of filename completion is disabled. | |
11251 | If the <SAMP>`-o bashdefault'</SAMP> option was supplied to <CODE>complete</CODE> when | |
11252 | the compspec was defined, the default Bash completions are attempted | |
11253 | if the compspec generates no matches. | |
11254 | If the <SAMP>`-o default'</SAMP> option was supplied to <CODE>complete</CODE> when the | |
11255 | compspec was defined, Readline's default completion will be performed | |
11256 | if the compspec (and, if attempted, the default Bash completions) | |
11257 | generate no matches. | |
11258 | </P><P> | |
11259 | ||
11260 | When a compspec indicates that directory name completion is desired, | |
11261 | the programmable completion functions force Readline to append a slash | |
11262 | to completed names which are symbolic links to directories, subject to | |
11263 | the value of the <VAR>mark-directories</VAR> Readline variable, regardless | |
11264 | of the setting of the <VAR>mark-symlinked-directories</VAR> Readline variable. | |
11265 | </P><P> | |
11266 | ||
11267 | <A NAME="Programmable Completion Builtins"></A> | |
11268 | <HR SIZE="6"> | |
11269 | <A NAME="SEC118"></A> | |
11270 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
11271 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> < </A>]</TD> | |
11272 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> > </A>]</TD> | |
11273 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD> | |
11274 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD> | |
11275 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD> | |
11276 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11277 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11278 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11279 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11280 | </TR></TABLE> | |
11281 | <H2> 8.7 Programmable Completion Builtins </H2> | |
11282 | <!--docid::SEC118::--> | |
11283 | <P> | |
11284 | ||
11285 | Two builtin commands are available to manipulate the programmable completion | |
11286 | facilities. | |
11287 | </P><P> | |
11288 | ||
11289 | <DL COMPACT> | |
11290 | <DT><CODE>compgen</CODE> | |
11291 | <DD><A NAME="IDX531"></A> | |
11292 | <TABLE><tr><td> </td><td class=example><pre><CODE>compgen [<VAR>option</VAR>] [<VAR>word</VAR>]</CODE> | |
11293 | </pre></td></tr></table><P> | |
11294 | ||
11295 | Generate possible completion matches for <VAR>word</VAR> according to | |
11296 | the <VAR>option</VAR>s, which may be any option accepted by the | |
11297 | <CODE>complete</CODE> | |
11298 | builtin with the exception of <SAMP>`-p'</SAMP> and <SAMP>`-r'</SAMP>, and write | |
11299 | the matches to the standard output. | |
11300 | When using the <SAMP>`-F'</SAMP> or <SAMP>`-C'</SAMP> options, the various shell variables | |
11301 | set by the programmable completion facilities, while available, will not | |
11302 | have useful values. | |
11303 | </P><P> | |
11304 | ||
11305 | The matches will be generated in the same way as if the programmable | |
11306 | completion code had generated them directly from a completion specification | |
11307 | with the same flags. | |
11308 | If <VAR>word</VAR> is specified, only those completions matching <VAR>word</VAR> | |
11309 | will be displayed. | |
11310 | </P><P> | |
11311 | ||
11312 | The return value is true unless an invalid option is supplied, or no | |
11313 | matches were generated. | |
11314 | </P><P> | |
11315 | ||
11316 | <DT><CODE>complete</CODE> | |
11317 | <DD><A NAME="IDX532"></A> | |
11318 | <TABLE><tr><td> </td><td class=example><pre><CODE>complete [-abcdefgjksuv] [-o <VAR>comp-option</VAR>] [-E] [-A <VAR>action</VAR>] [-G <VAR>globpat</VAR>] [-W <VAR>wordlist</VAR>] | |
11319 | [-F <VAR>function</VAR>] [-C <VAR>command</VAR>] [-X <VAR>filterpat</VAR>] | |
11320 | [-P <VAR>prefix</VAR>] [-S <VAR>suffix</VAR>] <VAR>name</VAR> [<VAR>name</VAR> <small>...</small>]</CODE> | |
11321 | <CODE>complete -pr [-E] [<VAR>name</VAR> <small>...</small>]</CODE> | |
11322 | </pre></td></tr></table><P> | |
11323 | ||
11324 | Specify how arguments to each <VAR>name</VAR> should be completed. | |
11325 | If the <SAMP>`-p'</SAMP> option is supplied, or if no options are supplied, existing | |
11326 | completion specifications are printed in a way that allows them to be | |
11327 | reused as input. | |
11328 | The <SAMP>`-r'</SAMP> option removes a completion specification for | |
11329 | each <VAR>name</VAR>, or, if no <VAR>name</VAR>s are supplied, all | |
11330 | completion specifications. | |
11331 | The <SAMP>`-E'</SAMP> option indicates that the remaining options and actions should | |
11332 | apply to "empty" command completion; that is, completion attempted on a | |
11333 | blank line. | |
11334 | </P><P> | |
11335 | ||
11336 | The process of applying these completion specifications when word completion | |
11337 | is attempted is described above (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
11338 | </P><P> | |
11339 | ||
11340 | Other options, if specified, have the following meanings. | |
11341 | The arguments to the <SAMP>`-G'</SAMP>, <SAMP>`-W'</SAMP>, and <SAMP>`-X'</SAMP> options | |
11342 | (and, if necessary, the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> options) | |
11343 | should be quoted to protect them from expansion before the | |
11344 | <CODE>complete</CODE> builtin is invoked. | |
11345 | </P><P> | |
11346 | ||
11347 | <DL COMPACT> | |
11348 | <DT><CODE>-o <VAR>comp-option</VAR></CODE> | |
11349 | <DD>The <VAR>comp-option</VAR> controls several aspects of the compspec's behavior | |
11350 | beyond the simple generation of completions. | |
11351 | <VAR>comp-option</VAR> may be one of: | |
11352 | <P> | |
11353 | ||
11354 | <DL COMPACT> | |
11355 | ||
11356 | <DT><CODE>bashdefault</CODE> | |
11357 | <DD>Perform the rest of the default Bash completions if the compspec | |
11358 | generates no matches. | |
11359 | <P> | |
11360 | ||
11361 | <DT><CODE>default</CODE> | |
11362 | <DD>Use Readline's default filename completion if the compspec generates | |
11363 | no matches. | |
11364 | <P> | |
11365 | ||
11366 | <DT><CODE>dirnames</CODE> | |
11367 | <DD>Perform directory name completion if the compspec generates no matches. | |
11368 | <P> | |
11369 | ||
11370 | <DT><CODE>filenames</CODE> | |
11371 | <DD>Tell Readline that the compspec generates filenames, so it can perform any | |
11372 | filename-specific processing (like adding a slash to directory names | |
11373 | quoting special characters, or suppressing trailing spaces). | |
11374 | This option is intended to be used with shell functions specified | |
11375 | with <SAMP>`-F'</SAMP>. | |
11376 | <P> | |
11377 | ||
11378 | <DT><CODE>nospace</CODE> | |
11379 | <DD>Tell Readline not to append a space (the default) to words completed at | |
11380 | the end of the line. | |
11381 | <P> | |
11382 | ||
11383 | <DT><CODE>plusdirs</CODE> | |
11384 | <DD>After any matches defined by the compspec are generated, | |
11385 | directory name completion is attempted and any | |
11386 | matches are added to the results of the other actions. | |
11387 | <P> | |
11388 | ||
11389 | </DL> | |
11390 | <P> | |
11391 | ||
11392 | <DT><CODE>-A <VAR>action</VAR></CODE> | |
11393 | <DD>The <VAR>action</VAR> may be one of the following to generate a list of possible | |
11394 | completions: | |
11395 | <P> | |
11396 | ||
11397 | <DL COMPACT> | |
11398 | <DT><CODE>alias</CODE> | |
11399 | <DD>Alias names. May also be specified as <SAMP>`-a'</SAMP>. | |
11400 | <P> | |
11401 | ||
11402 | <DT><CODE>arrayvar</CODE> | |
11403 | <DD>Array variable names. | |
11404 | <P> | |
11405 | ||
11406 | <DT><CODE>binding</CODE> | |
11407 | <DD>Readline key binding names (see section <A HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A>). | |
11408 | <P> | |
11409 | ||
11410 | <DT><CODE>builtin</CODE> | |
11411 | <DD>Names of shell builtin commands. May also be specified as <SAMP>`-b'</SAMP>. | |
11412 | <P> | |
11413 | ||
11414 | <DT><CODE>command</CODE> | |
11415 | <DD>Command names. May also be specified as <SAMP>`-c'</SAMP>. | |
11416 | <P> | |
11417 | ||
11418 | <DT><CODE>directory</CODE> | |
11419 | <DD>Directory names. May also be specified as <SAMP>`-d'</SAMP>. | |
11420 | <P> | |
11421 | ||
11422 | <DT><CODE>disabled</CODE> | |
11423 | <DD>Names of disabled shell builtins. | |
11424 | <P> | |
11425 | ||
11426 | <DT><CODE>enabled</CODE> | |
11427 | <DD>Names of enabled shell builtins. | |
11428 | <P> | |
11429 | ||
11430 | <DT><CODE>export</CODE> | |
11431 | <DD>Names of exported shell variables. May also be specified as <SAMP>`-e'</SAMP>. | |
11432 | <P> | |
11433 | ||
11434 | <DT><CODE>file</CODE> | |
11435 | <DD>File names. May also be specified as <SAMP>`-f'</SAMP>. | |
11436 | <P> | |
11437 | ||
11438 | <DT><CODE>function</CODE> | |
11439 | <DD>Names of shell functions. | |
11440 | <P> | |
11441 | ||
11442 | <DT><CODE>group</CODE> | |
11443 | <DD>Group names. May also be specified as <SAMP>`-g'</SAMP>. | |
11444 | <P> | |
11445 | ||
11446 | <DT><CODE>helptopic</CODE> | |
11447 | <DD>Help topics as accepted by the <CODE>help</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
11448 | <P> | |
11449 | ||
11450 | <DT><CODE>hostname</CODE> | |
11451 | <DD>Hostnames, as taken from the file specified by the | |
11452 | <CODE>HOSTFILE</CODE> shell variable (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). | |
11453 | <P> | |
11454 | ||
11455 | <DT><CODE>job</CODE> | |
11456 | <DD>Job names, if job control is active. May also be specified as <SAMP>`-j'</SAMP>. | |
11457 | <P> | |
11458 | ||
11459 | <DT><CODE>keyword</CODE> | |
11460 | <DD>Shell reserved words. May also be specified as <SAMP>`-k'</SAMP>. | |
11461 | <P> | |
11462 | ||
11463 | <DT><CODE>running</CODE> | |
11464 | <DD>Names of running jobs, if job control is active. | |
11465 | <P> | |
11466 | ||
11467 | <DT><CODE>service</CODE> | |
11468 | <DD>Service names. May also be specified as <SAMP>`-s'</SAMP>. | |
11469 | <P> | |
11470 | ||
11471 | <DT><CODE>setopt</CODE> | |
11472 | <DD>Valid arguments for the <SAMP>`-o'</SAMP> option to the <CODE>set</CODE> builtin | |
11473 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
11474 | <P> | |
11475 | ||
11476 | <DT><CODE>shopt</CODE> | |
11477 | <DD>Shell option names as accepted by the <CODE>shopt</CODE> builtin | |
11478 | (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
11479 | <P> | |
11480 | ||
11481 | <DT><CODE>signal</CODE> | |
11482 | <DD>Signal names. | |
11483 | <P> | |
11484 | ||
11485 | <DT><CODE>stopped</CODE> | |
11486 | <DD>Names of stopped jobs, if job control is active. | |
11487 | <P> | |
11488 | ||
11489 | <DT><CODE>user</CODE> | |
11490 | <DD>User names. May also be specified as <SAMP>`-u'</SAMP>. | |
11491 | <P> | |
11492 | ||
11493 | <DT><CODE>variable</CODE> | |
11494 | <DD>Names of all shell variables. May also be specified as <SAMP>`-v'</SAMP>. | |
11495 | </DL> | |
11496 | <P> | |
11497 | ||
11498 | <DT><CODE>-G <VAR>globpat</VAR></CODE> | |
11499 | <DD>The filename expansion pattern <VAR>globpat</VAR> is expanded to generate | |
11500 | the possible completions. | |
11501 | <P> | |
11502 | ||
11503 | <DT><CODE>-W <VAR>wordlist</VAR></CODE> | |
11504 | <DD>The <VAR>wordlist</VAR> is split using the characters in the | |
11505 | <CODE>IFS</CODE> special variable as delimiters, and each resultant word | |
11506 | is expanded. | |
11507 | The possible completions are the members of the resultant list which | |
11508 | match the word being completed. | |
11509 | <P> | |
11510 | ||
11511 | <DT><CODE>-C <VAR>command</VAR></CODE> | |
11512 | <DD><VAR>command</VAR> is executed in a subshell environment, and its output is | |
11513 | used as the possible completions. | |
11514 | <P> | |
11515 | ||
11516 | <DT><CODE>-F <VAR>function</VAR></CODE> | |
11517 | <DD>The shell function <VAR>function</VAR> is executed in the current shell | |
11518 | environment. | |
11519 | When it finishes, the possible completions are retrieved from the value | |
11520 | of the <CODE>COMPREPLY</CODE> array variable. | |
11521 | <P> | |
11522 | ||
11523 | <DT><CODE>-X <VAR>filterpat</VAR></CODE> | |
11524 | <DD><VAR>filterpat</VAR> is a pattern as used for filename expansion. | |
11525 | It is applied to the list of possible completions generated by the | |
11526 | preceding options and arguments, and each completion matching | |
11527 | <VAR>filterpat</VAR> is removed from the list. | |
11528 | A leading <SAMP>`!'</SAMP> in <VAR>filterpat</VAR> negates the pattern; in this | |
11529 | case, any completion not matching <VAR>filterpat</VAR> is removed. | |
11530 | <P> | |
11531 | ||
11532 | <DT><CODE>-P <VAR>prefix</VAR></CODE> | |
11533 | <DD><VAR>prefix</VAR> is added at the beginning of each possible completion | |
11534 | after all other options have been applied. | |
11535 | <P> | |
11536 | ||
11537 | <DT><CODE>-S <VAR>suffix</VAR></CODE> | |
11538 | <DD><VAR>suffix</VAR> is appended to each possible completion | |
11539 | after all other options have been applied. | |
11540 | </DL> | |
11541 | <P> | |
11542 | ||
11543 | The return value is true unless an invalid option is supplied, an option | |
11544 | other than <SAMP>`-p'</SAMP> or <SAMP>`-r'</SAMP> is supplied without a <VAR>name</VAR> | |
11545 | argument, an attempt is made to remove a completion specification for | |
11546 | a <VAR>name</VAR> for which no specification exists, or | |
11547 | an error occurs adding a completion specification. | |
11548 | </P><P> | |
11549 | ||
11550 | <DT><CODE>compopt</CODE> | |
11551 | <DD><A NAME="IDX533"></A> | |
11552 | <TABLE><tr><td> </td><td class=example><pre><CODE>compopt</CODE> [-o <VAR>option</VAR>] [+o <VAR>option</VAR>] [<VAR>name</VAR>] | |
11553 | </pre></td></tr></table>Modify completion options for each <VAR>name</VAR> according to the | |
11554 | <VAR>option</VAR>s, or for the currently-execution completion if no <VAR>name</VAR>s | |
11555 | are supplied. | |
11556 | If no <VAR>option</VAR>s are given, display the completion options for each | |
11557 | <VAR>name</VAR> or the current completion. | |
11558 | The possible values of <VAR>option</VAR> are those valid for the <CODE>complete</CODE> | |
11559 | builtin described above. | |
11560 | <P> | |
11561 | ||
11562 | The return value is true unless an invalid option is supplied, an attempt | |
11563 | is made to modify the options for a <VAR>name</VAR> for which no completion | |
11564 | specification exists, or an output error occurs. | |
11565 | </P><P> | |
11566 | ||
11567 | </DL> | |
11568 | <P> | |
11569 | ||
11570 | <A NAME="IDX534"></A> | |
11571 | </P><P> | |
11572 | ||
11573 | <A NAME="Using History Interactively"></A> | |
11574 | <HR SIZE="6"> | |
11575 | <A NAME="SEC119"></A> | |
11576 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
11577 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> < </A>]</TD> | |
11578 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> > </A>]</TD> | |
11579 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
11580 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
11581 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
11582 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11583 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11584 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11585 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11586 | </TR></TABLE> | |
11587 | <H1> 9. Using History Interactively </H1> | |
11588 | <!--docid::SEC119::--> | |
11589 | <P> | |
11590 | ||
11591 | This chapter describes how to use the GNU History Library | |
11592 | interactively, from a user's standpoint. | |
11593 | It should be considered a user's guide. | |
11594 | For information on using the GNU History Library in other programs, | |
11595 | see the GNU Readline Library Manual. | |
11596 | </P><P> | |
11597 | ||
11598 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
11599 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash lets you manipulate your command | |
11600 | history.</TD></TR> | |
11601 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The Bash builtin commands that manipulate | |
11602 | the command history.</TD></TR> | |
11603 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC122">9.3 History Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What it feels like using History as a user.</TD></TR> | |
11604 | </TABLE></BLOCKQUOTE> | |
11605 | <P> | |
11606 | ||
11607 | <A NAME="Bash History Facilities"></A> | |
11608 | <HR SIZE="6"> | |
11609 | <A NAME="SEC120"></A> | |
11610 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
11611 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> < </A>]</TD> | |
11612 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> > </A>]</TD> | |
11613 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
11614 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD> | |
11615 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
11616 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11617 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11618 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11619 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11620 | </TR></TABLE> | |
11621 | <H2> 9.1 Bash History Facilities </H2> | |
11622 | <!--docid::SEC120::--> | |
11623 | <P> | |
11624 | ||
11625 | When the <SAMP>`-o history'</SAMP> option to the <CODE>set</CODE> builtin | |
11626 | is enabled (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), | |
11627 | the shell provides access to the <EM>command history</EM>, | |
11628 | the list of commands previously typed. | |
11629 | The value of the <CODE>HISTSIZE</CODE> shell variable is used as the | |
11630 | number of commands to save in a history list. | |
11631 | The text of the last <CODE>$HISTSIZE</CODE> | |
11632 | commands (default 500) is saved. | |
11633 | The shell stores each command in the history list prior to | |
11634 | parameter and variable expansion | |
11635 | but after history expansion is performed, subject to the | |
11636 | values of the shell variables | |
11637 | <CODE>HISTIGNORE</CODE> and <CODE>HISTCONTROL</CODE>. | |
11638 | </P><P> | |
11639 | ||
11640 | When the shell starts up, the history is initialized from the | |
11641 | file named by the <CODE>HISTFILE</CODE> variable (default <TT>`~/.bash_history'</TT>). | |
11642 | The file named by the value of <CODE>HISTFILE</CODE> is truncated, if | |
11643 | necessary, to contain no more than the number of lines specified by | |
11644 | the value of the <CODE>HISTFILESIZE</CODE> variable. | |
11645 | When an interactive shell exits, the last | |
11646 | <CODE>$HISTSIZE</CODE> lines are copied from the history list to the file | |
11647 | named by <CODE>$HISTFILE</CODE>. | |
11648 | If the <CODE>histappend</CODE> shell option is set (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>), | |
11649 | the lines are appended to the history file, | |
11650 | otherwise the history file is overwritten. | |
11651 | If <CODE>HISTFILE</CODE> | |
11652 | is unset, or if the history file is unwritable, the history is | |
11653 | not saved. After saving the history, the history file is truncated | |
11654 | to contain no more than <CODE>$HISTFILESIZE</CODE> | |
11655 | lines. If <CODE>HISTFILESIZE</CODE> is not set, no truncation is performed. | |
11656 | </P><P> | |
11657 | ||
11658 | If the <CODE>HISTTIMEFORMAT</CODE> is set, the time stamp information | |
11659 | associated with each history entry is written to the history file, | |
11660 | marked with the history comment character. | |
11661 | When the history file is read, lines beginning with the history | |
11662 | comment character followed immediately by a digit are interpreted | |
11663 | as timestamps for the previous history line. | |
11664 | </P><P> | |
11665 | ||
11666 | The builtin command <CODE>fc</CODE> may be used to list or edit and re-execute | |
11667 | a portion of the history list. | |
11668 | The <CODE>history</CODE> builtin may be used to display or modify the history | |
11669 | list and manipulate the history file. | |
11670 | When using command-line editing, search commands | |
11671 | are available in each editing mode that provide access to the | |
11672 | history list (see section <A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A>). | |
11673 | </P><P> | |
11674 | ||
11675 | The shell allows control over which commands are saved on the history | |
11676 | list. The <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> | |
11677 | variables may be set to cause the shell to save only a subset of the | |
11678 | commands entered. | |
11679 | The <CODE>cmdhist</CODE> | |
11680 | shell option, if enabled, causes the shell to attempt to save each | |
11681 | line of a multi-line command in the same history entry, adding | |
11682 | semicolons where necessary to preserve syntactic correctness. | |
11683 | The <CODE>lithist</CODE> | |
11684 | shell option causes the shell to save the command with embedded newlines | |
11685 | instead of semicolons. | |
11686 | The <CODE>shopt</CODE> builtin is used to set these options. | |
11687 | See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of <CODE>shopt</CODE>. | |
11688 | </P><P> | |
11689 | ||
11690 | <A NAME="Bash History Builtins"></A> | |
11691 | <HR SIZE="6"> | |
11692 | <A NAME="SEC121"></A> | |
11693 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
11694 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> < </A>]</TD> | |
11695 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> > </A>]</TD> | |
11696 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> << </A>]</TD> | |
11697 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD> | |
11698 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
11699 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11700 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11701 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11702 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11703 | </TR></TABLE> | |
11704 | <H2> 9.2 Bash History Builtins </H2> | |
11705 | <!--docid::SEC121::--> | |
11706 | <P> | |
11707 | ||
11708 | Bash provides two builtin commands which manipulate the | |
11709 | history list and history file. | |
11710 | </P><P> | |
11711 | ||
11712 | <DL COMPACT> | |
11713 | ||
11714 | <DT><CODE>fc</CODE> | |
11715 | <DD><A NAME="IDX535"></A> | |
11716 | <TABLE><tr><td> </td><td class=example><pre><CODE>fc [-e <VAR>ename</VAR>] [-lnr] [<VAR>first</VAR>] [<VAR>last</VAR>]</CODE> | |
11717 | <CODE>fc -s [<VAR>pat</VAR>=<VAR>rep</VAR>] [<VAR>command</VAR>]</CODE> | |
11718 | </pre></td></tr></table><P> | |
11719 | ||
11720 | Fix Command. In the first form, a range of commands from <VAR>first</VAR> to | |
11721 | <VAR>last</VAR> is selected from the history list. Both <VAR>first</VAR> and | |
11722 | <VAR>last</VAR> may be specified as a string (to locate the most recent | |
11723 | command beginning with that string) or as a number (an index into the | |
11724 | history list, where a negative number is used as an offset from the | |
11725 | current command number). If <VAR>last</VAR> is not specified it is set to | |
11726 | <VAR>first</VAR>. If <VAR>first</VAR> is not specified it is set to the previous | |
11727 | command for editing and -16 for listing. If the <SAMP>`-l'</SAMP> flag is | |
11728 | given, the commands are listed on standard output. The <SAMP>`-n'</SAMP> flag | |
11729 | suppresses the command numbers when listing. The <SAMP>`-r'</SAMP> flag | |
11730 | reverses the order of the listing. Otherwise, the editor given by | |
11731 | <VAR>ename</VAR> is invoked on a file containing those commands. If | |
11732 | <VAR>ename</VAR> is not given, the value of the following variable expansion | |
11733 | is used: <CODE>${FCEDIT:-${EDITOR:-vi}}</CODE>. This says to use the | |
11734 | value of the <CODE>FCEDIT</CODE> variable if set, or the value of the | |
11735 | <CODE>EDITOR</CODE> variable if that is set, or <CODE>vi</CODE> if neither is set. | |
11736 | When editing is complete, the edited commands are echoed and executed. | |
11737 | </P><P> | |
11738 | ||
11739 | In the second form, <VAR>command</VAR> is re-executed after each instance | |
11740 | of <VAR>pat</VAR> in the selected command is replaced by <VAR>rep</VAR>. | |
11741 | </P><P> | |
11742 | ||
11743 | A useful alias to use with the <CODE>fc</CODE> command is <CODE>r='fc -s'</CODE>, so | |
11744 | that typing <SAMP>`r cc'</SAMP> runs the last command beginning with <CODE>cc</CODE> | |
11745 | and typing <SAMP>`r'</SAMP> re-executes the last command (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>). | |
11746 | </P><P> | |
11747 | ||
11748 | <DT><CODE>history</CODE> | |
11749 | <DD><A NAME="IDX536"></A> | |
11750 | <TABLE><tr><td> </td><td class=example><pre>history [<VAR>n</VAR>] | |
11751 | history -c | |
11752 | history -d <VAR>offset</VAR> | |
11753 | history [-anrw] [<VAR>filename</VAR>] | |
11754 | history -ps <VAR>arg</VAR> | |
11755 | </pre></td></tr></table><P> | |
11756 | ||
11757 | With no options, display the history list with line numbers. | |
11758 | Lines prefixed with a <SAMP>`*'</SAMP> have been modified. | |
11759 | An argument of <VAR>n</VAR> lists only the last <VAR>n</VAR> lines. | |
11760 | If the shell variable <CODE>HISTTIMEFORMAT</CODE> is set and not null, | |
11761 | it is used as a format string for <VAR>strftime</VAR> to display | |
11762 | the time stamp associated with each displayed history entry. | |
11763 | No intervening blank is printed between the formatted time stamp | |
11764 | and the history line. | |
11765 | </P><P> | |
11766 | ||
11767 | Options, if supplied, have the following meanings: | |
11768 | </P><P> | |
11769 | ||
11770 | <DL COMPACT> | |
11771 | <DT><CODE>-c</CODE> | |
11772 | <DD>Clear the history list. This may be combined | |
11773 | with the other options to replace the history list completely. | |
11774 | <P> | |
11775 | ||
11776 | <DT><CODE>-d <VAR>offset</VAR></CODE> | |
11777 | <DD>Delete the history entry at position <VAR>offset</VAR>. | |
11778 | <VAR>offset</VAR> should be specified as it appears when the history is | |
11779 | displayed. | |
11780 | <P> | |
11781 | ||
11782 | <DT><CODE>-a</CODE> | |
11783 | <DD>Append the new | |
11784 | history lines (history lines entered since the beginning of the | |
11785 | current Bash session) to the history file. | |
11786 | <P> | |
11787 | ||
11788 | <DT><CODE>-n</CODE> | |
11789 | <DD>Append the history lines not already read from the history file | |
11790 | to the current history list. These are lines appended to the history | |
11791 | file since the beginning of the current Bash session. | |
11792 | <P> | |
11793 | ||
11794 | <DT><CODE>-r</CODE> | |
11795 | <DD>Read the current history file and append its contents to | |
11796 | the history list. | |
11797 | <P> | |
11798 | ||
11799 | <DT><CODE>-w</CODE> | |
11800 | <DD>Write out the current history to the history file. | |
11801 | <P> | |
11802 | ||
11803 | <DT><CODE>-p</CODE> | |
11804 | <DD>Perform history substitution on the <VAR>arg</VAR>s and display the result | |
11805 | on the standard output, without storing the results in the history list. | |
11806 | <P> | |
11807 | ||
11808 | <DT><CODE>-s</CODE> | |
11809 | <DD>The <VAR>arg</VAR>s are added to the end of | |
11810 | the history list as a single entry. | |
11811 | <P> | |
11812 | ||
11813 | </DL> | |
11814 | <P> | |
11815 | ||
11816 | When any of the <SAMP>`-w'</SAMP>, <SAMP>`-r'</SAMP>, <SAMP>`-a'</SAMP>, or <SAMP>`-n'</SAMP> options is | |
11817 | used, if <VAR>filename</VAR> | |
11818 | is given, then it is used as the history file. If not, then | |
11819 | the value of the <CODE>HISTFILE</CODE> variable is used. | |
11820 | </P><P> | |
11821 | ||
11822 | </DL> | |
11823 | <P> | |
11824 | ||
11825 | <A NAME="History Interaction"></A> | |
11826 | <HR SIZE="6"> | |
11827 | <A NAME="SEC122"></A> | |
11828 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
11829 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> < </A>]</TD> | |
11830 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> > </A>]</TD> | |
11831 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
11832 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD> | |
11833 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
11834 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11835 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11836 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11837 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11838 | </TR></TABLE> | |
11839 | <H2> 9.3 History Expansion </H2> | |
11840 | <!--docid::SEC122::--> | |
11841 | <P> | |
11842 | ||
11843 | The History library provides a history expansion feature that is similar | |
11844 | to the history expansion provided by <CODE>csh</CODE>. This section | |
11845 | describes the syntax used to manipulate the history information. | |
11846 | </P><P> | |
11847 | ||
11848 | History expansions introduce words from the history list into | |
11849 | the input stream, making it easy to repeat commands, insert the | |
11850 | arguments to a previous command into the current input line, or | |
11851 | fix errors in previous commands quickly. | |
11852 | </P><P> | |
11853 | ||
11854 | History expansion takes place in two parts. The first is to determine | |
11855 | which line from the history list should be used during substitution. | |
11856 | The second is to select portions of that line for inclusion into the | |
11857 | current one. The line selected from the history is called the | |
11858 | <EM>event</EM>, and the portions of that line that are acted upon are | |
11859 | called <EM>words</EM>. Various <EM>modifiers</EM> are available to manipulate | |
11860 | the selected words. The line is broken into words in the same fashion | |
11861 | that Bash does, so that several words | |
11862 | surrounded by quotes are considered one word. | |
11863 | History expansions are introduced by the appearance of the | |
11864 | history expansion character, which is <SAMP>`!'</SAMP> by default. | |
11865 | Only <SAMP>`\'</SAMP> and <SAMP>`''</SAMP> may be used to escape the history expansion | |
11866 | character. | |
11867 | </P><P> | |
11868 | ||
11869 | Several shell options settable with the <CODE>shopt</CODE> | |
11870 | builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>) may be used to tailor | |
11871 | the behavior of history expansion. If the | |
11872 | <CODE>histverify</CODE> shell option is enabled, and Readline | |
11873 | is being used, history substitutions are not immediately passed to | |
11874 | the shell parser. | |
11875 | Instead, the expanded line is reloaded into the Readline | |
11876 | editing buffer for further modification. | |
11877 | If Readline is being used, and the <CODE>histreedit</CODE> | |
11878 | shell option is enabled, a failed history expansion will be | |
11879 | reloaded into the Readline editing buffer for correction. | |
11880 | The <SAMP>`-p'</SAMP> option to the <CODE>history</CODE> builtin command | |
11881 | may be used to see what a history expansion will do before using it. | |
11882 | The <SAMP>`-s'</SAMP> option to the <CODE>history</CODE> builtin may be used to | |
11883 | add commands to the end of the history list without actually executing | |
11884 | them, so that they are available for subsequent recall. | |
11885 | This is most useful in conjunction with Readline. | |
11886 | </P><P> | |
11887 | ||
11888 | The shell allows control of the various characters used by the | |
11889 | history expansion mechanism with the <CODE>histchars</CODE> variable, | |
11890 | as explained above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). The shell uses | |
11891 | the history comment character to mark history timestamps when | |
11892 | writing the history file. | |
11893 | </P><P> | |
11894 | ||
11895 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
11896 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify which history line to use.</TD></TR> | |
11897 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC124">9.3.2 Word Designators</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying which words are of interest.</TD></TR> | |
11898 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC125">9.3.3 Modifiers</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Modifying the results of substitution.</TD></TR> | |
11899 | </TABLE></BLOCKQUOTE> | |
11900 | <P> | |
11901 | ||
11902 | <A NAME="Event Designators"></A> | |
11903 | <HR SIZE="6"> | |
11904 | <A NAME="SEC123"></A> | |
11905 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
11906 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> < </A>]</TD> | |
11907 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> > </A>]</TD> | |
11908 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
11909 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> | |
11910 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
11911 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11912 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11913 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11914 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11915 | </TR></TABLE> | |
11916 | <H3> 9.3.1 Event Designators </H3> | |
11917 | <!--docid::SEC123::--> | |
11918 | <P> | |
11919 | ||
11920 | An event designator is a reference to a command line entry in the | |
11921 | history list. | |
11922 | <A NAME="IDX537"></A> | |
11923 | </P><P> | |
11924 | ||
11925 | <DL COMPACT> | |
11926 | ||
11927 | <DT><CODE>!</CODE> | |
11928 | <DD>Start a history substitution, except when followed by a space, tab, | |
11929 | the end of the line, <SAMP>`='</SAMP> or <SAMP>`('</SAMP> (when the | |
11930 | <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> builtin). | |
11931 | <P> | |
11932 | ||
11933 | <DT><CODE>!<VAR>n</VAR></CODE> | |
11934 | <DD>Refer to command line <VAR>n</VAR>. | |
11935 | <P> | |
11936 | ||
11937 | <DT><CODE>!-<VAR>n</VAR></CODE> | |
11938 | <DD>Refer to the command <VAR>n</VAR> lines back. | |
11939 | <P> | |
11940 | ||
11941 | <DT><CODE>!!</CODE> | |
11942 | <DD>Refer to the previous command. This is a synonym for <SAMP>`!-1'</SAMP>. | |
11943 | <P> | |
11944 | ||
11945 | <DT><CODE>!<VAR>string</VAR></CODE> | |
11946 | <DD>Refer to the most recent command starting with <VAR>string</VAR>. | |
11947 | <P> | |
11948 | ||
11949 | <DT><CODE>!?<VAR>string</VAR>[?]</CODE> | |
11950 | <DD>Refer to the most recent command containing <VAR>string</VAR>. The trailing | |
11951 | <SAMP>`?'</SAMP> may be omitted if the <VAR>string</VAR> is followed immediately by | |
11952 | a newline. | |
11953 | <P> | |
11954 | ||
11955 | <DT><CODE>^<VAR>string1</VAR>^<VAR>string2</VAR>^</CODE> | |
11956 | <DD>Quick Substitution. Repeat the last command, replacing <VAR>string1</VAR> | |
11957 | with <VAR>string2</VAR>. Equivalent to | |
11958 | <CODE>!!:s/<VAR>string1</VAR>/<VAR>string2</VAR>/</CODE>. | |
11959 | <P> | |
11960 | ||
11961 | <DT><CODE>!#</CODE> | |
11962 | <DD>The entire command line typed so far. | |
11963 | <P> | |
11964 | ||
11965 | </DL> | |
11966 | <P> | |
11967 | ||
11968 | <A NAME="Word Designators"></A> | |
11969 | <HR SIZE="6"> | |
11970 | <A NAME="SEC124"></A> | |
11971 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
11972 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> < </A>]</TD> | |
11973 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> > </A>]</TD> | |
11974 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> << </A>]</TD> | |
11975 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> | |
11976 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
11977 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
11978 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
11979 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
11980 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
11981 | </TR></TABLE> | |
11982 | <H3> 9.3.2 Word Designators </H3> | |
11983 | <!--docid::SEC124::--> | |
11984 | <P> | |
11985 | ||
11986 | Word designators are used to select desired words from the event. | |
11987 | A <SAMP>`:'</SAMP> separates the event specification from the word designator. It | |
11988 | may be omitted if the word designator begins with a <SAMP>`^'</SAMP>, <SAMP>`$'</SAMP>, | |
11989 | <SAMP>`*'</SAMP>, <SAMP>`-'</SAMP>, or <SAMP>`%'</SAMP>. Words are numbered from the beginning | |
11990 | of the line, with the first word being denoted by 0 (zero). Words are | |
11991 | inserted into the current line separated by single spaces. | |
11992 | </P><P> | |
11993 | ||
11994 | For example, | |
11995 | </P><P> | |
11996 | ||
11997 | <DL COMPACT> | |
11998 | <DT><CODE>!!</CODE> | |
11999 | <DD>designates the preceding command. When you type this, the preceding | |
12000 | command is repeated in toto. | |
12001 | <P> | |
12002 | ||
12003 | <DT><CODE>!!:$</CODE> | |
12004 | <DD>designates the last argument of the preceding command. This may be | |
12005 | shortened to <CODE>!$</CODE>. | |
12006 | <P> | |
12007 | ||
12008 | <DT><CODE>!fi:2</CODE> | |
12009 | <DD>designates the second argument of the most recent command starting with | |
12010 | the letters <CODE>fi</CODE>. | |
12011 | </DL> | |
12012 | <P> | |
12013 | ||
12014 | Here are the word designators: | |
12015 | ||
12016 | <DL COMPACT> | |
12017 | ||
12018 | <DT><CODE>0 (zero)</CODE> | |
12019 | <DD>The <CODE>0</CODE>th word. For many applications, this is the command word. | |
12020 | <P> | |
12021 | ||
12022 | <DT><CODE><VAR>n</VAR></CODE> | |
12023 | <DD>The <VAR>n</VAR>th word. | |
12024 | <P> | |
12025 | ||
12026 | <DT><CODE>^</CODE> | |
12027 | <DD>The first argument; that is, word 1. | |
12028 | <P> | |
12029 | ||
12030 | <DT><CODE>$</CODE> | |
12031 | <DD>The last argument. | |
12032 | <P> | |
12033 | ||
12034 | <DT><CODE>%</CODE> | |
12035 | <DD>The word matched by the most recent <SAMP>`?<VAR>string</VAR>?'</SAMP> search. | |
12036 | <P> | |
12037 | ||
12038 | <DT><CODE><VAR>x</VAR>-<VAR>y</VAR></CODE> | |
12039 | <DD>A range of words; <SAMP>`-<VAR>y</VAR>'</SAMP> abbreviates <SAMP>`0-<VAR>y</VAR>'</SAMP>. | |
12040 | <P> | |
12041 | ||
12042 | <DT><CODE>*</CODE> | |
12043 | <DD>All of the words, except the <CODE>0</CODE>th. This is a synonym for <SAMP>`1-$'</SAMP>. | |
12044 | It is not an error to use <SAMP>`*'</SAMP> if there is just one word in the event; | |
12045 | the empty string is returned in that case. | |
12046 | <P> | |
12047 | ||
12048 | <DT><CODE><VAR>x</VAR>*</CODE> | |
12049 | <DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP> | |
12050 | <P> | |
12051 | ||
12052 | <DT><CODE><VAR>x</VAR>-</CODE> | |
12053 | <DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP> like <SAMP>`<VAR>x</VAR>*'</SAMP>, but omits the last word. | |
12054 | <P> | |
12055 | ||
12056 | </DL> | |
12057 | <P> | |
12058 | ||
12059 | If a word designator is supplied without an event specification, the | |
12060 | previous command is used as the event. | |
12061 | </P><P> | |
12062 | ||
12063 | <A NAME="Modifiers"></A> | |
12064 | <HR SIZE="6"> | |
12065 | <A NAME="SEC125"></A> | |
12066 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12067 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> < </A>]</TD> | |
12068 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> > </A>]</TD> | |
12069 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
12070 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> | |
12071 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD> | |
12072 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12073 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12074 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12075 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12076 | </TR></TABLE> | |
12077 | <H3> 9.3.3 Modifiers </H3> | |
12078 | <!--docid::SEC125::--> | |
12079 | <P> | |
12080 | ||
12081 | After the optional word designator, you can add a sequence of one or more | |
12082 | of the following modifiers, each preceded by a <SAMP>`:'</SAMP>. | |
12083 | </P><P> | |
12084 | ||
12085 | <DL COMPACT> | |
12086 | ||
12087 | <DT><CODE>h</CODE> | |
12088 | <DD>Remove a trailing pathname component, leaving only the head. | |
12089 | <P> | |
12090 | ||
12091 | <DT><CODE>t</CODE> | |
12092 | <DD>Remove all leading pathname components, leaving the tail. | |
12093 | <P> | |
12094 | ||
12095 | <DT><CODE>r</CODE> | |
12096 | <DD>Remove a trailing suffix of the form <SAMP>`.<VAR>suffix</VAR>'</SAMP>, leaving | |
12097 | the basename. | |
12098 | <P> | |
12099 | ||
12100 | <DT><CODE>e</CODE> | |
12101 | <DD>Remove all but the trailing suffix. | |
12102 | <P> | |
12103 | ||
12104 | <DT><CODE>p</CODE> | |
12105 | <DD>Print the new command but do not execute it. | |
12106 | <P> | |
12107 | ||
12108 | <DT><CODE>q</CODE> | |
12109 | <DD>Quote the substituted words, escaping further substitutions. | |
12110 | <P> | |
12111 | ||
12112 | <DT><CODE>x</CODE> | |
12113 | <DD>Quote the substituted words as with <SAMP>`q'</SAMP>, | |
12114 | but break into words at spaces, tabs, and newlines. | |
12115 | <P> | |
12116 | ||
12117 | <DT><CODE>s/<VAR>old</VAR>/<VAR>new</VAR>/</CODE> | |
12118 | <DD>Substitute <VAR>new</VAR> for the first occurrence of <VAR>old</VAR> in the | |
12119 | event line. Any delimiter may be used in place of <SAMP>`/'</SAMP>. | |
12120 | The delimiter may be quoted in <VAR>old</VAR> and <VAR>new</VAR> | |
12121 | with a single backslash. If <SAMP>`&'</SAMP> appears in <VAR>new</VAR>, | |
12122 | it is replaced by <VAR>old</VAR>. A single backslash will quote | |
12123 | the <SAMP>`&'</SAMP>. The final delimiter is optional if it is the last | |
12124 | character on the input line. | |
12125 | <P> | |
12126 | ||
12127 | <DT><CODE>&</CODE> | |
12128 | <DD>Repeat the previous substitution. | |
12129 | <P> | |
12130 | ||
12131 | <DT><CODE>g</CODE> | |
12132 | <DD><DT><CODE>a</CODE> | |
12133 | <DD>Cause changes to be applied over the entire event line. Used in | |
12134 | conjunction with <SAMP>`s'</SAMP>, as in <CODE>gs/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>, | |
12135 | or with <SAMP>`&'</SAMP>. | |
12136 | <P> | |
12137 | ||
12138 | <DT><CODE>G</CODE> | |
12139 | <DD>Apply the following <SAMP>`s'</SAMP> modifier once to each word in the event. | |
12140 | <P> | |
12141 | ||
12142 | </DL> | |
12143 | <P> | |
12144 | ||
12145 | <A NAME="Installing Bash"></A> | |
12146 | <HR SIZE="6"> | |
12147 | <A NAME="SEC126"></A> | |
12148 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12149 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> < </A>]</TD> | |
12150 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> > </A>]</TD> | |
12151 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> << </A>]</TD> | |
12152 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
12153 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12154 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12155 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12156 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12157 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12158 | </TR></TABLE> | |
12159 | <H1> 10. Installing Bash </H1> | |
12160 | <!--docid::SEC126::--> | |
12161 | <P> | |
12162 | ||
12163 | This chapter provides basic instructions for installing Bash on | |
12164 | the various supported platforms. The distribution supports the | |
12165 | GNU operating systems, nearly every version of Unix, and several | |
12166 | non-Unix systems such as BeOS and Interix. | |
12167 | Other independent ports exist for | |
12168 | MS-DOS, OS/2, and Windows platforms. | |
12169 | </P><P> | |
12170 | ||
12171 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
12172 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Installation instructions.</TD></TR> | |
12173 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC128">10.2 Compilers and Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to set special options for various | |
12174 | systems.</TD></TR> | |
12175 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC129">10.3 Compiling For Multiple Architectures</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to compile Bash for more | |
12176 | than one kind of system from | |
12177 | the same source tree.</TD></TR> | |
12178 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC130">10.4 Installation Names</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to set the various paths used by the installation.</TD></TR> | |
12179 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC131">10.5 Specifying the System Type</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to configure Bash for a particular system.</TD></TR> | |
12180 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC132">10.6 Sharing Defaults</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to share default configuration values among GNU | |
12181 | programs.</TD></TR> | |
12182 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC133">10.7 Operation Controls</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Options recognized by the configuration program.</TD></TR> | |
12183 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC134">10.8 Optional Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to enable and disable optional features when | |
12184 | building Bash.</TD></TR> | |
12185 | </TABLE></BLOCKQUOTE> | |
12186 | <P> | |
12187 | ||
12188 | <A NAME="Basic Installation"></A> | |
12189 | <HR SIZE="6"> | |
12190 | <A NAME="SEC127"></A> | |
12191 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12192 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> < </A>]</TD> | |
12193 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> > </A>]</TD> | |
12194 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD> | |
12195 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12196 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12197 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12198 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12199 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12200 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12201 | </TR></TABLE> | |
12202 | <H2> 10.1 Basic Installation </H2> | |
12203 | <!--docid::SEC127::--> | |
12204 | <P> | |
12205 | ||
12206 | These are installation instructions for Bash. | |
12207 | </P><P> | |
12208 | ||
12209 | The simplest way to compile Bash is: | |
12210 | </P><P> | |
12211 | ||
12212 | <OL> | |
12213 | <LI> | |
12214 | <CODE>cd</CODE> to the directory containing the source code and type | |
12215 | <SAMP>`./configure'</SAMP> to configure Bash for your system. If you're | |
12216 | using <CODE>csh</CODE> on an old version of System V, you might need to | |
12217 | type <SAMP>`sh ./configure'</SAMP> instead to prevent <CODE>csh</CODE> from trying | |
12218 | to execute <CODE>configure</CODE> itself. | |
12219 | <P> | |
12220 | ||
12221 | Running <CODE>configure</CODE> takes some time. | |
12222 | While running, it prints messages telling which features it is | |
12223 | checking for. | |
12224 | </P><P> | |
12225 | ||
12226 | <LI> | |
12227 | Type <SAMP>`make'</SAMP> to compile Bash and build the <CODE>bashbug</CODE> bug | |
12228 | reporting script. | |
12229 | <P> | |
12230 | ||
12231 | <LI> | |
12232 | Optionally, type <SAMP>`make tests'</SAMP> to run the Bash test suite. | |
12233 | <P> | |
12234 | ||
12235 | <LI> | |
12236 | Type <SAMP>`make install'</SAMP> to install <CODE>bash</CODE> and <CODE>bashbug</CODE>. | |
12237 | This will also install the manual pages and Info file. | |
12238 | <P> | |
12239 | ||
12240 | </OL> | |
12241 | <P> | |
12242 | ||
12243 | The <CODE>configure</CODE> shell script attempts to guess correct | |
12244 | values for various system-dependent variables used during | |
12245 | compilation. It uses those values to create a <TT>`Makefile'</TT> in | |
12246 | each directory of the package (the top directory, the | |
12247 | <TT>`builtins'</TT>, <TT>`doc'</TT>, and <TT>`support'</TT> directories, | |
12248 | each directory under <TT>`lib'</TT>, and several others). It also creates a | |
12249 | <TT>`config.h'</TT> file containing system-dependent definitions. | |
12250 | Finally, it creates a shell script named <CODE>config.status</CODE> that you | |
12251 | can run in the future to recreate the current configuration, a | |
12252 | file <TT>`config.cache'</TT> that saves the results of its tests to | |
12253 | speed up reconfiguring, and a file <TT>`config.log'</TT> containing | |
12254 | compiler output (useful mainly for debugging <CODE>configure</CODE>). | |
12255 | If at some point | |
12256 | <TT>`config.cache'</TT> contains results you don't want to keep, you | |
12257 | may remove or edit it. | |
12258 | </P><P> | |
12259 | ||
12260 | To find out more about the options and arguments that the | |
12261 | <CODE>configure</CODE> script understands, type | |
12262 | </P><P> | |
12263 | ||
12264 | <TABLE><tr><td> </td><td class=example><pre>bash-2.04$ ./configure --help | |
12265 | </pre></td></tr></table></P><P> | |
12266 | ||
12267 | at the Bash prompt in your Bash source directory. | |
12268 | </P><P> | |
12269 | ||
12270 | If you need to do unusual things to compile Bash, please | |
12271 | try to figure out how <CODE>configure</CODE> could check whether or not | |
12272 | to do them, and mail diffs or instructions to | |
12273 | <A HREF="mailto:bash-maintainers@gnu.org">bash-maintainers@gnu.org</A> so they can be | |
12274 | considered for the next release. | |
12275 | </P><P> | |
12276 | ||
12277 | The file <TT>`configure.in'</TT> is used to create <CODE>configure</CODE> | |
12278 | by a program called Autoconf. You only need | |
12279 | <TT>`configure.in'</TT> if you want to change it or regenerate | |
12280 | <CODE>configure</CODE> using a newer version of Autoconf. If | |
12281 | you do this, make sure you are using Autoconf version 2.50 or | |
12282 | newer. | |
12283 | </P><P> | |
12284 | ||
12285 | You can remove the program binaries and object files from the | |
12286 | source code directory by typing <SAMP>`make clean'</SAMP>. To also remove the | |
12287 | files that <CODE>configure</CODE> created (so you can compile Bash for | |
12288 | a different kind of computer), type <SAMP>`make distclean'</SAMP>. | |
12289 | </P><P> | |
12290 | ||
12291 | <A NAME="Compilers and Options"></A> | |
12292 | <HR SIZE="6"> | |
12293 | <A NAME="SEC128"></A> | |
12294 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12295 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> < </A>]</TD> | |
12296 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> > </A>]</TD> | |
12297 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> << </A>]</TD> | |
12298 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12299 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12300 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12301 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12302 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12303 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12304 | </TR></TABLE> | |
12305 | <H2> 10.2 Compilers and Options </H2> | |
12306 | <!--docid::SEC128::--> | |
12307 | <P> | |
12308 | ||
12309 | Some systems require unusual options for compilation or linking | |
12310 | that the <CODE>configure</CODE> script does not know about. You can | |
12311 | give <CODE>configure</CODE> initial values for variables by setting | |
12312 | them in the environment. Using a Bourne-compatible shell, you | |
12313 | can do that on the command line like this: | |
12314 | </P><P> | |
12315 | ||
12316 | <TABLE><tr><td> </td><td class=example><pre>CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure | |
12317 | </pre></td></tr></table></P><P> | |
12318 | ||
12319 | On systems that have the <CODE>env</CODE> program, you can do it like this: | |
12320 | </P><P> | |
12321 | ||
12322 | <TABLE><tr><td> </td><td class=example><pre>env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure | |
12323 | </pre></td></tr></table></P><P> | |
12324 | ||
12325 | The configuration process uses GCC to build Bash if it | |
12326 | is available. | |
12327 | </P><P> | |
12328 | ||
12329 | <A NAME="Compiling For Multiple Architectures"></A> | |
12330 | <HR SIZE="6"> | |
12331 | <A NAME="SEC129"></A> | |
12332 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12333 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> < </A>]</TD> | |
12334 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> > </A>]</TD> | |
12335 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> << </A>]</TD> | |
12336 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12337 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12338 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12339 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12340 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12341 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12342 | </TR></TABLE> | |
12343 | <H2> 10.3 Compiling For Multiple Architectures </H2> | |
12344 | <!--docid::SEC129::--> | |
12345 | <P> | |
12346 | ||
12347 | You can compile Bash for more than one kind of computer at the | |
12348 | same time, by placing the object files for each architecture in their | |
12349 | own directory. To do this, you must use a version of <CODE>make</CODE> that | |
12350 | supports the <CODE>VPATH</CODE> variable, such as GNU <CODE>make</CODE>. | |
12351 | <CODE>cd</CODE> to the | |
12352 | directory where you want the object files and executables to go and run | |
12353 | the <CODE>configure</CODE> script from the source directory. You may need to | |
12354 | supply the <SAMP>`--srcdir=PATH'</SAMP> argument to tell <CODE>configure</CODE> where the | |
12355 | source files are. <CODE>configure</CODE> automatically checks for the | |
12356 | source code in the directory that <CODE>configure</CODE> is in and in `..'. | |
12357 | </P><P> | |
12358 | ||
12359 | If you have to use a <CODE>make</CODE> that does not supports the <CODE>VPATH</CODE> | |
12360 | variable, you can compile Bash for one architecture at a | |
12361 | time in the source code directory. After you have installed | |
12362 | Bash for one architecture, use <SAMP>`make distclean'</SAMP> before | |
12363 | reconfiguring for another architecture. | |
12364 | </P><P> | |
12365 | ||
12366 | Alternatively, if your system supports symbolic links, you can use the | |
12367 | <TT>`support/mkclone'</TT> script to create a build tree which has | |
12368 | symbolic links back to each file in the source directory. Here's an | |
12369 | example that creates a build directory in the current directory from a | |
12370 | source directory <TT>`/usr/gnu/src/bash-2.0'</TT>: | |
12371 | </P><P> | |
12372 | ||
12373 | <TABLE><tr><td> </td><td class=example><pre>bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . | |
12374 | </pre></td></tr></table></P><P> | |
12375 | ||
12376 | The <CODE>mkclone</CODE> script requires Bash, so you must have already built | |
12377 | Bash for at least one architecture before you can create build | |
12378 | directories for other architectures. | |
12379 | </P><P> | |
12380 | ||
12381 | <A NAME="Installation Names"></A> | |
12382 | <HR SIZE="6"> | |
12383 | <A NAME="SEC130"></A> | |
12384 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12385 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> < </A>]</TD> | |
12386 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> > </A>]</TD> | |
12387 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> << </A>]</TD> | |
12388 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12389 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12390 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12391 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12392 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12393 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12394 | </TR></TABLE> | |
12395 | <H2> 10.4 Installation Names </H2> | |
12396 | <!--docid::SEC130::--> | |
12397 | <P> | |
12398 | ||
12399 | By default, <SAMP>`make install'</SAMP> will install into | |
12400 | <TT>`/usr/local/bin'</TT>, <TT>`/usr/local/man'</TT>, etc. You can | |
12401 | specify an installation prefix other than <TT>`/usr/local'</TT> by | |
12402 | giving <CODE>configure</CODE> the option <SAMP>`--prefix=<VAR>PATH</VAR>'</SAMP>, | |
12403 | or by specifying a value for the <CODE>DESTDIR</CODE> <SAMP>`make'</SAMP> | |
12404 | variable when running <SAMP>`make install'</SAMP>. | |
12405 | </P><P> | |
12406 | ||
12407 | You can specify separate installation prefixes for | |
12408 | architecture-specific files and architecture-independent files. | |
12409 | If you give <CODE>configure</CODE> the option | |
12410 | <SAMP>`--exec-prefix=<VAR>PATH</VAR>'</SAMP>, <SAMP>`make install'</SAMP> will use | |
12411 | <VAR>PATH</VAR> as the prefix for installing programs and libraries. | |
12412 | Documentation and other data files will still use the regular prefix. | |
12413 | </P><P> | |
12414 | ||
12415 | <A NAME="Specifying the System Type"></A> | |
12416 | <HR SIZE="6"> | |
12417 | <A NAME="SEC131"></A> | |
12418 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12419 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> < </A>]</TD> | |
12420 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> > </A>]</TD> | |
12421 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> << </A>]</TD> | |
12422 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12423 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12424 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12425 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12426 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12427 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12428 | </TR></TABLE> | |
12429 | <H2> 10.5 Specifying the System Type </H2> | |
12430 | <!--docid::SEC131::--> | |
12431 | <P> | |
12432 | ||
12433 | There may be some features <CODE>configure</CODE> can not figure out | |
12434 | automatically, but need to determine by the type of host Bash | |
12435 | will run on. Usually <CODE>configure</CODE> can figure that | |
12436 | out, but if it prints a message saying it can not guess the host | |
12437 | type, give it the <SAMP>`--host=TYPE'</SAMP> option. <SAMP>`TYPE'</SAMP> can | |
12438 | either be a short name for the system type, such as <SAMP>`sun4'</SAMP>, | |
12439 | or a canonical name with three fields: <SAMP>`CPU-COMPANY-SYSTEM'</SAMP> | |
12440 | (e.g., <SAMP>`i386-unknown-freebsd4.2'</SAMP>). | |
12441 | </P><P> | |
12442 | ||
12443 | See the file <TT>`support/config.sub'</TT> for the possible | |
12444 | values of each field. | |
12445 | </P><P> | |
12446 | ||
12447 | <A NAME="Sharing Defaults"></A> | |
12448 | <HR SIZE="6"> | |
12449 | <A NAME="SEC132"></A> | |
12450 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12451 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> < </A>]</TD> | |
12452 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> > </A>]</TD> | |
12453 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> << </A>]</TD> | |
12454 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12455 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12456 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12457 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12458 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12459 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12460 | </TR></TABLE> | |
12461 | <H2> 10.6 Sharing Defaults </H2> | |
12462 | <!--docid::SEC132::--> | |
12463 | <P> | |
12464 | ||
12465 | If you want to set default values for <CODE>configure</CODE> scripts to | |
12466 | share, you can create a site shell script called | |
12467 | <CODE>config.site</CODE> that gives default values for variables like | |
12468 | <CODE>CC</CODE>, <CODE>cache_file</CODE>, and <CODE>prefix</CODE>. <CODE>configure</CODE> | |
12469 | looks for <TT>`PREFIX/share/config.site'</TT> if it exists, then | |
12470 | <TT>`PREFIX/etc/config.site'</TT> if it exists. Or, you can set the | |
12471 | <CODE>CONFIG_SITE</CODE> environment variable to the location of the site | |
12472 | script. A warning: the Bash <CODE>configure</CODE> looks for a site script, | |
12473 | but not all <CODE>configure</CODE> scripts do. | |
12474 | </P><P> | |
12475 | ||
12476 | <A NAME="Operation Controls"></A> | |
12477 | <HR SIZE="6"> | |
12478 | <A NAME="SEC133"></A> | |
12479 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12480 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> < </A>]</TD> | |
12481 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> > </A>]</TD> | |
12482 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> << </A>]</TD> | |
12483 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12484 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12485 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12486 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12487 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12488 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12489 | </TR></TABLE> | |
12490 | <H2> 10.7 Operation Controls </H2> | |
12491 | <!--docid::SEC133::--> | |
12492 | <P> | |
12493 | ||
12494 | <CODE>configure</CODE> recognizes the following options to control how it | |
12495 | operates. | |
12496 | </P><P> | |
12497 | ||
12498 | <DL COMPACT> | |
12499 | ||
12500 | <DT><CODE>--cache-file=<VAR>file</VAR></CODE> | |
12501 | <DD>Use and save the results of the tests in | |
12502 | <VAR>file</VAR> instead of <TT>`./config.cache'</TT>. Set <VAR>file</VAR> to | |
12503 | <TT>`/dev/null'</TT> to disable caching, for debugging | |
12504 | <CODE>configure</CODE>. | |
12505 | <P> | |
12506 | ||
12507 | <DT><CODE>--help</CODE> | |
12508 | <DD>Print a summary of the options to <CODE>configure</CODE>, and exit. | |
12509 | <P> | |
12510 | ||
12511 | <DT><CODE>--quiet</CODE> | |
12512 | <DD><DT><CODE>--silent</CODE> | |
12513 | <DD><DT><CODE>-q</CODE> | |
12514 | <DD>Do not print messages saying which checks are being made. | |
12515 | <P> | |
12516 | ||
12517 | <DT><CODE>--srcdir=<VAR>dir</VAR></CODE> | |
12518 | <DD>Look for the Bash source code in directory <VAR>dir</VAR>. Usually | |
12519 | <CODE>configure</CODE> can determine that directory automatically. | |
12520 | <P> | |
12521 | ||
12522 | <DT><CODE>--version</CODE> | |
12523 | <DD>Print the version of Autoconf used to generate the <CODE>configure</CODE> | |
12524 | script, and exit. | |
12525 | </DL> | |
12526 | <P> | |
12527 | ||
12528 | <CODE>configure</CODE> also accepts some other, not widely used, boilerplate | |
12529 | options. <SAMP>`configure --help'</SAMP> prints the complete list. | |
12530 | </P><P> | |
12531 | ||
12532 | <A NAME="Optional Features"></A> | |
12533 | <HR SIZE="6"> | |
12534 | <A NAME="SEC134"></A> | |
12535 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12536 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> < </A>]</TD> | |
12537 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> > </A>]</TD> | |
12538 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD> | |
12539 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD> | |
12540 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD> | |
12541 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12542 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12543 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12544 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12545 | </TR></TABLE> | |
12546 | <H2> 10.8 Optional Features </H2> | |
12547 | <!--docid::SEC134::--> | |
12548 | <P> | |
12549 | ||
12550 | The Bash <CODE>configure</CODE> has a number of <SAMP>`--enable-<VAR>feature</VAR>'</SAMP> | |
12551 | options, where <VAR>feature</VAR> indicates an optional part of Bash. | |
12552 | There are also several <SAMP>`--with-<VAR>package</VAR>'</SAMP> options, | |
12553 | where <VAR>package</VAR> is something like <SAMP>`bash-malloc'</SAMP> or <SAMP>`purify'</SAMP>. | |
12554 | To turn off the default use of a package, use | |
12555 | <SAMP>`--without-<VAR>package</VAR>'</SAMP>. To configure Bash without a feature | |
12556 | that is enabled by default, use <SAMP>`--disable-<VAR>feature</VAR>'</SAMP>. | |
12557 | </P><P> | |
12558 | ||
12559 | Here is a complete list of the <SAMP>`--enable-'</SAMP> and | |
12560 | <SAMP>`--with-'</SAMP> options that the Bash <CODE>configure</CODE> recognizes. | |
12561 | </P><P> | |
12562 | ||
12563 | <DL COMPACT> | |
12564 | <DT><CODE>--with-afs</CODE> | |
12565 | <DD>Define if you are using the Andrew File System from Transarc. | |
12566 | <P> | |
12567 | ||
12568 | <DT><CODE>--with-bash-malloc</CODE> | |
12569 | <DD>Use the Bash version of | |
12570 | <CODE>malloc</CODE> in the directory <TT>`lib/malloc'</TT>. This is not the same | |
12571 | <CODE>malloc</CODE> that appears in GNU libc, but an older version | |
12572 | originally derived from the 4.2 BSD <CODE>malloc</CODE>. This <CODE>malloc</CODE> | |
12573 | is very fast, but wastes some space on each allocation. | |
12574 | This option is enabled by default. | |
12575 | The <TT>`NOTES'</TT> file contains a list of systems for | |
12576 | which this should be turned off, and <CODE>configure</CODE> disables this | |
12577 | option automatically for a number of systems. | |
12578 | <P> | |
12579 | ||
12580 | <DT><CODE>--with-curses</CODE> | |
12581 | <DD>Use the curses library instead of the termcap library. This should | |
12582 | be supplied if your system has an inadequate or incomplete termcap | |
12583 | database. | |
12584 | <P> | |
12585 | ||
12586 | <DT><CODE>--with-gnu-malloc</CODE> | |
12587 | <DD>A synonym for <CODE>--with-bash-malloc</CODE>. | |
12588 | <P> | |
12589 | ||
12590 | <DT><CODE>--with-installed-readline[=<VAR>PREFIX</VAR>]</CODE> | |
12591 | <DD>Define this to make Bash link with a locally-installed version of Readline | |
12592 | rather than the version in <TT>`lib/readline'</TT>. This works only with | |
12593 | Readline 5.0 and later versions. If <VAR>PREFIX</VAR> is <CODE>yes</CODE> or not | |
12594 | supplied, <CODE>configure</CODE> uses the values of the make variables | |
12595 | <CODE>includedir</CODE> and <CODE>libdir</CODE>, which are subdirectories of <CODE>prefix</CODE> | |
12596 | by default, to find the installed version of Readline if it is not in | |
12597 | the standard system include and library directories. | |
12598 | If <VAR>PREFIX</VAR> is <CODE>no</CODE>, Bash links with the version in | |
12599 | <TT>`lib/readline'</TT>. | |
12600 | If <VAR>PREFIX</VAR> is set to any other value, <CODE>configure</CODE> treats it as | |
12601 | a directory pathname and looks for | |
12602 | the installed version of Readline in subdirectories of that directory | |
12603 | (include files in <VAR>PREFIX</VAR>/<CODE>include</CODE> and the library in | |
12604 | <VAR>PREFIX</VAR>/<CODE>lib</CODE>). | |
12605 | <P> | |
12606 | ||
12607 | <DT><CODE>--with-purify</CODE> | |
12608 | <DD>Define this to use the Purify memory allocation checker from Rational | |
12609 | Software. | |
12610 | <P> | |
12611 | ||
12612 | <DT><CODE>--enable-minimal-config</CODE> | |
12613 | <DD>This produces a shell with minimal features, close to the historical | |
12614 | Bourne shell. | |
12615 | </DL> | |
12616 | <P> | |
12617 | ||
12618 | There are several <SAMP>`--enable-'</SAMP> options that alter how Bash is | |
12619 | compiled and linked, rather than changing run-time features. | |
12620 | </P><P> | |
12621 | ||
12622 | <DL COMPACT> | |
12623 | <DT><CODE>--enable-largefile</CODE> | |
12624 | <DD>Enable support for <A HREF="http://www.sas.com/standards/large_file/x_open.20Mar96.html">large files</A> if the operating system requires special compiler options | |
12625 | to build programs which can access large files. This is enabled by | |
12626 | default, if the operating system provides large file support. | |
12627 | <P> | |
12628 | ||
12629 | <DT><CODE>--enable-profiling</CODE> | |
12630 | <DD>This builds a Bash binary that produces profiling information to be | |
12631 | processed by <CODE>gprof</CODE> each time it is executed. | |
12632 | <P> | |
12633 | ||
12634 | <DT><CODE>--enable-static-link</CODE> | |
12635 | <DD>This causes Bash to be linked statically, if <CODE>gcc</CODE> is being used. | |
12636 | This could be used to build a version to use as root's shell. | |
12637 | </DL> | |
12638 | <P> | |
12639 | ||
12640 | The <SAMP>`minimal-config'</SAMP> option can be used to disable all of | |
12641 | the following options, but it is processed first, so individual | |
12642 | options may be enabled using <SAMP>`enable-<VAR>feature</VAR>'</SAMP>. | |
12643 | </P><P> | |
12644 | ||
12645 | All of the following options except for <SAMP>`disabled-builtins'</SAMP> and | |
12646 | <SAMP>`xpg-echo-default'</SAMP> are | |
12647 | enabled by default, unless the operating system does not provide the | |
12648 | necessary support. | |
12649 | </P><P> | |
12650 | ||
12651 | <DL COMPACT> | |
12652 | <DT><CODE>--enable-alias</CODE> | |
12653 | <DD>Allow alias expansion and include the <CODE>alias</CODE> and <CODE>unalias</CODE> | |
12654 | builtins (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>). | |
12655 | <P> | |
12656 | ||
12657 | <DT><CODE>--enable-arith-for-command</CODE> | |
12658 | <DD>Include support for the alternate form of the <CODE>for</CODE> command | |
12659 | that behaves like the C language <CODE>for</CODE> statement | |
12660 | (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>). | |
12661 | <P> | |
12662 | ||
12663 | <DT><CODE>--enable-array-variables</CODE> | |
12664 | <DD>Include support for one-dimensional array shell variables | |
12665 | (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>). | |
12666 | <P> | |
12667 | ||
12668 | <DT><CODE>--enable-bang-history</CODE> | |
12669 | <DD>Include support for <CODE>csh</CODE>-like history substitution | |
12670 | (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>). | |
12671 | <P> | |
12672 | ||
12673 | <DT><CODE>--enable-brace-expansion</CODE> | |
12674 | <DD>Include <CODE>csh</CODE>-like brace expansion | |
12675 | ( <CODE>b{a,b}c</CODE> ==> <CODE>bac bbc</CODE> ). | |
12676 | See <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>, for a complete description. | |
12677 | <P> | |
12678 | ||
12679 | <DT><CODE>--enable-casemod-attributes</CODE> | |
12680 | <DD>Include support for case-modifying attributes in the <CODE>declare</CODE> builtin | |
12681 | and assignment statements. Variables with the <VAR>uppercase</VAR> attribute, | |
12682 | for example, will have their values converted to uppercase upon assignment. | |
12683 | <P> | |
12684 | ||
12685 | <DT><CODE>--enable-casemod-expansion</CODE> | |
12686 | <DD>Include support for case-modifying word expansions. | |
12687 | <P> | |
12688 | ||
12689 | <DT><CODE>--enable-command-timing</CODE> | |
12690 | <DD>Include support for recognizing <CODE>time</CODE> as a reserved word and for | |
12691 | displaying timing statistics for the pipeline following <CODE>time</CODE> | |
12692 | (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). | |
12693 | This allows pipelines as well as shell builtins and functions to be timed. | |
12694 | <P> | |
12695 | ||
12696 | <DT><CODE>--enable-cond-command</CODE> | |
12697 | <DD>Include support for the <CODE>[[</CODE> conditional command. | |
12698 | (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). | |
12699 | <P> | |
12700 | ||
12701 | <DT><CODE>--enable-cond-regexp</CODE> | |
12702 | <DD>Include support for matching POSIX regular expressions using the | |
12703 | <SAMP>`=~'</SAMP> binary operator in the <CODE>[[</CODE> conditional command. | |
12704 | (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). | |
12705 | <P> | |
12706 | ||
12707 | <DT><CODE>--enable-coprocesses</CODE> | |
12708 | <DD>Include support for coprocesses and the <CODE>coproc</CODE> reserved word | |
12709 | (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). | |
12710 | <P> | |
12711 | ||
12712 | <DT><CODE>--enable-debugger</CODE> | |
12713 | <DD>Include support for the bash debugger (distributed separately). | |
12714 | <P> | |
12715 | ||
12716 | <DT><CODE>--enable-directory-stack</CODE> | |
12717 | <DD>Include support for a <CODE>csh</CODE>-like directory stack and the | |
12718 | <CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins | |
12719 | (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>). | |
12720 | <P> | |
12721 | ||
12722 | <DT><CODE>--enable-disabled-builtins</CODE> | |
12723 | <DD>Allow builtin commands to be invoked via <SAMP>`builtin xxx'</SAMP> | |
12724 | even after <CODE>xxx</CODE> has been disabled using <SAMP>`enable -n xxx'</SAMP>. | |
12725 | See <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for details of the <CODE>builtin</CODE> and | |
12726 | <CODE>enable</CODE> builtin commands. | |
12727 | <P> | |
12728 | ||
12729 | <DT><CODE>--enable-dparen-arithmetic</CODE> | |
12730 | <DD>Include support for the <CODE>((<small>...</small>))</CODE> command | |
12731 | (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). | |
12732 | <P> | |
12733 | ||
12734 | <DT><CODE>--enable-extended-glob</CODE> | |
12735 | <DD>Include support for the extended pattern matching features described | |
12736 | above under <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>. | |
12737 | <P> | |
12738 | ||
12739 | <DT><CODE>--enable-help-builtin</CODE> | |
12740 | <DD>Include the <CODE>help</CODE> builtin, which displays help on shell builtins and | |
12741 | variables (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
12742 | <P> | |
12743 | ||
12744 | <DT><CODE>--enable-history</CODE> | |
12745 | <DD>Include command history and the <CODE>fc</CODE> and <CODE>history</CODE> | |
12746 | builtin commands (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>). | |
12747 | <P> | |
12748 | ||
12749 | <DT><CODE>--enable-job-control</CODE> | |
12750 | <DD>This enables the job control features (see section <A HREF="bashref.html#SEC91">7. Job Control</A>), | |
12751 | if the operating system supports them. | |
12752 | <P> | |
12753 | ||
12754 | <DT><CODE>--enable-multibyte</CODE> | |
12755 | <DD>This enables support for multibyte characters if the operating | |
12756 | system provides the necessary support. | |
12757 | <P> | |
12758 | ||
12759 | <DT><CODE>--enable-net-redirections</CODE> | |
12760 | <DD>This enables the special handling of filenames of the form | |
12761 | <CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE> and | |
12762 | <CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE> | |
12763 | when used in redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
12764 | <P> | |
12765 | ||
12766 | <DT><CODE>--enable-process-substitution</CODE> | |
12767 | <DD>This enables process substitution (see section <A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>) if | |
12768 | the operating system provides the necessary support. | |
12769 | <P> | |
12770 | ||
12771 | <DT><CODE>--enable-progcomp</CODE> | |
12772 | <DD>Enable the programmable completion facilities | |
12773 | (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). | |
12774 | If Readline is not enabled, this option has no effect. | |
12775 | <P> | |
12776 | ||
12777 | <DT><CODE>--enable-prompt-string-decoding</CODE> | |
12778 | <DD>Turn on the interpretation of a number of backslash-escaped characters | |
12779 | in the <CODE>$PS1</CODE>, <CODE>$PS2</CODE>, <CODE>$PS3</CODE>, and <CODE>$PS4</CODE> prompt | |
12780 | strings. See <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for a complete list of prompt | |
12781 | string escape sequences. | |
12782 | <P> | |
12783 | ||
12784 | <DT><CODE>--enable-readline</CODE> | |
12785 | <DD>Include support for command-line editing and history with the Bash | |
12786 | version of the Readline library (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>). | |
12787 | <P> | |
12788 | ||
12789 | <DT><CODE>--enable-restricted</CODE> | |
12790 | <DD>Include support for a <EM>restricted shell</EM>. If this is enabled, Bash, | |
12791 | when called as <CODE>rbash</CODE>, enters a restricted mode. See | |
12792 | <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>, for a description of restricted mode. | |
12793 | <P> | |
12794 | ||
12795 | <DT><CODE>--enable-select</CODE> | |
12796 | <DD>Include the <CODE>select</CODE> builtin, which allows the generation of simple | |
12797 | menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). | |
12798 | <P> | |
12799 | ||
12800 | <DT><CODE>--enable-separate-helpfiles</CODE> | |
12801 | <DD>Use external files for the documentation displayed by the <CODE>help</CODE> builtin | |
12802 | instead of storing the text internally. | |
12803 | <P> | |
12804 | ||
12805 | <DT><CODE>--enable-single-help-strings</CODE> | |
12806 | <DD>Store the text displayed by the <CODE>help</CODE> builtin as a single string for | |
12807 | each help topic. This aids in translating the text to different languages. | |
12808 | You may need to disable this if your compiler cannot handle very long string | |
12809 | literals. | |
12810 | <P> | |
12811 | ||
12812 | <DT><CODE>--enable-strict-posix-default</CODE> | |
12813 | <DD>Make Bash POSIX-conformant by default (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>). | |
12814 | <P> | |
12815 | ||
12816 | <DT><CODE>--enable-usg-echo-default</CODE> | |
12817 | <DD>A synonym for <CODE>--enable-xpg-echo-default</CODE>. | |
12818 | <P> | |
12819 | ||
12820 | <DT><CODE>--enable-xpg-echo-default</CODE> | |
12821 | <DD>Make the <CODE>echo</CODE> builtin expand backslash-escaped characters by default, | |
12822 | without requiring the <SAMP>`-e'</SAMP> option. | |
12823 | This sets the default value of the <CODE>xpg_echo</CODE> shell option to <CODE>on</CODE>, | |
12824 | which makes the Bash <CODE>echo</CODE> behave more like the version specified in | |
12825 | the Single Unix Specification, version 3. | |
12826 | See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of the escape sequences that | |
12827 | <CODE>echo</CODE> recognizes. | |
12828 | <P> | |
12829 | ||
12830 | </DL> | |
12831 | <P> | |
12832 | ||
12833 | The file <TT>`config-top.h'</TT> contains C Preprocessor | |
12834 | <SAMP>`#define'</SAMP> statements for options which are not settable from | |
12835 | <CODE>configure</CODE>. | |
12836 | Some of these are not meant to be changed; beware of the consequences if | |
12837 | you do. | |
12838 | Read the comments associated with each definition for more | |
12839 | information about its effect. | |
12840 | </P><P> | |
12841 | ||
12842 | <A NAME="Reporting Bugs"></A> | |
12843 | <HR SIZE="6"> | |
12844 | <A NAME="SEC135"></A> | |
12845 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12846 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> < </A>]</TD> | |
12847 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> > </A>]</TD> | |
12848 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD> | |
12849 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
12850 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD> | |
12851 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12852 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12853 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12854 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12855 | </TR></TABLE> | |
12856 | <H1> A. Reporting Bugs </H1> | |
12857 | <!--docid::SEC135::--> | |
12858 | <P> | |
12859 | ||
12860 | Please report all bugs you find in Bash. | |
12861 | But first, you should | |
12862 | make sure that it really is a bug, and that it appears in the latest | |
12863 | version of Bash. | |
12864 | The latest version of Bash is always available for FTP from | |
12865 | <A HREF="ftp://ftp.gnu.org/pub/bash/">ftp://ftp.gnu.org/pub/bash/</A>. | |
12866 | </P><P> | |
12867 | ||
12868 | Once you have determined that a bug actually exists, use the | |
12869 | <CODE>bashbug</CODE> command to submit a bug report. | |
12870 | If you have a fix, you are encouraged to mail that as well! | |
12871 | Suggestions and `philosophical' bug reports may be mailed | |
12872 | to <A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A> or posted to the Usenet | |
12873 | newsgroup <CODE>gnu.bash.bug</CODE>. | |
12874 | </P><P> | |
12875 | ||
12876 | All bug reports should include: | |
12877 | <UL> | |
12878 | <LI> | |
12879 | The version number of Bash. | |
12880 | <LI> | |
12881 | The hardware and operating system. | |
12882 | <LI> | |
12883 | The compiler used to compile Bash. | |
12884 | <LI> | |
12885 | A description of the bug behaviour. | |
12886 | <LI> | |
12887 | A short script or `recipe' which exercises the bug and may be used | |
12888 | to reproduce it. | |
12889 | </UL> | |
12890 | <P> | |
12891 | ||
12892 | <CODE>bashbug</CODE> inserts the first three items automatically into | |
12893 | the template it provides for filing a bug report. | |
12894 | </P><P> | |
12895 | ||
12896 | Please send all reports concerning this manual to | |
12897 | <A HREF="mailto:chet@po.CWRU.Edu">chet@po.CWRU.Edu</A>. | |
12898 | </P><P> | |
12899 | ||
12900 | <A NAME="Major Differences From The Bourne Shell"></A> | |
12901 | <HR SIZE="6"> | |
12902 | <A NAME="SEC136"></A> | |
12903 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
12904 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> < </A>]</TD> | |
12905 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> > </A>]</TD> | |
12906 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> << </A>]</TD> | |
12907 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
12908 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> >> </A>]</TD> | |
12909 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
12910 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
12911 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
12912 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
12913 | </TR></TABLE> | |
12914 | <H1> B. Major Differences From The Bourne Shell </H1> | |
12915 | <!--docid::SEC136::--> | |
12916 | <P> | |
12917 | ||
12918 | Bash implements essentially the same grammar, parameter and | |
12919 | variable expansion, redirection, and quoting as the Bourne Shell. | |
12920 | Bash uses the POSIX standard as the specification of | |
12921 | how these features are to be implemented. There are some | |
12922 | differences between the traditional Bourne shell and Bash; this | |
12923 | section quickly details the differences of significance. A | |
12924 | number of these differences are explained in greater depth in | |
12925 | previous sections. | |
12926 | This section uses the version of <CODE>sh</CODE> included in SVR4.2 (the | |
12927 | last version of the historical Bourne shell) as the baseline reference. | |
12928 | </P><P> | |
12929 | ||
12930 | <UL> | |
12931 | ||
12932 | <LI> | |
12933 | Bash is POSIX-conformant, even where the POSIX specification | |
12934 | differs from traditional <CODE>sh</CODE> behavior (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>). | |
12935 | <P> | |
12936 | ||
12937 | <LI> | |
12938 | Bash has multi-character invocation options (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>). | |
12939 | <P> | |
12940 | ||
12941 | <LI> | |
12942 | Bash has command-line editing (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) and | |
12943 | the <CODE>bind</CODE> builtin. | |
12944 | <P> | |
12945 | ||
12946 | <LI> | |
12947 | Bash provides a programmable word completion mechanism | |
12948 | (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>), and builtin commands | |
12949 | <CODE>complete</CODE>, <CODE>compgen</CODE>, and <CODE>compopt</CODE>, to | |
12950 | manipulate it. | |
12951 | <P> | |
12952 | ||
12953 | <LI> | |
12954 | Bash has command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>) and the | |
12955 | <CODE>history</CODE> and <CODE>fc</CODE> builtins to manipulate it. | |
12956 | The Bash history list maintains timestamp information and uses the | |
12957 | value of the <CODE>HISTTIMEFORMAT</CODE> variable to display it. | |
12958 | <P> | |
12959 | ||
12960 | <LI> | |
12961 | Bash implements <CODE>csh</CODE>-like history expansion | |
12962 | (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>). | |
12963 | <P> | |
12964 | ||
12965 | <LI> | |
12966 | Bash has one-dimensional array variables (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), and the | |
12967 | appropriate variable expansions and assignment syntax to use them. | |
12968 | Several of the Bash builtins take options to act on arrays. | |
12969 | Bash provides a number of built-in array variables. | |
12970 | <P> | |
12971 | ||
12972 | <LI> | |
12973 | The <CODE>$'<small>...</small>'</CODE> quoting syntax, which expands ANSI-C | |
12974 | backslash-escaped characters in the text between the single quotes, | |
12975 | is supported (see section <A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>). | |
12976 | <P> | |
12977 | ||
12978 | <LI> | |
12979 | Bash supports the <CODE>$"<small>...</small>"</CODE> quoting syntax to do | |
12980 | locale-specific translation of the characters between the double | |
12981 | quotes. The <SAMP>`-D'</SAMP>, <SAMP>`--dump-strings'</SAMP>, and <SAMP>`--dump-po-strings'</SAMP> | |
12982 | invocation options list the translatable strings found in a script | |
12983 | (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>). | |
12984 | <P> | |
12985 | ||
12986 | <LI> | |
12987 | Bash implements the <CODE>!</CODE> keyword to negate the return value of | |
12988 | a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). | |
12989 | Very useful when an <CODE>if</CODE> statement needs to act only if a test fails. | |
12990 | The Bash <SAMP>`-o pipefail'</SAMP> option to <CODE>set</CODE> will cause a pipeline to | |
12991 | return a failure status if any command fails. | |
12992 | <P> | |
12993 | ||
12994 | <LI> | |
12995 | Bash has the <CODE>time</CODE> reserved word and command timing (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). | |
12996 | The display of the timing statistics may be controlled with the | |
12997 | <CODE>TIMEFORMAT</CODE> variable. | |
12998 | <P> | |
12999 | ||
13000 | <LI> | |
13001 | Bash implements the <CODE>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> ))</CODE> | |
13002 | arithmetic for command, similar to the C language (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>). | |
13003 | <P> | |
13004 | ||
13005 | <LI> | |
13006 | Bash includes the <CODE>select</CODE> compound command, which allows the | |
13007 | generation of simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). | |
13008 | <P> | |
13009 | ||
13010 | <LI> | |
13011 | Bash includes the <CODE>[[</CODE> compound command, which makes conditional | |
13012 | testing part of the shell grammar (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), including | |
13013 | optional regular expression matching. | |
13014 | <P> | |
13015 | ||
13016 | <LI> | |
13017 | Bash provides optional case-insensitive matching for the <CODE>case</CODE> and | |
13018 | <CODE>[[</CODE> constructs. | |
13019 | <P> | |
13020 | ||
13021 | <LI> | |
13022 | Bash includes brace expansion (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>) and tilde | |
13023 | expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>). | |
13024 | <P> | |
13025 | ||
13026 | <LI> | |
13027 | Bash implements command aliases and the <CODE>alias</CODE> and <CODE>unalias</CODE> | |
13028 | builtins (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>). | |
13029 | <P> | |
13030 | ||
13031 | <LI> | |
13032 | Bash provides shell arithmetic, the <CODE>((</CODE> compound command | |
13033 | (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), | |
13034 | and arithmetic expansion (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>). | |
13035 | <P> | |
13036 | ||
13037 | <LI> | |
13038 | Variables present in the shell's initial environment are automatically | |
13039 | exported to child processes. The Bourne shell does not normally do | |
13040 | this unless the variables are explicitly marked using the <CODE>export</CODE> | |
13041 | command. | |
13042 | <P> | |
13043 | ||
13044 | <LI> | |
13045 | Bash supports the <SAMP>`+='</SAMP> assignment operator, which appends to the value | |
13046 | of the variable named on the left hand side. | |
13047 | <P> | |
13048 | ||
13049 | <LI> | |
13050 | Bash includes the POSIX pattern removal <SAMP>`%'</SAMP>, <SAMP>`#'</SAMP>, <SAMP>`%%'</SAMP> | |
13051 | and <SAMP>`##'</SAMP> expansions to remove leading or trailing substrings from | |
13052 | variable values (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13053 | <P> | |
13054 | ||
13055 | <LI> | |
13056 | The expansion <CODE>${#xx}</CODE>, which returns the length of <CODE>${xx}</CODE>, | |
13057 | is supported (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13058 | <P> | |
13059 | ||
13060 | <LI> | |
13061 | The expansion <CODE>${var:</CODE><VAR>offset</VAR><CODE>[:</CODE><VAR>length</VAR><CODE>]}</CODE>, | |
13062 | which expands to the substring of <CODE>var</CODE>'s value of length | |
13063 | <VAR>length</VAR>, beginning at <VAR>offset</VAR>, is present | |
13064 | (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13065 | <P> | |
13066 | ||
13067 | <LI> | |
13068 | The expansion | |
13069 | <CODE>${var/[/]</CODE><VAR>pattern</VAR><CODE>[/</CODE><VAR>replacement</VAR><CODE>]}</CODE>, | |
13070 | which matches <VAR>pattern</VAR> and replaces it with <VAR>replacement</VAR> in | |
13071 | the value of <CODE>var</CODE>, is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13072 | <P> | |
13073 | ||
13074 | <LI> | |
13075 | The expansion <CODE>${!<VAR>prefix}*</VAR></CODE> expansion, which expands to | |
13076 | the names of all shell variables whose names begin with <VAR>prefix</VAR>, | |
13077 | is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13078 | <P> | |
13079 | ||
13080 | <LI> | |
13081 | Bash has <VAR>indirect</VAR> variable expansion using <CODE>${!word}</CODE> | |
13082 | (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>). | |
13083 | <P> | |
13084 | ||
13085 | <LI> | |
13086 | Bash can expand positional parameters beyond <CODE>$9</CODE> using | |
13087 | <CODE>${<VAR>num</VAR>}</CODE>. | |
13088 | <P> | |
13089 | ||
13090 | <LI> | |
13091 | The POSIX <CODE>$()</CODE> form of command substitution | |
13092 | is implemented (see section <A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A>), | |
13093 | and preferred to the Bourne shell's <CODE>"</CODE> (which | |
13094 | is also implemented for backwards compatibility). | |
13095 | <P> | |
13096 | ||
13097 | <LI> | |
13098 | Bash has process substitution (see section <A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>). | |
13099 | <P> | |
13100 | ||
13101 | <LI> | |
13102 | Bash automatically assigns variables that provide information about the | |
13103 | current user (<CODE>UID</CODE>, <CODE>EUID</CODE>, and <CODE>GROUPS</CODE>), the current host | |
13104 | (<CODE>HOSTTYPE</CODE>, <CODE>OSTYPE</CODE>, <CODE>MACHTYPE</CODE>, and <CODE>HOSTNAME</CODE>), | |
13105 | and the instance of Bash that is running (<CODE>BASH</CODE>, | |
13106 | <CODE>BASH_VERSION</CODE>, and <CODE>BASH_VERSINFO</CODE>). See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, | |
13107 | for details. | |
13108 | <P> | |
13109 | ||
13110 | <LI> | |
13111 | The <CODE>IFS</CODE> variable is used to split only the results of expansion, | |
13112 | not all words (see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>). | |
13113 | This closes a longstanding shell security hole. | |
13114 | <P> | |
13115 | ||
13116 | <LI> | |
13117 | Bash implements the full set of POSIX filename expansion operators, | |
13118 | including <VAR>character classes</VAR>, <VAR>equivalence classes</VAR>, and | |
13119 | <VAR>collating symbols</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). | |
13120 | <P> | |
13121 | ||
13122 | <LI> | |
13123 | Bash implements extended pattern matching features when the <CODE>extglob</CODE> | |
13124 | shell option is enabled (see section <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>). | |
13125 | <P> | |
13126 | ||
13127 | <LI> | |
13128 | It is possible to have a variable and a function with the same name; | |
13129 | <CODE>sh</CODE> does not separate the two name spaces. | |
13130 | <P> | |
13131 | ||
13132 | <LI> | |
13133 | Bash functions are permitted to have local variables using the | |
13134 | <CODE>local</CODE> builtin, and thus useful recursive functions may be written | |
13135 | (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13136 | <P> | |
13137 | ||
13138 | <LI> | |
13139 | Variable assignments preceding commands affect only that command, even | |
13140 | builtins and functions (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>). | |
13141 | In <CODE>sh</CODE>, all variable assignments | |
13142 | preceding commands are global unless the command is executed from the | |
13143 | file system. | |
13144 | <P> | |
13145 | ||
13146 | <LI> | |
13147 | Bash performs filename expansion on filenames specified as operands | |
13148 | to input and output redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
13149 | <P> | |
13150 | ||
13151 | <LI> | |
13152 | Bash contains the <SAMP>`<>'</SAMP> redirection operator, allowing a file to be | |
13153 | opened for both reading and writing, and the <SAMP>`&>'</SAMP> redirection | |
13154 | operator, for directing standard output and standard error to the same | |
13155 | file (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
13156 | <P> | |
13157 | ||
13158 | <LI> | |
13159 | Bash includes the <SAMP>`<<<'</SAMP> redirection operator, allowing a string to | |
13160 | be used as the standard input to a command. | |
13161 | <P> | |
13162 | ||
13163 | <LI> | |
13164 | Bash implements the <SAMP>`[n]<&<VAR>word</VAR>'</SAMP> and <SAMP>`[n]>&<VAR>word</VAR>'</SAMP> | |
13165 | redirection operators, which move one file descriptor to another. | |
13166 | <P> | |
13167 | ||
13168 | <LI> | |
13169 | Bash treats a number of filenames specially when they are | |
13170 | used in redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
13171 | <P> | |
13172 | ||
13173 | <LI> | |
13174 | Bash can open network connections to arbitrary machines and services | |
13175 | with the redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>). | |
13176 | <P> | |
13177 | ||
13178 | <LI> | |
13179 | The <CODE>noclobber</CODE> option is available to avoid overwriting existing | |
13180 | files with output redirection (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
13181 | The <SAMP>`>|'</SAMP> redirection operator may be used to override <CODE>noclobber</CODE>. | |
13182 | <P> | |
13183 | ||
13184 | <LI> | |
13185 | The Bash <CODE>cd</CODE> and <CODE>pwd</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) | |
13186 | each take <SAMP>`-L'</SAMP> and <SAMP>`-P'</SAMP> options to switch between logical and | |
13187 | physical modes. | |
13188 | <P> | |
13189 | ||
13190 | <LI> | |
13191 | Bash allows a function to override a builtin with the same name, and provides | |
13192 | access to that builtin's functionality within the function via the | |
13193 | <CODE>builtin</CODE> and <CODE>command</CODE> builtins (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13194 | <P> | |
13195 | ||
13196 | <LI> | |
13197 | The <CODE>command</CODE> builtin allows selective disabling of functions | |
13198 | when command lookup is performed (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13199 | <P> | |
13200 | ||
13201 | <LI> | |
13202 | Individual builtins may be enabled or disabled using the <CODE>enable</CODE> | |
13203 | builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13204 | <P> | |
13205 | ||
13206 | <LI> | |
13207 | The Bash <CODE>exec</CODE> builtin takes additional options that allow users | |
13208 | to control the contents of the environment passed to the executed | |
13209 | command, and what the zeroth argument to the command is to be | |
13210 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
13211 | <P> | |
13212 | ||
13213 | <LI> | |
13214 | Shell functions may be exported to children via the environment | |
13215 | using <CODE>export -f</CODE> (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>). | |
13216 | <P> | |
13217 | ||
13218 | <LI> | |
13219 | The Bash <CODE>export</CODE>, <CODE>readonly</CODE>, and <CODE>declare</CODE> builtins can | |
13220 | take a <SAMP>`-f'</SAMP> option to act on shell functions, a <SAMP>`-p'</SAMP> option to | |
13221 | display variables with various attributes set in a format that can be | |
13222 | used as shell input, a <SAMP>`-n'</SAMP> option to remove various variable | |
13223 | attributes, and <SAMP>`name=value'</SAMP> arguments to set variable attributes | |
13224 | and values simultaneously. | |
13225 | <P> | |
13226 | ||
13227 | <LI> | |
13228 | The Bash <CODE>hash</CODE> builtin allows a name to be associated with | |
13229 | an arbitrary filename, even when that filename cannot be found by | |
13230 | searching the <CODE>$PATH</CODE>, using <SAMP>`hash -p'</SAMP> | |
13231 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
13232 | <P> | |
13233 | ||
13234 | <LI> | |
13235 | Bash includes a <CODE>help</CODE> builtin for quick reference to shell | |
13236 | facilities (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13237 | <P> | |
13238 | ||
13239 | <LI> | |
13240 | The <CODE>printf</CODE> builtin is available to display formatted output | |
13241 | (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13242 | <P> | |
13243 | ||
13244 | <LI> | |
13245 | The Bash <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>) | |
13246 | will read a line ending in <SAMP>`\'</SAMP> with | |
13247 | the <SAMP>`-r'</SAMP> option, and will use the <CODE>REPLY</CODE> variable as a | |
13248 | default if no non-option arguments are supplied. | |
13249 | The Bash <CODE>read</CODE> builtin | |
13250 | also accepts a prompt string with the <SAMP>`-p'</SAMP> option and will use | |
13251 | Readline to obtain the line when given the <SAMP>`-e'</SAMP> option. | |
13252 | The <CODE>read</CODE> builtin also has additional options to control input: | |
13253 | the <SAMP>`-s'</SAMP> option will turn off echoing of input characters as | |
13254 | they are read, the <SAMP>`-t'</SAMP> option will allow <CODE>read</CODE> to time out | |
13255 | if input does not arrive within a specified number of seconds, the | |
13256 | <SAMP>`-n'</SAMP> option will allow reading only a specified number of | |
13257 | characters rather than a full line, and the <SAMP>`-d'</SAMP> option will read | |
13258 | until a particular character rather than newline. | |
13259 | <P> | |
13260 | ||
13261 | <LI> | |
13262 | The <CODE>return</CODE> builtin may be used to abort execution of scripts | |
13263 | executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins | |
13264 | (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
13265 | <P> | |
13266 | ||
13267 | <LI> | |
13268 | Bash includes the <CODE>shopt</CODE> builtin, for finer control of shell | |
13269 | optional capabilities (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), and allows these options | |
13270 | to be set and unset at shell invocation (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>). | |
13271 | <P> | |
13272 | ||
13273 | <LI> | |
13274 | Bash has much more optional behavior controllable with the <CODE>set</CODE> | |
13275 | builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
13276 | <P> | |
13277 | ||
13278 | <LI> | |
13279 | The <SAMP>`-x'</SAMP> (<CODE>xtrace</CODE>) option displays commands other than | |
13280 | simple commands when performing an execution trace | |
13281 | (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>). | |
13282 | <P> | |
13283 | ||
13284 | <LI> | |
13285 | The <CODE>test</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) | |
13286 | is slightly different, as it implements the POSIX algorithm, | |
13287 | which specifies the behavior based on the number of arguments. | |
13288 | <P> | |
13289 | ||
13290 | <LI> | |
13291 | Bash includes the <CODE>caller</CODE> builtin, which displays the context of | |
13292 | any active subroutine call (a shell function or a script executed with | |
13293 | the <CODE>.</CODE> or <CODE>source</CODE> builtins). This supports the bash | |
13294 | debugger. | |
13295 | <P> | |
13296 | ||
13297 | <LI> | |
13298 | The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a | |
13299 | <CODE>DEBUG</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE>. | |
13300 | Commands specified with a <CODE>DEBUG</CODE> trap are executed before every | |
13301 | simple command, <CODE>for</CODE> command, <CODE>case</CODE> command, | |
13302 | <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before | |
13303 | the first command executes in a shell function. | |
13304 | The <CODE>DEBUG</CODE> trap is not inherited by shell functions unless the | |
13305 | function has been given the <CODE>trace</CODE> attribute or the | |
13306 | <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin. | |
13307 | The <CODE>extdebug</CODE> shell option has additional effects on the | |
13308 | <CODE>DEBUG</CODE> trap. | |
13309 | <P> | |
13310 | ||
13311 | The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows an | |
13312 | <CODE>ERR</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>. | |
13313 | Commands specified with an <CODE>ERR</CODE> trap are executed after a simple | |
13314 | command fails, with a few exceptions. | |
13315 | The <CODE>ERR</CODE> trap is not inherited by shell functions unless the | |
13316 | <CODE>-o errtrace</CODE> option to the <CODE>set</CODE> builtin is enabled. | |
13317 | </P><P> | |
13318 | ||
13319 | The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a | |
13320 | <CODE>RETURN</CODE> pseudo-signal specification, similar to | |
13321 | <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>. | |
13322 | Commands specified with an <CODE>RETURN</CODE> trap are executed before | |
13323 | execution resumes after a shell function or a shell script executed with | |
13324 | <CODE>.</CODE> or <CODE>source</CODE> returns. | |
13325 | The <CODE>RETURN</CODE> trap is not inherited by shell functions unless the | |
13326 | function has been given the <CODE>trace</CODE> attribute or the | |
13327 | <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin. | |
13328 | </P><P> | |
13329 | ||
13330 | <LI> | |
13331 | The Bash <CODE>type</CODE> builtin is more extensive and gives more information | |
13332 | about the names it finds (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>). | |
13333 | <P> | |
13334 | ||
13335 | <LI> | |
13336 | The Bash <CODE>umask</CODE> builtin permits a <SAMP>`-p'</SAMP> option to cause | |
13337 | the output to be displayed in the form of a <CODE>umask</CODE> command | |
13338 | that may be reused as input (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>). | |
13339 | <P> | |
13340 | ||
13341 | <LI> | |
13342 | Bash implements a <CODE>csh</CODE>-like directory stack, and provides the | |
13343 | <CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins to manipulate it | |
13344 | (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>). | |
13345 | Bash also makes the directory stack visible as the value of the | |
13346 | <CODE>DIRSTACK</CODE> shell variable. | |
13347 | <P> | |
13348 | ||
13349 | <LI> | |
13350 | Bash interprets special backslash-escaped characters in the prompt | |
13351 | strings when interactive (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>). | |
13352 | <P> | |
13353 | ||
13354 | <LI> | |
13355 | The Bash restricted mode is more useful (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>); | |
13356 | the SVR4.2 shell restricted mode is too limited. | |
13357 | <P> | |
13358 | ||
13359 | <LI> | |
13360 | The <CODE>disown</CODE> builtin can remove a job from the internal shell | |
13361 | job table (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or suppress the sending | |
13362 | of <CODE>SIGHUP</CODE> to a job when the shell exits as the result of a | |
13363 | <CODE>SIGHUP</CODE>. | |
13364 | <P> | |
13365 | ||
13366 | <LI> | |
13367 | Bash includes a number of features to support a separate debugger for | |
13368 | shell scripts. | |
13369 | <P> | |
13370 | ||
13371 | <LI> | |
13372 | The SVR4.2 shell has two privilege-related builtins | |
13373 | (<CODE>mldmode</CODE> and <CODE>priv</CODE>) not present in Bash. | |
13374 | <P> | |
13375 | ||
13376 | <LI> | |
13377 | Bash does not have the <CODE>stop</CODE> or <CODE>newgrp</CODE> builtins. | |
13378 | <P> | |
13379 | ||
13380 | <LI> | |
13381 | Bash does not use the <CODE>SHACCT</CODE> variable or perform shell accounting. | |
13382 | <P> | |
13383 | ||
13384 | <LI> | |
13385 | The SVR4.2 <CODE>sh</CODE> uses a <CODE>TIMEOUT</CODE> variable like Bash uses | |
13386 | <CODE>TMOUT</CODE>. | |
13387 | <P> | |
13388 | ||
13389 | </UL> | |
13390 | <P> | |
13391 | ||
13392 | More features unique to Bash may be found in <A HREF="bashref.html#SEC68">6. Bash Features</A>. | |
13393 | </P><P> | |
13394 | ||
13395 | <HR SIZE="6"> | |
13396 | <A NAME="SEC137"></A> | |
13397 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
13398 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> < </A>]</TD> | |
13399 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> > </A>]</TD> | |
13400 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> << </A>]</TD> | |
13401 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> Up </A>]</TD> | |
13402 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> >> </A>]</TD> | |
13403 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
13404 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
13405 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
13406 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
13407 | </TR></TABLE> | |
13408 | <H2> B.1 Implementation Differences From The SVR4.2 Shell </H2> | |
13409 | <!--docid::SEC137::--> | |
13410 | <P> | |
13411 | ||
13412 | Since Bash is a completely new implementation, it does not suffer from | |
13413 | many of the limitations of the SVR4.2 shell. For instance: | |
13414 | </P><P> | |
13415 | ||
13416 | <UL> | |
13417 | ||
13418 | <LI> | |
13419 | Bash does not fork a subshell when redirecting into or out of | |
13420 | a shell control structure such as an <CODE>if</CODE> or <CODE>while</CODE> | |
13421 | statement. | |
13422 | <P> | |
13423 | ||
13424 | <LI> | |
13425 | Bash does not allow unbalanced quotes. The SVR4.2 shell will silently | |
13426 | insert a needed closing quote at <CODE>EOF</CODE> under certain circumstances. | |
13427 | This can be the cause of some hard-to-find errors. | |
13428 | <P> | |
13429 | ||
13430 | <LI> | |
13431 | The SVR4.2 shell uses a baroque memory management scheme based on | |
13432 | trapping <CODE>SIGSEGV</CODE>. If the shell is started from a process with | |
13433 | <CODE>SIGSEGV</CODE> blocked (e.g., by using the <CODE>system()</CODE> C library | |
13434 | function call), it misbehaves badly. | |
13435 | <P> | |
13436 | ||
13437 | <LI> | |
13438 | In a questionable attempt at security, the SVR4.2 shell, | |
13439 | when invoked without the <SAMP>`-p'</SAMP> option, will alter its real | |
13440 | and effective UID and GID if they are less than some | |
13441 | magic threshold value, commonly 100. | |
13442 | This can lead to unexpected results. | |
13443 | <P> | |
13444 | ||
13445 | <LI> | |
13446 | The SVR4.2 shell does not allow users to trap <CODE>SIGSEGV</CODE>, | |
13447 | <CODE>SIGALRM</CODE>, or <CODE>SIGCHLD</CODE>. | |
13448 | <P> | |
13449 | ||
13450 | <LI> | |
13451 | The SVR4.2 shell does not allow the <CODE>IFS</CODE>, <CODE>MAILCHECK</CODE>, | |
13452 | <CODE>PATH</CODE>, <CODE>PS1</CODE>, or <CODE>PS2</CODE> variables to be unset. | |
13453 | <P> | |
13454 | ||
13455 | <LI> | |
13456 | The SVR4.2 shell treats <SAMP>`^'</SAMP> as the undocumented equivalent of | |
13457 | <SAMP>`|'</SAMP>. | |
13458 | <P> | |
13459 | ||
13460 | <LI> | |
13461 | Bash allows multiple option arguments when it is invoked (<CODE>-x -v</CODE>); | |
13462 | the SVR4.2 shell allows only one option argument (<CODE>-xv</CODE>). In | |
13463 | fact, some versions of the shell dump core if the second argument begins | |
13464 | with a <SAMP>`-'</SAMP>. | |
13465 | <P> | |
13466 | ||
13467 | <LI> | |
13468 | The SVR4.2 shell exits a script if any builtin fails; Bash exits | |
13469 | a script only if one of the POSIX special builtins fails, and | |
13470 | only for certain failures, as enumerated in the POSIX standard. | |
13471 | <P> | |
13472 | ||
13473 | <LI> | |
13474 | The SVR4.2 shell behaves differently when invoked as <CODE>jsh</CODE> | |
13475 | (it turns on job control). | |
13476 | </UL> | |
13477 | <P> | |
13478 | ||
13479 | <A NAME="GNU Free Documentation License"></A> | |
13480 | <HR SIZE="6"> | |
13481 | <A NAME="SEC138"></A> | |
13482 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
13483 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> < </A>]</TD> | |
13484 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> > </A>]</TD> | |
13485 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> << </A>]</TD> | |
13486 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
13487 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> >> </A>]</TD> | |
13488 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
13489 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
13490 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
13491 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
13492 | </TR></TABLE> | |
13493 | <H1> C. GNU Free Documentation License </H1> | |
13494 | <!--docid::SEC138::--> | |
13495 | <P> | |
13496 | ||
13497 | <center> | |
13498 | Version 1.2, November 2002 | |
13499 | </center> | |
13500 | </P><P> | |
13501 | ||
13502 | <TABLE><tr><td> </td><td class=display><pre style="font-family: serif">Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. | |
13503 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA | |
13504 | ||
13505 | Everyone is permitted to copy and distribute verbatim copies | |
13506 | of this license document, but changing it is not allowed. | |
13507 | </pre></td></tr></table></P><P> | |
13508 | ||
13509 | <OL> | |
13510 | <LI> | |
13511 | PREAMBLE | |
13512 | <P> | |
13513 | ||
13514 | The purpose of this License is to make a manual, textbook, or other | |
13515 | functional and useful document <EM>free</EM> in the sense of freedom: to | |
13516 | assure everyone the effective freedom to copy and redistribute it, | |
13517 | with or without modifying it, either commercially or noncommercially. | |
13518 | Secondarily, this License preserves for the author and publisher a way | |
13519 | to get credit for their work, while not being considered responsible | |
13520 | for modifications made by others. | |
13521 | </P><P> | |
13522 | ||
13523 | This License is a kind of "copyleft", which means that derivative | |
13524 | works of the document must themselves be free in the same sense. It | |
13525 | complements the GNU General Public License, which is a copyleft | |
13526 | license designed for free software. | |
13527 | </P><P> | |
13528 | ||
13529 | We have designed this License in order to use it for manuals for free | |
13530 | software, because free software needs free documentation: a free | |
13531 | program should come with manuals providing the same freedoms that the | |
13532 | software does. But this License is not limited to software manuals; | |
13533 | it can be used for any textual work, regardless of subject matter or | |
13534 | whether it is published as a printed book. We recommend this License | |
13535 | principally for works whose purpose is instruction or reference. | |
13536 | </P><P> | |
13537 | ||
13538 | <LI> | |
13539 | APPLICABILITY AND DEFINITIONS | |
13540 | <P> | |
13541 | ||
13542 | This License applies to any manual or other work, in any medium, that | |
13543 | contains a notice placed by the copyright holder saying it can be | |
13544 | distributed under the terms of this License. Such a notice grants a | |
13545 | world-wide, royalty-free license, unlimited in duration, to use that | |
13546 | work under the conditions stated herein. The "Document", below, | |
13547 | refers to any such manual or work. Any member of the public is a | |
13548 | licensee, and is addressed as "you". You accept the license if you | |
13549 | copy, modify or distribute the work in a way requiring permission | |
13550 | under copyright law. | |
13551 | </P><P> | |
13552 | ||
13553 | A "Modified Version" of the Document means any work containing the | |
13554 | Document or a portion of it, either copied verbatim, or with | |
13555 | modifications and/or translated into another language. | |
13556 | </P><P> | |
13557 | ||
13558 | A "Secondary Section" is a named appendix or a front-matter section | |
13559 | of the Document that deals exclusively with the relationship of the | |
13560 | publishers or authors of the Document to the Document's overall | |
13561 | subject (or to related matters) and contains nothing that could fall | |
13562 | directly within that overall subject. (Thus, if the Document is in | |
13563 | part a textbook of mathematics, a Secondary Section may not explain | |
13564 | any mathematics.) The relationship could be a matter of historical | |
13565 | connection with the subject or with related matters, or of legal, | |
13566 | commercial, philosophical, ethical or political position regarding | |
13567 | them. | |
13568 | </P><P> | |
13569 | ||
13570 | The "Invariant Sections" are certain Secondary Sections whose titles | |
13571 | are designated, as being those of Invariant Sections, in the notice | |
13572 | that says that the Document is released under this License. If a | |
13573 | section does not fit the above definition of Secondary then it is not | |
13574 | allowed to be designated as Invariant. The Document may contain zero | |
13575 | Invariant Sections. If the Document does not identify any Invariant | |
13576 | Sections then there are none. | |
13577 | </P><P> | |
13578 | ||
13579 | The "Cover Texts" are certain short passages of text that are listed, | |
13580 | as Front-Cover Texts or Back-Cover Texts, in the notice that says that | |
13581 | the Document is released under this License. A Front-Cover Text may | |
13582 | be at most 5 words, and a Back-Cover Text may be at most 25 words. | |
13583 | </P><P> | |
13584 | ||
13585 | A "Transparent" copy of the Document means a machine-readable copy, | |
13586 | represented in a format whose specification is available to the | |
13587 | general public, that is suitable for revising the document | |
13588 | straightforwardly with generic text editors or (for images composed of | |
13589 | pixels) generic paint programs or (for drawings) some widely available | |
13590 | drawing editor, and that is suitable for input to text formatters or | |
13591 | for automatic translation to a variety of formats suitable for input | |
13592 | to text formatters. A copy made in an otherwise Transparent file | |
13593 | format whose markup, or absence of markup, has been arranged to thwart | |
13594 | or discourage subsequent modification by readers is not Transparent. | |
13595 | An image format is not Transparent if used for any substantial amount | |
13596 | of text. A copy that is not "Transparent" is called "Opaque". | |
13597 | </P><P> | |
13598 | ||
13599 | Examples of suitable formats for Transparent copies include plain | |
13600 | ASCII without markup, Texinfo input format, LaTeX input | |
13601 | format, <FONT SIZE="-1">SGML</FONT> or <FONT SIZE="-1">XML</FONT> using a publicly available | |
13602 | <FONT SIZE="-1">DTD</FONT>, and standard-conforming simple <FONT SIZE="-1">HTML</FONT>, | |
13603 | PostScript or <FONT SIZE="-1">PDF</FONT> designed for human modification. Examples | |
13604 | of transparent image formats include <FONT SIZE="-1">PNG</FONT>, <FONT SIZE="-1">XCF</FONT> and | |
13605 | <FONT SIZE="-1">JPG</FONT>. Opaque formats include proprietary formats that can be | |
13606 | read and edited only by proprietary word processors, <FONT SIZE="-1">SGML</FONT> or | |
13607 | <FONT SIZE="-1">XML</FONT> for which the <FONT SIZE="-1">DTD</FONT> and/or processing tools are | |
13608 | not generally available, and the machine-generated <FONT SIZE="-1">HTML</FONT>, | |
13609 | PostScript or <FONT SIZE="-1">PDF</FONT> produced by some word processors for | |
13610 | output purposes only. | |
13611 | </P><P> | |
13612 | ||
13613 | The "Title Page" means, for a printed book, the title page itself, | |
13614 | plus such following pages as are needed to hold, legibly, the material | |
13615 | this License requires to appear in the title page. For works in | |
13616 | formats which do not have any title page as such, "Title Page" means | |
13617 | the text near the most prominent appearance of the work's title, | |
13618 | preceding the beginning of the body of the text. | |
13619 | </P><P> | |
13620 | ||
13621 | A section "Entitled XYZ" means a named subunit of the Document whose | |
13622 | title either is precisely XYZ or contains XYZ in parentheses following | |
13623 | text that translates XYZ in another language. (Here XYZ stands for a | |
13624 | specific section name mentioned below, such as "Acknowledgements", | |
13625 | "Dedications", "Endorsements", or "History".) To "Preserve the Title" | |
13626 | of such a section when you modify the Document means that it remains a | |
13627 | section "Entitled XYZ" according to this definition. | |
13628 | </P><P> | |
13629 | ||
13630 | The Document may include Warranty Disclaimers next to the notice which | |
13631 | states that this License applies to the Document. These Warranty | |
13632 | Disclaimers are considered to be included by reference in this | |
13633 | License, but only as regards disclaiming warranties: any other | |
13634 | implication that these Warranty Disclaimers may have is void and has | |
13635 | no effect on the meaning of this License. | |
13636 | </P><P> | |
13637 | ||
13638 | <LI> | |
13639 | VERBATIM COPYING | |
13640 | <P> | |
13641 | ||
13642 | You may copy and distribute the Document in any medium, either | |
13643 | commercially or noncommercially, provided that this License, the | |
13644 | copyright notices, and the license notice saying this License applies | |
13645 | to the Document are reproduced in all copies, and that you add no other | |
13646 | conditions whatsoever to those of this License. You may not use | |
13647 | technical measures to obstruct or control the reading or further | |
13648 | copying of the copies you make or distribute. However, you may accept | |
13649 | compensation in exchange for copies. If you distribute a large enough | |
13650 | number of copies you must also follow the conditions in section 3. | |
13651 | </P><P> | |
13652 | ||
13653 | You may also lend copies, under the same conditions stated above, and | |
13654 | you may publicly display copies. | |
13655 | </P><P> | |
13656 | ||
13657 | <LI> | |
13658 | COPYING IN QUANTITY | |
13659 | <P> | |
13660 | ||
13661 | If you publish printed copies (or copies in media that commonly have | |
13662 | printed covers) of the Document, numbering more than 100, and the | |
13663 | Document's license notice requires Cover Texts, you must enclose the | |
13664 | copies in covers that carry, clearly and legibly, all these Cover | |
13665 | Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on | |
13666 | the back cover. Both covers must also clearly and legibly identify | |
13667 | you as the publisher of these copies. The front cover must present | |
13668 | the full title with all words of the title equally prominent and | |
13669 | visible. You may add other material on the covers in addition. | |
13670 | Copying with changes limited to the covers, as long as they preserve | |
13671 | the title of the Document and satisfy these conditions, can be treated | |
13672 | as verbatim copying in other respects. | |
13673 | </P><P> | |
13674 | ||
13675 | If the required texts for either cover are too voluminous to fit | |
13676 | legibly, you should put the first ones listed (as many as fit | |
13677 | reasonably) on the actual cover, and continue the rest onto adjacent | |
13678 | pages. | |
13679 | </P><P> | |
13680 | ||
13681 | If you publish or distribute Opaque copies of the Document numbering | |
13682 | more than 100, you must either include a machine-readable Transparent | |
13683 | copy along with each Opaque copy, or state in or with each Opaque copy | |
13684 | a computer-network location from which the general network-using | |
13685 | public has access to download using public-standard network protocols | |
13686 | a complete Transparent copy of the Document, free of added material. | |
13687 | If you use the latter option, you must take reasonably prudent steps, | |
13688 | when you begin distribution of Opaque copies in quantity, to ensure | |
13689 | that this Transparent copy will remain thus accessible at the stated | |
13690 | location until at least one year after the last time you distribute an | |
13691 | Opaque copy (directly or through your agents or retailers) of that | |
13692 | edition to the public. | |
13693 | </P><P> | |
13694 | ||
13695 | It is requested, but not required, that you contact the authors of the | |
13696 | Document well before redistributing any large number of copies, to give | |
13697 | them a chance to provide you with an updated version of the Document. | |
13698 | </P><P> | |
13699 | ||
13700 | <LI> | |
13701 | MODIFICATIONS | |
13702 | <P> | |
13703 | ||
13704 | You may copy and distribute a Modified Version of the Document under | |
13705 | the conditions of sections 2 and 3 above, provided that you release | |
13706 | the Modified Version under precisely this License, with the Modified | |
13707 | Version filling the role of the Document, thus licensing distribution | |
13708 | and modification of the Modified Version to whoever possesses a copy | |
13709 | of it. In addition, you must do these things in the Modified Version: | |
13710 | </P><P> | |
13711 | ||
13712 | <OL> | |
13713 | <LI> | |
13714 | Use in the Title Page (and on the covers, if any) a title distinct | |
13715 | from that of the Document, and from those of previous versions | |
13716 | (which should, if there were any, be listed in the History section | |
13717 | of the Document). You may use the same title as a previous version | |
13718 | if the original publisher of that version gives permission. | |
13719 | <P> | |
13720 | ||
13721 | <LI> | |
13722 | List on the Title Page, as authors, one or more persons or entities | |
13723 | responsible for authorship of the modifications in the Modified | |
13724 | Version, together with at least five of the principal authors of the | |
13725 | Document (all of its principal authors, if it has fewer than five), | |
13726 | unless they release you from this requirement. | |
13727 | <P> | |
13728 | ||
13729 | <LI> | |
13730 | State on the Title page the name of the publisher of the | |
13731 | Modified Version, as the publisher. | |
13732 | <P> | |
13733 | ||
13734 | <LI> | |
13735 | Preserve all the copyright notices of the Document. | |
13736 | <P> | |
13737 | ||
13738 | <LI> | |
13739 | Add an appropriate copyright notice for your modifications | |
13740 | adjacent to the other copyright notices. | |
13741 | <P> | |
13742 | ||
13743 | <LI> | |
13744 | Include, immediately after the copyright notices, a license notice | |
13745 | giving the public permission to use the Modified Version under the | |
13746 | terms of this License, in the form shown in the Addendum below. | |
13747 | <P> | |
13748 | ||
13749 | <LI> | |
13750 | Preserve in that license notice the full lists of Invariant Sections | |
13751 | and required Cover Texts given in the Document's license notice. | |
13752 | <P> | |
13753 | ||
13754 | <LI> | |
13755 | Include an unaltered copy of this License. | |
13756 | <P> | |
13757 | ||
13758 | <LI> | |
13759 | Preserve the section Entitled "History", Preserve its Title, and add | |
13760 | to it an item stating at least the title, year, new authors, and | |
13761 | publisher of the Modified Version as given on the Title Page. If | |
13762 | there is no section Entitled "History" in the Document, create one | |
13763 | stating the title, year, authors, and publisher of the Document as | |
13764 | given on its Title Page, then add an item describing the Modified | |
13765 | Version as stated in the previous sentence. | |
13766 | <P> | |
13767 | ||
13768 | <LI> | |
13769 | Preserve the network location, if any, given in the Document for | |
13770 | public access to a Transparent copy of the Document, and likewise | |
13771 | the network locations given in the Document for previous versions | |
13772 | it was based on. These may be placed in the "History" section. | |
13773 | You may omit a network location for a work that was published at | |
13774 | least four years before the Document itself, or if the original | |
13775 | publisher of the version it refers to gives permission. | |
13776 | <P> | |
13777 | ||
13778 | <LI> | |
13779 | For any section Entitled "Acknowledgements" or "Dedications", Preserve | |
13780 | the Title of the section, and preserve in the section all the | |
13781 | substance and tone of each of the contributor acknowledgements and/or | |
13782 | dedications given therein. | |
13783 | <P> | |
13784 | ||
13785 | <LI> | |
13786 | Preserve all the Invariant Sections of the Document, | |
13787 | unaltered in their text and in their titles. Section numbers | |
13788 | or the equivalent are not considered part of the section titles. | |
13789 | <P> | |
13790 | ||
13791 | <LI> | |
13792 | Delete any section Entitled "Endorsements". Such a section | |
13793 | may not be included in the Modified Version. | |
13794 | <P> | |
13795 | ||
13796 | <LI> | |
13797 | Do not retitle any existing section to be Entitled "Endorsements" or | |
13798 | to conflict in title with any Invariant Section. | |
13799 | <P> | |
13800 | ||
13801 | <LI> | |
13802 | Preserve any Warranty Disclaimers. | |
13803 | </OL> | |
13804 | <P> | |
13805 | ||
13806 | If the Modified Version includes new front-matter sections or | |
13807 | appendices that qualify as Secondary Sections and contain no material | |
13808 | copied from the Document, you may at your option designate some or all | |
13809 | of these sections as invariant. To do this, add their titles to the | |
13810 | list of Invariant Sections in the Modified Version's license notice. | |
13811 | These titles must be distinct from any other section titles. | |
13812 | </P><P> | |
13813 | ||
13814 | You may add a section Entitled "Endorsements", provided it contains | |
13815 | nothing but endorsements of your Modified Version by various | |
13816 | parties--for example, statements of peer review or that the text has | |
13817 | been approved by an organization as the authoritative definition of a | |
13818 | standard. | |
13819 | </P><P> | |
13820 | ||
13821 | You may add a passage of up to five words as a Front-Cover Text, and a | |
13822 | passage of up to 25 words as a Back-Cover Text, to the end of the list | |
13823 | of Cover Texts in the Modified Version. Only one passage of | |
13824 | Front-Cover Text and one of Back-Cover Text may be added by (or | |
13825 | through arrangements made by) any one entity. If the Document already | |
13826 | includes a cover text for the same cover, previously added by you or | |
13827 | by arrangement made by the same entity you are acting on behalf of, | |
13828 | you may not add another; but you may replace the old one, on explicit | |
13829 | permission from the previous publisher that added the old one. | |
13830 | </P><P> | |
13831 | ||
13832 | The author(s) and publisher(s) of the Document do not by this License | |
13833 | give permission to use their names for publicity for or to assert or | |
13834 | imply endorsement of any Modified Version. | |
13835 | </P><P> | |
13836 | ||
13837 | <LI> | |
13838 | COMBINING DOCUMENTS | |
13839 | <P> | |
13840 | ||
13841 | You may combine the Document with other documents released under this | |
13842 | License, under the terms defined in section 4 above for modified | |
13843 | versions, provided that you include in the combination all of the | |
13844 | Invariant Sections of all of the original documents, unmodified, and | |
13845 | list them all as Invariant Sections of your combined work in its | |
13846 | license notice, and that you preserve all their Warranty Disclaimers. | |
13847 | </P><P> | |
13848 | ||
13849 | The combined work need only contain one copy of this License, and | |
13850 | multiple identical Invariant Sections may be replaced with a single | |
13851 | copy. If there are multiple Invariant Sections with the same name but | |
13852 | different contents, make the title of each such section unique by | |
13853 | adding at the end of it, in parentheses, the name of the original | |
13854 | author or publisher of that section if known, or else a unique number. | |
13855 | Make the same adjustment to the section titles in the list of | |
13856 | Invariant Sections in the license notice of the combined work. | |
13857 | </P><P> | |
13858 | ||
13859 | In the combination, you must combine any sections Entitled "History" | |
13860 | in the various original documents, forming one section Entitled | |
13861 | "History"; likewise combine any sections Entitled "Acknowledgements", | |
13862 | and any sections Entitled "Dedications". You must delete all | |
13863 | sections Entitled "Endorsements." | |
13864 | </P><P> | |
13865 | ||
13866 | <LI> | |
13867 | COLLECTIONS OF DOCUMENTS | |
13868 | <P> | |
13869 | ||
13870 | You may make a collection consisting of the Document and other documents | |
13871 | released under this License, and replace the individual copies of this | |
13872 | License in the various documents with a single copy that is included in | |
13873 | the collection, provided that you follow the rules of this License for | |
13874 | verbatim copying of each of the documents in all other respects. | |
13875 | </P><P> | |
13876 | ||
13877 | You may extract a single document from such a collection, and distribute | |
13878 | it individually under this License, provided you insert a copy of this | |
13879 | License into the extracted document, and follow this License in all | |
13880 | other respects regarding verbatim copying of that document. | |
13881 | </P><P> | |
13882 | ||
13883 | <LI> | |
13884 | AGGREGATION WITH INDEPENDENT WORKS | |
13885 | <P> | |
13886 | ||
13887 | A compilation of the Document or its derivatives with other separate | |
13888 | and independent documents or works, in or on a volume of a storage or | |
13889 | distribution medium, is called an "aggregate" if the copyright | |
13890 | resulting from the compilation is not used to limit the legal rights | |
13891 | of the compilation's users beyond what the individual works permit. | |
13892 | When the Document is included in an aggregate, this License does not | |
13893 | apply to the other works in the aggregate which are not themselves | |
13894 | derivative works of the Document. | |
13895 | </P><P> | |
13896 | ||
13897 | If the Cover Text requirement of section 3 is applicable to these | |
13898 | copies of the Document, then if the Document is less than one half of | |
13899 | the entire aggregate, the Document's Cover Texts may be placed on | |
13900 | covers that bracket the Document within the aggregate, or the | |
13901 | electronic equivalent of covers if the Document is in electronic form. | |
13902 | Otherwise they must appear on printed covers that bracket the whole | |
13903 | aggregate. | |
13904 | </P><P> | |
13905 | ||
13906 | <LI> | |
13907 | TRANSLATION | |
13908 | <P> | |
13909 | ||
13910 | Translation is considered a kind of modification, so you may | |
13911 | distribute translations of the Document under the terms of section 4. | |
13912 | Replacing Invariant Sections with translations requires special | |
13913 | permission from their copyright holders, but you may include | |
13914 | translations of some or all Invariant Sections in addition to the | |
13915 | original versions of these Invariant Sections. You may include a | |
13916 | translation of this License, and all the license notices in the | |
13917 | Document, and any Warranty Disclaimers, provided that you also include | |
13918 | the original English version of this License and the original versions | |
13919 | of those notices and disclaimers. In case of a disagreement between | |
13920 | the translation and the original version of this License or a notice | |
13921 | or disclaimer, the original version will prevail. | |
13922 | </P><P> | |
13923 | ||
13924 | If a section in the Document is Entitled "Acknowledgements", | |
13925 | "Dedications", or "History", the requirement (section 4) to Preserve | |
13926 | its Title (section 1) will typically require changing the actual | |
13927 | title. | |
13928 | </P><P> | |
13929 | ||
13930 | <LI> | |
13931 | TERMINATION | |
13932 | <P> | |
13933 | ||
13934 | You may not copy, modify, sublicense, or distribute the Document except | |
13935 | as expressly provided for under this License. Any other attempt to | |
13936 | copy, modify, sublicense or distribute the Document is void, and will | |
13937 | automatically terminate your rights under this License. However, | |
13938 | parties who have received copies, or rights, from you under this | |
13939 | License will not have their licenses terminated so long as such | |
13940 | parties remain in full compliance. | |
13941 | </P><P> | |
13942 | ||
13943 | <LI> | |
13944 | FUTURE REVISIONS OF THIS LICENSE | |
13945 | <P> | |
13946 | ||
13947 | The Free Software Foundation may publish new, revised versions | |
13948 | of the GNU Free Documentation License from time to time. Such new | |
13949 | versions will be similar in spirit to the present version, but may | |
13950 | differ in detail to address new problems or concerns. See | |
13951 | <A HREF="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</A>. | |
13952 | </P><P> | |
13953 | ||
13954 | Each version of the License is given a distinguishing version number. | |
13955 | If the Document specifies that a particular numbered version of this | |
13956 | License "or any later version" applies to it, you have the option of | |
13957 | following the terms and conditions either of that specified version or | |
13958 | of any later version that has been published (not as a draft) by the | |
13959 | Free Software Foundation. If the Document does not specify a version | |
13960 | number of this License, you may choose any version ever published (not | |
13961 | as a draft) by the Free Software Foundation. | |
13962 | </OL> | |
13963 | <P> | |
13964 | ||
13965 | <A NAME="SEC139"></A> | |
13966 | <H2> ADDENDUM: How to use this License for your documents </H2> | |
13967 | <!--docid::SEC139::--> | |
13968 | <P> | |
13969 | ||
13970 | To use this License in a document you have written, include a copy of | |
13971 | the License in the document and put the following copyright and | |
13972 | license notices just after the title page: | |
13973 | </P><P> | |
13974 | ||
13975 | <TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> Copyright (C) <VAR>year</VAR> <VAR>your name</VAR>. | |
13976 | Permission is granted to copy, distribute and/or modify this document | |
13977 | under the terms of the GNU Free Documentation License, Version 1.2 | |
13978 | or any later version published by the Free Software Foundation; | |
13979 | with no Invariant Sections, no Front-Cover Texts, and no Back-Cover | |
13980 | Texts. A copy of the license is included in the section entitled ``GNU | |
13981 | Free Documentation License''. | |
13982 | </FONT></pre></td></tr></table></P><P> | |
13983 | ||
13984 | If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, | |
13985 | replace the "with<small>...</small>Texts." line with this: | |
13986 | </P><P> | |
13987 | ||
13988 | <TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> with the Invariant Sections being <VAR>list their titles</VAR>, with | |
13989 | the Front-Cover Texts being <VAR>list</VAR>, and with the Back-Cover Texts | |
13990 | being <VAR>list</VAR>. | |
13991 | </FONT></pre></td></tr></table></P><P> | |
13992 | ||
13993 | If you have Invariant Sections without Cover Texts, or some other | |
13994 | combination of the three, merge those two alternatives to suit the | |
13995 | situation. | |
13996 | </P><P> | |
13997 | ||
13998 | If your document contains nontrivial examples of program code, we | |
13999 | recommend releasing these examples in parallel under your choice of | |
14000 | free software license, such as the GNU General Public License, | |
14001 | to permit their use in free software. | |
14002 | </P><P> | |
14003 | ||
14004 | <A NAME="Indexes"></A> | |
14005 | <HR SIZE="6"> | |
14006 | <A NAME="SEC140"></A> | |
14007 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
14008 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> < </A>]</TD> | |
14009 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> > </A>]</TD> | |
14010 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
14011 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> | |
14012 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
14013 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
14014 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
14015 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
14016 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
14017 | </TR></TABLE> | |
14018 | <H1> D. Indexes </H1> | |
14019 | <!--docid::SEC140::--> | |
14020 | <P> | |
14021 | ||
14022 | <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> | |
14023 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC141">D.1 Index of Shell Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash builtin commands.</TD></TR> | |
14024 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC142">D.2 Index of Shell Reserved Words</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash reserved words.</TD></TR> | |
14025 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC143">D.3 Parameter and Variable Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Quick reference helps you find the | |
14026 | variable you want.</TD></TR> | |
14027 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC144">D.4 Function Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of bindable Readline functions.</TD></TR> | |
14028 | <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC145">D.5 Concept Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">General index for concepts described in | |
14029 | this manual.</TD></TR> | |
14030 | </TABLE></BLOCKQUOTE> | |
14031 | <P> | |
14032 | ||
14033 | <A NAME="Builtin Index"></A> | |
14034 | <HR SIZE="6"> | |
14035 | <A NAME="SEC141"></A> | |
14036 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
14037 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> < </A>]</TD> | |
14038 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> > </A>]</TD> | |
14039 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
14040 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
14041 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
14042 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
14043 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
14044 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
14045 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
14046 | </TR></TABLE> | |
14047 | <H2> D.1 Index of Shell Builtin Commands </H2> | |
14048 | <!--docid::SEC141::--> | |
14049 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A> | |
14050 | | |
14051 | <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A> | |
14052 | | |
14053 | <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A> | |
14054 | | |
14055 | <BR> | |
14056 | <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A> | |
14057 | | |
14058 | <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A> | |
14059 | | |
14060 | <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A> | |
14061 | | |
14062 | <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A> | |
14063 | | |
14064 | <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A> | |
14065 | | |
14066 | <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A> | |
14067 | | |
14068 | <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A> | |
14069 | | |
14070 | <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A> | |
14071 | | |
14072 | <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A> | |
14073 | | |
14074 | <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A> | |
14075 | | |
14076 | <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A> | |
14077 | | |
14078 | <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A> | |
14079 | | |
14080 | <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A> | |
14081 | | |
14082 | <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A> | |
14083 | | |
14084 | <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A> | |
14085 | | |
14086 | <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A> | |
14087 | | |
14088 | <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A> | |
14089 | | |
14090 | <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A> | |
14091 | | |
14092 | </td></tr></table><br><P></P> | |
14093 | <TABLE border=0> | |
14094 | <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> | |
14095 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14096 | <TR><TH><A NAME="bt_."></A>.</TH><TD></TD><TD></TD></TR> | |
14097 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX69"><CODE>.</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14098 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14099 | <TR><TH><A NAME="bt_:"></A>:</TH><TD></TD><TD></TD></TR> | |
14100 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX68"><CODE>:</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14101 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14102 | <TR><TH><A NAME="bt_["></A>[</TH><TD></TD><TD></TD></TR> | |
14103 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX84"><CODE>[</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14104 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14105 | <TR><TH><A NAME="bt_A"></A>A</TH><TD></TD><TD></TD></TR> | |
14106 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX89"><CODE>alias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14107 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14108 | <TR><TH><A NAME="bt_B"></A>B</TH><TD></TD><TD></TD></TR> | |
14109 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX289"><CODE>bg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR> | |
14110 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX90"><CODE>bind</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14111 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX70"><CODE>break</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14112 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX91"><CODE>builtin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14113 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14114 | <TR><TH><A NAME="bt_C"></A>C</TH><TD></TD><TD></TD></TR> | |
14115 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX92"><CODE>caller</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14116 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX71"><CODE>cd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14117 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX93"><CODE>command</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14118 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX531"><CODE>compgen</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR> | |
14119 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX532"><CODE>complete</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR> | |
14120 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX533"><CODE>compopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR> | |
14121 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX72"><CODE>continue</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14122 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14123 | <TR><TH><A NAME="bt_D"></A>D</TH><TD></TD><TD></TD></TR> | |
14124 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX94"><CODE>declare</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14125 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX286"><CODE>dirs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR> | |
14126 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX294"><CODE>disown</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR> | |
14127 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14128 | <TR><TH><A NAME="bt_E"></A>E</TH><TD></TD><TD></TD></TR> | |
14129 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX95"><CODE>echo</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14130 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX96"><CODE>enable</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14131 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX73"><CODE>eval</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14132 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX74"><CODE>exec</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14133 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX75"><CODE>exit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14134 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX76"><CODE>export</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14135 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14136 | <TR><TH><A NAME="bt_F"></A>F</TH><TD></TD><TD></TD></TR> | |
14137 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX535"><CODE>fc</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR> | |
14138 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX290"><CODE>fg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR> | |
14139 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14140 | <TR><TH><A NAME="bt_G"></A>G</TH><TD></TD><TD></TD></TR> | |
14141 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX77"><CODE>getopts</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14142 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14143 | <TR><TH><A NAME="bt_H"></A>H</TH><TD></TD><TD></TD></TR> | |
14144 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX78"><CODE>hash</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14145 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX97"><CODE>help</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14146 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX536"><CODE>history</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR> | |
14147 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14148 | <TR><TH><A NAME="bt_J"></A>J</TH><TD></TD><TD></TD></TR> | |
14149 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX291"><CODE>jobs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR> | |
14150 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14151 | <TR><TH><A NAME="bt_K"></A>K</TH><TD></TD><TD></TD></TR> | |
14152 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX292"><CODE>kill</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR> | |
14153 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14154 | <TR><TH><A NAME="bt_L"></A>L</TH><TD></TD><TD></TD></TR> | |
14155 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX98"><CODE>let</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14156 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX99"><CODE>local</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14157 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX100"><CODE>logout</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14158 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14159 | <TR><TH><A NAME="bt_M"></A>M</TH><TD></TD><TD></TD></TR> | |
14160 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX101"><CODE>mapfile</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14161 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14162 | <TR><TH><A NAME="bt_P"></A>P</TH><TD></TD><TD></TD></TR> | |
14163 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX287"><CODE>popd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR> | |
14164 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX102"><CODE>printf</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14165 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX288"><CODE>pushd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR> | |
14166 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX79"><CODE>pwd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14167 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14168 | <TR><TH><A NAME="bt_R"></A>R</TH><TD></TD><TD></TD></TR> | |
14169 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX103"><CODE>read</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14170 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX104"><CODE>readarray</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14171 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX80"><CODE>readonly</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14172 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX81"><CODE>return</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14173 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14174 | <TR><TH><A NAME="bt_S"></A>S</TH><TD></TD><TD></TD></TR> | |
14175 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX110"><CODE>set</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A></TD></TR> | |
14176 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX82"><CODE>shift</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14177 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX111"><CODE>shopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A></TD></TR> | |
14178 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX105"><CODE>source</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14179 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX295"><CODE>suspend</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR> | |
14180 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14181 | <TR><TH><A NAME="bt_T"></A>T</TH><TD></TD><TD></TD></TR> | |
14182 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX83"><CODE>test</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14183 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX85"><CODE>times</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14184 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX86"><CODE>trap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14185 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX106"><CODE>type</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14186 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX107"><CODE>typeset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14187 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14188 | <TR><TH><A NAME="bt_U"></A>U</TH><TD></TD><TD></TD></TR> | |
14189 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX108"><CODE>ulimit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14190 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX87"><CODE>umask</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14191 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX109"><CODE>unalias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR> | |
14192 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX88"><CODE>unset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR> | |
14193 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14194 | <TR><TH><A NAME="bt_W"></A>W</TH><TD></TD><TD></TD></TR> | |
14195 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX293"><CODE>wait</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR> | |
14196 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14197 | </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A> | |
14198 | | |
14199 | <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A> | |
14200 | | |
14201 | <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A> | |
14202 | | |
14203 | <BR> | |
14204 | <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A> | |
14205 | | |
14206 | <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A> | |
14207 | | |
14208 | <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A> | |
14209 | | |
14210 | <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A> | |
14211 | | |
14212 | <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A> | |
14213 | | |
14214 | <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A> | |
14215 | | |
14216 | <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A> | |
14217 | | |
14218 | <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A> | |
14219 | | |
14220 | <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A> | |
14221 | | |
14222 | <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A> | |
14223 | | |
14224 | <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A> | |
14225 | | |
14226 | <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A> | |
14227 | | |
14228 | <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A> | |
14229 | | |
14230 | <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A> | |
14231 | | |
14232 | <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A> | |
14233 | | |
14234 | <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A> | |
14235 | | |
14236 | <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A> | |
14237 | | |
14238 | <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A> | |
14239 | | |
14240 | </td></tr></table><br><P> | |
14241 | ||
14242 | <A NAME="Reserved Word Index"></A> | |
14243 | <HR SIZE="6"> | |
14244 | <A NAME="SEC142"></A> | |
14245 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
14246 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> < </A>]</TD> | |
14247 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> > </A>]</TD> | |
14248 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> << </A>]</TD> | |
14249 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
14250 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
14251 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
14252 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
14253 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
14254 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
14255 | </TR></TABLE> | |
14256 | <H2> D.2 Index of Shell Reserved Words </H2> | |
14257 | <!--docid::SEC142::--> | |
14258 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A> | |
14259 | | |
14260 | <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A> | |
14261 | | |
14262 | <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A> | |
14263 | | |
14264 | <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A> | |
14265 | | |
14266 | <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A> | |
14267 | | |
14268 | <BR> | |
14269 | <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A> | |
14270 | | |
14271 | <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A> | |
14272 | | |
14273 | <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A> | |
14274 | | |
14275 | <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A> | |
14276 | | |
14277 | <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A> | |
14278 | | |
14279 | <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A> | |
14280 | | |
14281 | <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A> | |
14282 | | |
14283 | <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A> | |
14284 | | |
14285 | <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A> | |
14286 | | |
14287 | </td></tr></table><br><P></P> | |
14288 | <TABLE border=0> | |
14289 | <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> | |
14290 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14291 | <TR><TH><A NAME="rw_!"></A>!</TH><TD></TD><TD></TD></TR> | |
14292 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX25"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR> | |
14293 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14294 | <TR><TH><A NAME="rw_["></A>[</TH><TD></TD><TD></TD></TR> | |
14295 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX41"><CODE>[[</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14296 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14297 | <TR><TH><A NAME="rw_]"></A>]</TH><TD></TD><TD></TD></TR> | |
14298 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX42"><CODE>]]</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14299 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14300 | <TR><TH><A NAME="rw_{"></A>{</TH><TD></TD><TD></TD></TR> | |
14301 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX43"><CODE>{</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD></TR> | |
14302 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14303 | <TR><TH><A NAME="rw_}"></A>}</TH><TD></TD><TD></TD></TR> | |
14304 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX44"><CODE>}</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD></TR> | |
14305 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14306 | <TR><TH><A NAME="rw_C"></A>C</TH><TD></TD><TD></TD></TR> | |
14307 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX37"><CODE>case</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14308 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14309 | <TR><TH><A NAME="rw_D"></A>D</TH><TD></TD><TD></TD></TR> | |
14310 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX28"><CODE>do</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR> | |
14311 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX29"><CODE>done</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR> | |
14312 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14313 | <TR><TH><A NAME="rw_E"></A>E</TH><TD></TD><TD></TD></TR> | |
14314 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX35"><CODE>elif</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14315 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX34"><CODE>else</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14316 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX39"><CODE>esac</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14317 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14318 | <TR><TH><A NAME="rw_F"></A>F</TH><TD></TD><TD></TD></TR> | |
14319 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX36"><CODE>fi</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14320 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX31"><CODE>for</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR> | |
14321 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX45"><CODE>function</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD></TR> | |
14322 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14323 | <TR><TH><A NAME="rw_I"></A>I</TH><TD></TD><TD></TD></TR> | |
14324 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX32"><CODE>if</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14325 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX38"><CODE>in</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14326 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14327 | <TR><TH><A NAME="rw_S"></A>S</TH><TD></TD><TD></TD></TR> | |
14328 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX40"><CODE>select</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14329 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14330 | <TR><TH><A NAME="rw_T"></A>T</TH><TD></TD><TD></TD></TR> | |
14331 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX33"><CODE>then</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
14332 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX24"><CODE>time</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR> | |
14333 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14334 | <TR><TH><A NAME="rw_U"></A>U</TH><TD></TD><TD></TD></TR> | |
14335 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX27"><CODE>until</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR> | |
14336 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14337 | <TR><TH><A NAME="rw_W"></A>W</TH><TD></TD><TD></TD></TR> | |
14338 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX30"><CODE>while</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR> | |
14339 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14340 | </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A> | |
14341 | | |
14342 | <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A> | |
14343 | | |
14344 | <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A> | |
14345 | | |
14346 | <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A> | |
14347 | | |
14348 | <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A> | |
14349 | | |
14350 | <BR> | |
14351 | <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A> | |
14352 | | |
14353 | <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A> | |
14354 | | |
14355 | <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A> | |
14356 | | |
14357 | <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A> | |
14358 | | |
14359 | <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A> | |
14360 | | |
14361 | <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A> | |
14362 | | |
14363 | <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A> | |
14364 | | |
14365 | <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A> | |
14366 | | |
14367 | <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A> | |
14368 | | |
14369 | </td></tr></table><br><P> | |
14370 | ||
14371 | <A NAME="Variable Index"></A> | |
14372 | <HR SIZE="6"> | |
14373 | <A NAME="SEC143"></A> | |
14374 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
14375 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> < </A>]</TD> | |
14376 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> > </A>]</TD> | |
14377 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> << </A>]</TD> | |
14378 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
14379 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
14380 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
14381 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
14382 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
14383 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
14384 | </TR></TABLE> | |
14385 | <H2> D.3 Parameter and Variable Index </H2> | |
14386 | <!--docid::SEC143::--> | |
14387 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A> | |
14388 | | |
14389 | <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A> | |
14390 | | |
14391 | <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A> | |
14392 | | |
14393 | <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A> | |
14394 | | |
14395 | <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A> | |
14396 | | |
14397 | <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A> | |
14398 | | |
14399 | <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A> | |
14400 | | |
14401 | <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A> | |
14402 | | |
14403 | <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A> | |
14404 | | |
14405 | <BR> | |
14406 | <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A> | |
14407 | | |
14408 | <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A> | |
14409 | | |
14410 | <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A> | |
14411 | | |
14412 | <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A> | |
14413 | | |
14414 | <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A> | |
14415 | | |
14416 | <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A> | |
14417 | | |
14418 | <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A> | |
14419 | | |
14420 | <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A> | |
14421 | | |
14422 | <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A> | |
14423 | | |
14424 | <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A> | |
14425 | | |
14426 | <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A> | |
14427 | | |
14428 | <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A> | |
14429 | | |
14430 | <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A> | |
14431 | | |
14432 | <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A> | |
14433 | | |
14434 | <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A> | |
14435 | | |
14436 | <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A> | |
14437 | | |
14438 | <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A> | |
14439 | | |
14440 | <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A> | |
14441 | | |
14442 | <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A> | |
14443 | | |
14444 | </td></tr></table><br><P></P> | |
14445 | <TABLE border=0> | |
14446 | <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> | |
14447 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14448 | <TR><TH><A NAME="vr_!"></A>!</TH><TD></TD><TD></TD></TR> | |
14449 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX58"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14450 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX59"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14451 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14452 | <TR><TH><A NAME="vr_#"></A>#</TH><TD></TD><TD></TD></TR> | |
14453 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX50"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14454 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX51"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14455 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14456 | <TR><TH><A NAME="vr_$"></A>$</TH><TD></TD><TD></TD></TR> | |
14457 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX56"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14458 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX57"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14459 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14460 | <TR><TH><A NAME="vr_*"></A>*</TH><TD></TD><TD></TD></TR> | |
14461 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX46"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14462 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX47"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14463 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14464 | <TR><TH><A NAME="vr_-"></A>-</TH><TD></TD><TD></TD></TR> | |
14465 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX54"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14466 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX55"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14467 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14468 | <TR><TH><A NAME="vr_0"></A>0</TH><TD></TD><TD></TD></TR> | |
14469 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX60"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14470 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX61"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14471 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14472 | <TR><TH><A NAME="vr_?"></A>?</TH><TD></TD><TD></TD></TR> | |
14473 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX52"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14474 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX53"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14475 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14476 | <TR><TH><A NAME="vr_@"></A>@</TH><TD></TD><TD></TD></TR> | |
14477 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX48"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14478 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX49"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14479 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14480 | <TR><TH><A NAME="vr__"></A>_</TH><TD></TD><TD></TD></TR> | |
14481 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX62"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14482 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX63"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
14483 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14484 | <TR><TH><A NAME="vr_A"></A>A</TH><TD></TD><TD></TD></TR> | |
14485 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX296"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR> | |
14486 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX297"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR> | |
14487 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14488 | <TR><TH><A NAME="vr_B"></A>B</TH><TD></TD><TD></TD></TR> | |
14489 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX132"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14490 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX133"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14491 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX136"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14492 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX137"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14493 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX138"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14494 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX139"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14495 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX140"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14496 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX141"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14497 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX142"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14498 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX143"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14499 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX144"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14500 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX145"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14501 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX146"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14502 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX147"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14503 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX148"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14504 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX149"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14505 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX150"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14506 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX151"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14507 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX152"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14508 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX153"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14509 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX154"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14510 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX155"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14511 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX156"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14512 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX157"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14513 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX158"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14514 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX159"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14515 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX160"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14516 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX161"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14517 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX134"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14518 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX135"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14519 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX303"><CODE>bell-style</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14520 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX304"><CODE>bind-tty-special-chars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14521 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14522 | <TR><TH><A NAME="vr_C"></A>C</TH><TD></TD><TD></TD></TR> | |
14523 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX112"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14524 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX113"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14525 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX162"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14526 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX163"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14527 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX305"><CODE>comment-begin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14528 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX164"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14529 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX165"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14530 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX172"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14531 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX173"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14532 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX166"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14533 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX167"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14534 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX168"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14535 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX169"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14536 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX170"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14537 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX171"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14538 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX174"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14539 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX175"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14540 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX176"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14541 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX177"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14542 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX306"><CODE>completion-prefix-display-length</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14543 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX307"><CODE>completion-query-items</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14544 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX178"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14545 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX179"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14546 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX308"><CODE>convert-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14547 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14548 | <TR><TH><A NAME="vr_D"></A>D</TH><TD></TD><TD></TD></TR> | |
14549 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX180"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14550 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX181"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14551 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX309"><CODE>disable-completion</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14552 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14553 | <TR><TH><A NAME="vr_E"></A>E</TH><TD></TD><TD></TD></TR> | |
14554 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX310"><CODE>editing-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14555 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX182"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14556 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX183"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14557 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX311"><CODE>enable-keypad</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14558 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX184"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14559 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX185"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14560 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX312"><CODE>expand-tilde</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14561 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14562 | <TR><TH><A NAME="vr_F"></A>F</TH><TD></TD><TD></TD></TR> | |
14563 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX186"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14564 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX187"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14565 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX188"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14566 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX189"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14567 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX190"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14568 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX191"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14569 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14570 | <TR><TH><A NAME="vr_G"></A>G</TH><TD></TD><TD></TD></TR> | |
14571 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX192"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14572 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX193"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14573 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX194"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14574 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX195"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14575 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14576 | <TR><TH><A NAME="vr_H"></A>H</TH><TD></TD><TD></TD></TR> | |
14577 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX196"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14578 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX197"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14579 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX198"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14580 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX199"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14581 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX200"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14582 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX201"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14583 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX202"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14584 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX203"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14585 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX204"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14586 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX205"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14587 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX206"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14588 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX207"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14589 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX313"><CODE>history-preserve-point</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14590 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX314"><CODE>history-size</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14591 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX208"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14592 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX209"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14593 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX210"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14594 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX211"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14595 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX114"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14596 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX115"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14597 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX315"><CODE>horizontal-scroll-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14598 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX212"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14599 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX213"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14600 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX214"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14601 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX215"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14602 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX216"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14603 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX217"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14604 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14605 | <TR><TH><A NAME="vr_I"></A>I</TH><TD></TD><TD></TD></TR> | |
14606 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX116"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14607 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX117"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14608 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX218"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14609 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX219"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14610 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX316"><CODE>input-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14611 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX220"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14612 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX221"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14613 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX318"><CODE>isearch-terminators</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14614 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14615 | <TR><TH><A NAME="vr_K"></A>K</TH><TD></TD><TD></TD></TR> | |
14616 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX319"><CODE>keymap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14617 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14618 | <TR><TH><A NAME="vr_L"></A>L</TH><TD></TD><TD></TD></TR> | |
14619 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX222"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14620 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX223"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14621 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX224"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14622 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX225"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14623 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX226"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14624 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX227"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14625 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX228"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14626 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX229"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14627 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX21"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR> | |
14628 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX230"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14629 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX231"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14630 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX232"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14631 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX233"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14632 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX234"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14633 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX235"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14634 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX236"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14635 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX237"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14636 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14637 | <TR><TH><A NAME="vr_M"></A>M</TH><TD></TD><TD></TD></TR> | |
14638 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX238"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14639 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX239"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14640 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX118"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14641 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX119"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14642 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX240"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14643 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX241"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14644 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX120"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14645 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX121"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14646 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX320"><CODE>mark-modified-lines</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14647 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX321"><CODE>mark-symlinked-directories</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14648 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX322"><CODE>match-hidden-files</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14649 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX317"><CODE>meta-flag</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14650 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14651 | <TR><TH><A NAME="vr_O"></A>O</TH><TD></TD><TD></TD></TR> | |
14652 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX242"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14653 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX243"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14654 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX122"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14655 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX123"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14656 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX244"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14657 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX245"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14658 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX124"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14659 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX125"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14660 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX246"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14661 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX247"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14662 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX323"><CODE>output-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14663 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14664 | <TR><TH><A NAME="vr_P"></A>P</TH><TD></TD><TD></TD></TR> | |
14665 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX324"><CODE>page-completions</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14666 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX126"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14667 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX127"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14668 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX248"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14669 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX249"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14670 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX250"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14671 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX251"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14672 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX252"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14673 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX253"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14674 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX254"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14675 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX255"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14676 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX256"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14677 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX257"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14678 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX128"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14679 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX129"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14680 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX130"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14681 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX131"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR> | |
14682 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX258"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14683 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX259"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14684 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX260"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14685 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX261"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14686 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX262"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14687 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX263"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14688 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14689 | <TR><TH><A NAME="vr_R"></A>R</TH><TD></TD><TD></TD></TR> | |
14690 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX264"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14691 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX265"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14692 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX266"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14693 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX267"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14694 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX325"><CODE>revert-all-at-newline</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14695 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14696 | <TR><TH><A NAME="vr_S"></A>S</TH><TD></TD><TD></TD></TR> | |
14697 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX268"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14698 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX269"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14699 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX270"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14700 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX271"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14701 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX272"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14702 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX273"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14703 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX274"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14704 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX275"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14705 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX326"><CODE>show-all-if-ambiguous</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14706 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX327"><CODE>show-all-if-unmodified</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14707 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14708 | <TR><TH><A NAME="vr_T"></A>T</TH><TD></TD><TD></TD></TR> | |
14709 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX22"><CODE>TEXTDOMAIN</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR> | |
14710 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX23"><CODE>TEXTDOMAINDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR> | |
14711 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX276"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14712 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX277"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14713 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX278"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14714 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX279"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14715 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX280"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14716 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX281"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14717 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14718 | <TR><TH><A NAME="vr_U"></A>U</TH><TD></TD><TD></TD></TR> | |
14719 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX282"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14720 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX283"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR> | |
14721 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14722 | <TR><TH><A NAME="vr_V"></A>V</TH><TD></TD><TD></TD></TR> | |
14723 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX328"><CODE>visible-stats</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
14724 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14725 | </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A> | |
14726 | | |
14727 | <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A> | |
14728 | | |
14729 | <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A> | |
14730 | | |
14731 | <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A> | |
14732 | | |
14733 | <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A> | |
14734 | | |
14735 | <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A> | |
14736 | | |
14737 | <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A> | |
14738 | | |
14739 | <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A> | |
14740 | | |
14741 | <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A> | |
14742 | | |
14743 | <BR> | |
14744 | <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A> | |
14745 | | |
14746 | <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A> | |
14747 | | |
14748 | <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A> | |
14749 | | |
14750 | <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A> | |
14751 | | |
14752 | <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A> | |
14753 | | |
14754 | <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A> | |
14755 | | |
14756 | <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A> | |
14757 | | |
14758 | <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A> | |
14759 | | |
14760 | <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A> | |
14761 | | |
14762 | <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A> | |
14763 | | |
14764 | <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A> | |
14765 | | |
14766 | <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A> | |
14767 | | |
14768 | <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A> | |
14769 | | |
14770 | <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A> | |
14771 | | |
14772 | <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A> | |
14773 | | |
14774 | <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A> | |
14775 | | |
14776 | <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A> | |
14777 | | |
14778 | <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A> | |
14779 | | |
14780 | <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A> | |
14781 | | |
14782 | </td></tr></table><br><P> | |
14783 | ||
14784 | <A NAME="Function Index"></A> | |
14785 | <HR SIZE="6"> | |
14786 | <A NAME="SEC144"></A> | |
14787 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
14788 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> < </A>]</TD> | |
14789 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> > </A>]</TD> | |
14790 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> << </A>]</TD> | |
14791 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
14792 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
14793 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
14794 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
14795 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
14796 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
14797 | </TR></TABLE> | |
14798 | <H2> D.4 Function Index </H2> | |
14799 | <!--docid::SEC144::--> | |
14800 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A> | |
14801 | | |
14802 | <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A> | |
14803 | | |
14804 | <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A> | |
14805 | | |
14806 | <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A> | |
14807 | | |
14808 | <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A> | |
14809 | | |
14810 | <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A> | |
14811 | | |
14812 | <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A> | |
14813 | | |
14814 | <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A> | |
14815 | | |
14816 | <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A> | |
14817 | | |
14818 | <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A> | |
14819 | | |
14820 | <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A> | |
14821 | | |
14822 | <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A> | |
14823 | | |
14824 | <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A> | |
14825 | | |
14826 | <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A> | |
14827 | | |
14828 | <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A> | |
14829 | | |
14830 | <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A> | |
14831 | | |
14832 | <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A> | |
14833 | | |
14834 | <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A> | |
14835 | | |
14836 | <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A> | |
14837 | | |
14838 | <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A> | |
14839 | | |
14840 | </td></tr></table><br><P></P> | |
14841 | <TABLE border=0> | |
14842 | <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> | |
14843 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14844 | <TR><TH><A NAME="fn_A"></A>A</TH><TD></TD><TD></TD></TR> | |
14845 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX479"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14846 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX480"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14847 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX349"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14848 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX350"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14849 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX521"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14850 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX522"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14851 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14852 | <TR><TH><A NAME="fn_B"></A>B</TH><TD></TD><TD></TD></TR> | |
14853 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX335"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14854 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX336"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14855 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX377"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14856 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX378"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14857 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX399"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14858 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX400"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14859 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX411"><CODE>backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14860 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX412"><CODE>backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14861 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX407"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14862 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX408"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14863 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX339"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14864 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX340"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14865 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX355"><CODE>beginning-of-history (M-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14866 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX356"><CODE>beginning-of-history (M-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14867 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX329"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14868 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX330"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14869 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14870 | <TR><TH><A NAME="fn_C"></A>C</TH><TD></TD><TD></TD></TR> | |
14871 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX475"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR> | |
14872 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX476"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR> | |
14873 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX393"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14874 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX394"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14875 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX495"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14876 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX496"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14877 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX497"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14878 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX498"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14879 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX345"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14880 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX346"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14881 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX435"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14882 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX436"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14883 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX461"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14884 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX462"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14885 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX445"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14886 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX446"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14887 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX457"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14888 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX458"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14889 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX469"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14890 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX470"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14891 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX449"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14892 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX450"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14893 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX453"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14894 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX454"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14895 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX423"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14896 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX424"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14897 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX425"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14898 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX426"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14899 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX421"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14900 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX422"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14901 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14902 | <TR><TH><A NAME="fn_D"></A>D</TH><TD></TD><TD></TD></TR> | |
14903 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX467"><CODE>dabbrev-expand ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14904 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX468"><CODE>dabbrev-expand ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14905 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX375"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14906 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX376"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14907 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX443"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14908 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX444"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14909 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX417"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14910 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX418"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14911 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX431"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <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> | |
14912 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX432"><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> | |
14913 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX513"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14914 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX514"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14915 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX481"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14916 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX482"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14917 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX391"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14918 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX392"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14919 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX501"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14920 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX502"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14921 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX505"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14922 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX506"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14923 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX503"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14924 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX504"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14925 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX465"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14926 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX466"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14927 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14928 | <TR><TH><A NAME="fn_E"></A>E</TH><TD></TD><TD></TD></TR> | |
14929 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX529"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14930 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX530"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14931 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX473"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR> | |
14932 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX474"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR> | |
14933 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX357"><CODE>end-of-history (M-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14934 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX358"><CODE>end-of-history (M-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14935 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX331"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14936 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX332"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14937 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX493"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14938 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX494"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14939 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14940 | <TR><TH><A NAME="fn_F"></A>F</TH><TD></TD><TD></TD></TR> | |
14941 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX379"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14942 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX380"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
14943 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX333"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14944 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX334"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14945 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX361"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14946 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX362"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14947 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX337"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14948 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX338"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
14949 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14950 | <TR><TH><A NAME="fn_G"></A>G</TH><TD></TD><TD></TD></TR> | |
14951 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX507"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14952 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX508"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14953 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX509"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14954 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX510"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14955 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX511"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14956 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX512"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14957 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14958 | <TR><TH><A NAME="fn_H"></A>H</TH><TD></TD><TD></TD></TR> | |
14959 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX523"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14960 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX524"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14961 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX517"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14962 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX518"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14963 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX369"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14964 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX370"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14965 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX367"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14966 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX368"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14967 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14968 | <TR><TH><A NAME="fn_I"></A>I</TH><TD></TD><TD></TD></TR> | |
14969 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX499"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14970 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX500"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14971 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX439"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14972 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX440"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14973 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX525"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14974 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX526"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14975 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14976 | <TR><TH><A NAME="fn_K"></A>K</TH><TD></TD><TD></TD></TR> | |
14977 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX397"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14978 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX398"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14979 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX419"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14980 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX420"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14981 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX403"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14982 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX404"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14983 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX405"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14984 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX406"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
14985 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14986 | <TR><TH><A NAME="fn_M"></A>M</TH><TD></TD><TD></TD></TR> | |
14987 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX519"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14988 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX520"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
14989 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX441"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14990 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX442"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
14991 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
14992 | <TR><TH><A NAME="fn_N"></A>N</TH><TD></TD><TD></TD></TR> | |
14993 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX353"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14994 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX354"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14995 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX365"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14996 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX366"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14997 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX363"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14998 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX364"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
14999 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15000 | <TR><TH><A NAME="fn_O"></A>O</TH><TD></TD><TD></TD></TR> | |
15001 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX527"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15002 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX528"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15003 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX395"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15004 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX396"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15005 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15006 | <TR><TH><A NAME="fn_P"></A>P</TH><TD></TD><TD></TD></TR> | |
15007 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX463"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15008 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX464"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15009 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX437"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15010 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX438"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15011 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX447"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15012 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX448"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15013 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX459"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15014 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX460"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15015 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX451"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15016 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX452"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15017 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX455"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15018 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX456"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR> | |
15019 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX483"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15020 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX484"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15021 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX351"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15022 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX352"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15023 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15024 | <TR><TH><A NAME="fn_Q"></A>Q</TH><TD></TD><TD></TD></TR> | |
15025 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX381"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15026 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX382"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15027 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15028 | <TR><TH><A NAME="fn_R"></A>R</TH><TD></TD><TD></TD></TR> | |
15029 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX477"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15030 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX478"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15031 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX347"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15032 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX348"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15033 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX359"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15034 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX360"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15035 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX487"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15036 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX488"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15037 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15038 | <TR><TH><A NAME="fn_S"></A>S</TH><TD></TD><TD></TD></TR> | |
15039 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX383"><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15040 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX384"><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15041 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX491"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15042 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX492"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15043 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX343"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15044 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX344"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15045 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX515"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15046 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX516"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15047 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX341"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15048 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX342"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR> | |
15049 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX409"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15050 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX410"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15051 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX471"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR> | |
15052 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX472"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR> | |
15053 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15054 | <TR><TH><A NAME="fn_T"></A>T</TH><TD></TD><TD></TD></TR> | |
15055 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX489"><CODE>tilde-expand (M-&#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15056 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX490"><CODE>tilde-expand (M-&#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15057 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX385"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15058 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX386"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15059 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX387"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15060 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX388"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15061 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15062 | <TR><TH><A NAME="fn_U"></A>U</TH><TD></TD><TD></TD></TR> | |
15063 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX485"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15064 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX486"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR> | |
15065 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX433"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR> | |
15066 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX434"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR> | |
15067 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX415"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15068 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX416"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15069 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX401"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15070 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX402"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15071 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX413"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15072 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX414"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15073 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX389"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15074 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX390"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR> | |
15075 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15076 | <TR><TH><A NAME="fn_Y"></A>Y</TH><TD></TD><TD></TD></TR> | |
15077 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX427"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15078 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX428"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15079 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX373"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15080 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX374"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15081 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX371"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15082 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX372"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR> | |
15083 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX429"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15084 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX430"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR> | |
15085 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15086 | </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A> | |
15087 | | |
15088 | <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A> | |
15089 | | |
15090 | <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A> | |
15091 | | |
15092 | <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A> | |
15093 | | |
15094 | <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A> | |
15095 | | |
15096 | <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A> | |
15097 | | |
15098 | <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A> | |
15099 | | |
15100 | <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A> | |
15101 | | |
15102 | <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A> | |
15103 | | |
15104 | <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A> | |
15105 | | |
15106 | <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A> | |
15107 | | |
15108 | <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A> | |
15109 | | |
15110 | <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A> | |
15111 | | |
15112 | <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A> | |
15113 | | |
15114 | <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A> | |
15115 | | |
15116 | <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A> | |
15117 | | |
15118 | <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A> | |
15119 | | |
15120 | <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A> | |
15121 | | |
15122 | <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A> | |
15123 | | |
15124 | <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A> | |
15125 | | |
15126 | </td></tr></table><br><P> | |
15127 | ||
15128 | <A NAME="Concept Index"></A> | |
15129 | <HR SIZE="6"> | |
15130 | <A NAME="SEC145"></A> | |
15131 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
15132 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> < </A>]</TD> | |
15133 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ > ]</TD> | |
15134 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> | |
15135 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD> | |
15136 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> | |
15137 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
15138 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
15139 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
15140 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
15141 | </TR></TABLE> | |
15142 | <H2> D.5 Concept Index </H2> | |
15143 | <!--docid::SEC145::--> | |
15144 | <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A> | |
15145 | | |
15146 | <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A> | |
15147 | | |
15148 | <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A> | |
15149 | | |
15150 | <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A> | |
15151 | | |
15152 | <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A> | |
15153 | | |
15154 | <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A> | |
15155 | | |
15156 | <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A> | |
15157 | | |
15158 | <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A> | |
15159 | | |
15160 | <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A> | |
15161 | | |
15162 | <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A> | |
15163 | | |
15164 | <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A> | |
15165 | | |
15166 | <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A> | |
15167 | | |
15168 | <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A> | |
15169 | | |
15170 | <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A> | |
15171 | | |
15172 | <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A> | |
15173 | | |
15174 | <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A> | |
15175 | | |
15176 | <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A> | |
15177 | | |
15178 | <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A> | |
15179 | | |
15180 | <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A> | |
15181 | | |
15182 | <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A> | |
15183 | | |
15184 | <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A> | |
15185 | | |
15186 | <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A> | |
15187 | | |
15188 | </td></tr></table><br><P></P> | |
15189 | <TABLE border=0> | |
15190 | <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> | |
15191 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15192 | <TR><TH><A NAME="cp_A"></A>A</TH><TD></TD><TD></TD></TR> | |
15193 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC84">alias expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC84">6.6 Aliases</A></TD></TR> | |
15194 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">arithmetic evaluation</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR> | |
15195 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC33">arithmetic expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD></TR> | |
15196 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">arithmetic, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR> | |
15197 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC85">arrays</A></TD><TD valign=top><A HREF="bashref.html#SEC85">6.7 Arrays</A></TD></TR> | |
15198 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15199 | <TR><TH><A NAME="cp_B"></A>B</TH><TD></TD><TD></TD></TR> | |
15200 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">background</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR> | |
15201 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">Bash configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR> | |
15202 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">Bash installation</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR> | |
15203 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC5">Bourne shell</A></TD><TD valign=top><A HREF="bashref.html#SEC5">3. Basic Shell Features</A></TD></TR> | |
15204 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC29">brace expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD></TR> | |
15205 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX2">builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15206 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15207 | <TR><TH><A NAME="cp_C"></A>C</TH><TD></TD><TD></TD></TR> | |
15208 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">command editing</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD></TR> | |
15209 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC52">command execution</A></TD><TD valign=top><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD></TR> | |
15210 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC51">command expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A></TD></TR> | |
15211 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC120">command history</A></TD><TD valign=top><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD></TR> | |
15212 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC52">command search</A></TD><TD valign=top><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD></TR> | |
15213 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC32">command substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A></TD></TR> | |
15214 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX26">command timing</A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR> | |
15215 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC19">commands, compound</A></TD><TD valign=top><A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A></TD></TR> | |
15216 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC21">commands, conditional</A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR> | |
15217 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC22">commands, grouping</A></TD><TD valign=top><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD></TR> | |
15218 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC18">commands, lists</A></TD><TD valign=top><A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A></TD></TR> | |
15219 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC20">commands, looping</A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR> | |
15220 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC17">commands, pipelines</A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR> | |
15221 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC15">commands, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC15">3.2 Shell Commands</A></TD></TR> | |
15222 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC16">commands, simple</A></TD><TD valign=top><A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A></TD></TR> | |
15223 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC14">comments, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC14">3.1.3 Comments</A></TD></TR> | |
15224 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC118">completion builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR> | |
15225 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR> | |
15226 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX3">control operator</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15227 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC23">coprocess</A></TD><TD valign=top><A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A></TD></TR> | |
15228 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15229 | <TR><TH><A NAME="cp_D"></A>D</TH><TD></TD><TD></TD></TR> | |
15230 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC86">directory stack</A></TD><TD valign=top><A HREF="bashref.html#SEC86">6.8 The Directory Stack</A></TD></TR> | |
15231 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15232 | <TR><TH><A NAME="cp_E"></A>E</TH><TD></TD><TD></TD></TR> | |
15233 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">editing command lines</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD></TR> | |
15234 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC54">environment</A></TD><TD valign=top><A HREF="bashref.html#SEC54">3.7.4 Environment</A></TD></TR> | |
15235 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">evaluation, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR> | |
15236 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC123">event designators</A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD></TR> | |
15237 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC53">execution environment</A></TD><TD valign=top><A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A></TD></TR> | |
15238 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX4">exit status</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15239 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC55">exit status</A></TD><TD valign=top><A HREF="bashref.html#SEC55">3.7.5 Exit Status</A></TD></TR> | |
15240 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC28">expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.5 Shell Expansions</A></TD></TR> | |
15241 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC33">expansion, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD></TR> | |
15242 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC29">expansion, brace</A></TD><TD valign=top><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD></TR> | |
15243 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX64">expansion, filename</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR> | |
15244 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC31">expansion, parameter</A></TD><TD valign=top><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD></TR> | |
15245 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX65">expansion, pathname</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR> | |
15246 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">expansion, tilde</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD></TR> | |
15247 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">expressions, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR> | |
15248 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC82">expressions, conditional</A></TD><TD valign=top><A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A></TD></TR> | |
15249 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15250 | <TR><TH><A NAME="cp_F"></A>F</TH><TD></TD><TD></TD></TR> | |
15251 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX5">field</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15252 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX6">filename</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15253 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX66">filename expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR> | |
15254 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">foreground</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR> | |
15255 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC24">functions, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD></TR> | |
15256 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15257 | <TR><TH><A NAME="cp_H"></A>H</TH><TD></TD><TD></TD></TR> | |
15258 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC121">history builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR> | |
15259 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX537">history events</A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD></TR> | |
15260 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC122">history expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC122">9.3 History Expansion</A></TD></TR> | |
15261 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC120">history list</A></TD><TD valign=top><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD></TR> | |
15262 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX534">History, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR> | |
15263 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15264 | <TR><TH><A NAME="cp_I"></A>I</TH><TD></TD><TD></TD></TR> | |
15265 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX11">identifier</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15266 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC103">initialization file, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC103">8.3 Readline Init File</A></TD></TR> | |
15267 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">installation</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR> | |
15268 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC97">interaction, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC97">8.2 Readline Interaction</A></TD></TR> | |
15269 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX285">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD></TR> | |
15270 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC78">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD></TR> | |
15271 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">internationalization</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR> | |
15272 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15273 | <TR><TH><A NAME="cp_J"></A>J</TH><TD></TD><TD></TD></TR> | |
15274 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX7">job</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15275 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX8">job control</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15276 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">job control</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR> | |
15277 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15278 | <TR><TH><A NAME="cp_K"></A>K</TH><TD></TD><TD></TD></TR> | |
15279 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX301">kill ring</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR> | |
15280 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX299">killing text</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR> | |
15281 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15282 | <TR><TH><A NAME="cp_L"></A>L</TH><TD></TD><TD></TD></TR> | |
15283 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">localization</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR> | |
15284 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX284">login shell</A></TD><TD valign=top><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD></TR> | |
15285 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15286 | <TR><TH><A NAME="cp_M"></A>M</TH><TD></TD><TD></TD></TR> | |
15287 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC37">matching, pattern</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD></TR> | |
15288 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX9">metacharacter</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15289 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15290 | <TR><TH><A NAME="cp_N"></A>N</TH><TD></TD><TD></TD></TR> | |
15291 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX10">name</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15292 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">native languages</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR> | |
15293 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">notation, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD></TR> | |
15294 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15295 | <TR><TH><A NAME="cp_O"></A>O</TH><TD></TD><TD></TD></TR> | |
15296 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX12">operator, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15297 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15298 | <TR><TH><A NAME="cp_P"></A>P</TH><TD></TD><TD></TD></TR> | |
15299 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC31">parameter expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD></TR> | |
15300 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">parameters</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD></TR> | |
15301 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC26">parameters, positional</A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A></TD></TR> | |
15302 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC27">parameters, special</A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR> | |
15303 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX67">pathname expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR> | |
15304 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC37">pattern matching</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD></TR> | |
15305 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC17">pipeline</A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR> | |
15306 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX1">POSIX</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15307 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC90">POSIX Mode</A></TD><TD valign=top><A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A></TD></TR> | |
15308 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX13">process group</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15309 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX14">process group ID</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15310 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC34">process substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A></TD></TR> | |
15311 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC117">programmable completion</A></TD><TD valign=top><A HREF="bashref.html#SEC117">8.6 Programmable Completion</A></TD></TR> | |
15312 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC88">prompting</A></TD><TD valign=top><A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A></TD></TR> | |
15313 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15314 | <TR><TH><A NAME="cp_Q"></A>Q</TH><TD></TD><TD></TD></TR> | |
15315 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC8">quoting</A></TD><TD valign=top><A HREF="bashref.html#SEC8">3.1.2 Quoting</A></TD></TR> | |
15316 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC12">quoting, ANSI</A></TD><TD valign=top><A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A></TD></TR> | |
15317 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15318 | <TR><TH><A NAME="cp_R"></A>R</TH><TD></TD><TD></TD></TR> | |
15319 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX298">Readline, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR> | |
15320 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC39">redirection</A></TD><TD valign=top><A HREF="bashref.html#SEC39">3.6 Redirections</A></TD></TR> | |
15321 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX15">reserved word</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15322 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC89">restricted shell</A></TD><TD valign=top><A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A></TD></TR> | |
15323 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX16">return status</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15324 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15325 | <TR><TH><A NAME="cp_S"></A>S</TH><TD></TD><TD></TD></TR> | |
15326 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">shell arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR> | |
15327 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC24">shell function</A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD></TR> | |
15328 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC57">shell script</A></TD><TD valign=top><A HREF="bashref.html#SEC57">3.8 Shell Scripts</A></TD></TR> | |
15329 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">shell variable</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD></TR> | |
15330 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC78">shell, interactive</A></TD><TD valign=top><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD></TR> | |
15331 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX17">signal</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15332 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC56">signal handling</A></TD><TD valign=top><A HREF="bashref.html#SEC56">3.7.6 Signals</A></TD></TR> | |
15333 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX18">special builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15334 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC64">special builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC64">4.4 Special Builtins</A></TD></TR> | |
15335 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC70">startup files</A></TD><TD valign=top><A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A></TD></TR> | |
15336 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">suspending jobs</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR> | |
15337 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15338 | <TR><TH><A NAME="cp_T"></A>T</TH><TD></TD><TD></TD></TR> | |
15339 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">tilde expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD></TR> | |
15340 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX19">token</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15341 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">translation, native languages</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR> | |
15342 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15343 | <TR><TH><A NAME="cp_V"></A>V</TH><TD></TD><TD></TD></TR> | |
15344 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">variable, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD></TR> | |
15345 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX302">variables, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR> | |
15346 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15347 | <TR><TH><A NAME="cp_W"></A>W</TH><TD></TD><TD></TD></TR> | |
15348 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX20">word</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR> | |
15349 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC35">word splitting</A></TD><TD valign=top><A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A></TD></TR> | |
15350 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15351 | <TR><TH><A NAME="cp_Y"></A>Y</TH><TD></TD><TD></TD></TR> | |
15352 | <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX300">yanking text</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR> | |
15353 | <TR><TD COLSPAN=3> <HR></TD></TR> | |
15354 | </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A> | |
15355 | | |
15356 | <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A> | |
15357 | | |
15358 | <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A> | |
15359 | | |
15360 | <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A> | |
15361 | | |
15362 | <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A> | |
15363 | | |
15364 | <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A> | |
15365 | | |
15366 | <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A> | |
15367 | | |
15368 | <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A> | |
15369 | | |
15370 | <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A> | |
15371 | | |
15372 | <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A> | |
15373 | | |
15374 | <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A> | |
15375 | | |
15376 | <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A> | |
15377 | | |
15378 | <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A> | |
15379 | | |
15380 | <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A> | |
15381 | | |
15382 | <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A> | |
15383 | | |
15384 | <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A> | |
15385 | | |
15386 | <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A> | |
15387 | | |
15388 | <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A> | |
15389 | | |
15390 | <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A> | |
15391 | | |
15392 | <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A> | |
15393 | | |
15394 | <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A> | |
15395 | | |
15396 | <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A> | |
15397 | | |
15398 | </td></tr></table><br><P> | |
15399 | ||
15400 | <HR SIZE="6"> | |
15401 | <A NAME="SEC_Contents"></A> | |
15402 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
15403 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
15404 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
15405 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
15406 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
15407 | </TR></TABLE> | |
15408 | <H1>Table of Contents</H1> | |
15409 | <UL> | |
15410 | <A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A> | |
15411 | <BR> | |
15412 | <UL> | |
15413 | <A NAME="TOC2" HREF="bashref.html#SEC2">1.1 What is Bash?</A> | |
15414 | <BR> | |
15415 | <A NAME="TOC3" HREF="bashref.html#SEC3">1.2 What is a shell?</A> | |
15416 | <BR> | |
15417 | </UL> | |
15418 | <A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A> | |
15419 | <BR> | |
15420 | <A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A> | |
15421 | <BR> | |
15422 | <UL> | |
15423 | <A NAME="TOC6" HREF="bashref.html#SEC6">3.1 Shell Syntax</A> | |
15424 | <BR> | |
15425 | <UL> | |
15426 | <A NAME="TOC7" HREF="bashref.html#SEC7">3.1.1 Shell Operation</A> | |
15427 | <BR> | |
15428 | <A NAME="TOC8" HREF="bashref.html#SEC8">3.1.2 Quoting</A> | |
15429 | <BR> | |
15430 | <UL> | |
15431 | <A NAME="TOC9" HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A> | |
15432 | <BR> | |
15433 | <A NAME="TOC10" HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A> | |
15434 | <BR> | |
15435 | <A NAME="TOC11" HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A> | |
15436 | <BR> | |
15437 | <A NAME="TOC12" HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A> | |
15438 | <BR> | |
15439 | <A NAME="TOC13" HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A> | |
15440 | <BR> | |
15441 | </UL> | |
15442 | <A NAME="TOC14" HREF="bashref.html#SEC14">3.1.3 Comments</A> | |
15443 | <BR> | |
15444 | </UL> | |
15445 | <A NAME="TOC15" HREF="bashref.html#SEC15">3.2 Shell Commands</A> | |
15446 | <BR> | |
15447 | <UL> | |
15448 | <A NAME="TOC16" HREF="bashref.html#SEC16">3.2.1 Simple Commands</A> | |
15449 | <BR> | |
15450 | <A NAME="TOC17" HREF="bashref.html#SEC17">3.2.2 Pipelines</A> | |
15451 | <BR> | |
15452 | <A NAME="TOC18" HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A> | |
15453 | <BR> | |
15454 | <A NAME="TOC19" HREF="bashref.html#SEC19">3.2.4 Compound Commands</A> | |
15455 | <BR> | |
15456 | <UL> | |
15457 | <A NAME="TOC20" HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A> | |
15458 | <BR> | |
15459 | <A NAME="TOC21" HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A> | |
15460 | <BR> | |
15461 | <A NAME="TOC22" HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A> | |
15462 | <BR> | |
15463 | </UL> | |
15464 | <A NAME="TOC23" HREF="bashref.html#SEC23">3.2.5 Coprocesses</A> | |
15465 | <BR> | |
15466 | </UL> | |
15467 | <A NAME="TOC24" HREF="bashref.html#SEC24">3.3 Shell Functions</A> | |
15468 | <BR> | |
15469 | <A NAME="TOC25" HREF="bashref.html#SEC25">3.4 Shell Parameters</A> | |
15470 | <BR> | |
15471 | <UL> | |
15472 | <A NAME="TOC26" HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A> | |
15473 | <BR> | |
15474 | <A NAME="TOC27" HREF="bashref.html#SEC27">3.4.2 Special Parameters</A> | |
15475 | <BR> | |
15476 | </UL> | |
15477 | <A NAME="TOC28" HREF="bashref.html#SEC28">3.5 Shell Expansions</A> | |
15478 | <BR> | |
15479 | <UL> | |
15480 | <A NAME="TOC29" HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A> | |
15481 | <BR> | |
15482 | <A NAME="TOC30" HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A> | |
15483 | <BR> | |
15484 | <A NAME="TOC31" HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A> | |
15485 | <BR> | |
15486 | <A NAME="TOC32" HREF="bashref.html#SEC32">3.5.4 Command Substitution</A> | |
15487 | <BR> | |
15488 | <A NAME="TOC33" HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A> | |
15489 | <BR> | |
15490 | <A NAME="TOC34" HREF="bashref.html#SEC34">3.5.6 Process Substitution</A> | |
15491 | <BR> | |
15492 | <A NAME="TOC35" HREF="bashref.html#SEC35">3.5.7 Word Splitting</A> | |
15493 | <BR> | |
15494 | <A NAME="TOC36" HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A> | |
15495 | <BR> | |
15496 | <UL> | |
15497 | <A NAME="TOC37" HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A> | |
15498 | <BR> | |
15499 | </UL> | |
15500 | <A NAME="TOC38" HREF="bashref.html#SEC38">3.5.9 Quote Removal</A> | |
15501 | <BR> | |
15502 | </UL> | |
15503 | <A NAME="TOC39" HREF="bashref.html#SEC39">3.6 Redirections</A> | |
15504 | <BR> | |
15505 | <UL> | |
15506 | <A NAME="TOC40" HREF="bashref.html#SEC40">3.6.1 Redirecting Input</A> | |
15507 | <BR> | |
15508 | <A NAME="TOC41" HREF="bashref.html#SEC41">3.6.2 Redirecting Output</A> | |
15509 | <BR> | |
15510 | <A NAME="TOC42" HREF="bashref.html#SEC42">3.6.3 Appending Redirected Output</A> | |
15511 | <BR> | |
15512 | <A NAME="TOC43" HREF="bashref.html#SEC43">3.6.4 Redirecting Standard Output and Standard Error</A> | |
15513 | <BR> | |
15514 | <A NAME="TOC44" HREF="bashref.html#SEC44">3.6.5 Appending Standard Output and Standard Error</A> | |
15515 | <BR> | |
15516 | <A NAME="TOC45" HREF="bashref.html#SEC45">3.6.6 Here Documents</A> | |
15517 | <BR> | |
15518 | <A NAME="TOC46" HREF="bashref.html#SEC46">3.6.7 Here Strings</A> | |
15519 | <BR> | |
15520 | <A NAME="TOC47" HREF="bashref.html#SEC47">3.6.8 Duplicating File Descriptors</A> | |
15521 | <BR> | |
15522 | <A NAME="TOC48" HREF="bashref.html#SEC48">3.6.9 Moving File Descriptors</A> | |
15523 | <BR> | |
15524 | <A NAME="TOC49" HREF="bashref.html#SEC49">3.6.10 Opening File Descriptors for Reading and Writing</A> | |
15525 | <BR> | |
15526 | </UL> | |
15527 | <A NAME="TOC50" HREF="bashref.html#SEC50">3.7 Executing Commands</A> | |
15528 | <BR> | |
15529 | <UL> | |
15530 | <A NAME="TOC51" HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A> | |
15531 | <BR> | |
15532 | <A NAME="TOC52" HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A> | |
15533 | <BR> | |
15534 | <A NAME="TOC53" HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A> | |
15535 | <BR> | |
15536 | <A NAME="TOC54" HREF="bashref.html#SEC54">3.7.4 Environment</A> | |
15537 | <BR> | |
15538 | <A NAME="TOC55" HREF="bashref.html#SEC55">3.7.5 Exit Status</A> | |
15539 | <BR> | |
15540 | <A NAME="TOC56" HREF="bashref.html#SEC56">3.7.6 Signals</A> | |
15541 | <BR> | |
15542 | </UL> | |
15543 | <A NAME="TOC57" HREF="bashref.html#SEC57">3.8 Shell Scripts</A> | |
15544 | <BR> | |
15545 | </UL> | |
15546 | <A NAME="TOC58" HREF="bashref.html#SEC58">4. Shell Builtin Commands</A> | |
15547 | <BR> | |
15548 | <UL> | |
15549 | <A NAME="TOC59" HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A> | |
15550 | <BR> | |
15551 | <A NAME="TOC60" HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A> | |
15552 | <BR> | |
15553 | <A NAME="TOC61" HREF="bashref.html#SEC61">4.3 Modifying Shell Behavior</A> | |
15554 | <BR> | |
15555 | <UL> | |
15556 | <A NAME="TOC62" HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A> | |
15557 | <BR> | |
15558 | <A NAME="TOC63" HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A> | |
15559 | <BR> | |
15560 | </UL> | |
15561 | <A NAME="TOC64" HREF="bashref.html#SEC64">4.4 Special Builtins</A> | |
15562 | <BR> | |
15563 | </UL> | |
15564 | <A NAME="TOC65" HREF="bashref.html#SEC65">5. Shell Variables</A> | |
15565 | <BR> | |
15566 | <UL> | |
15567 | <A NAME="TOC66" HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A> | |
15568 | <BR> | |
15569 | <A NAME="TOC67" HREF="bashref.html#SEC67">5.2 Bash Variables</A> | |
15570 | <BR> | |
15571 | </UL> | |
15572 | <A NAME="TOC68" HREF="bashref.html#SEC68">6. Bash Features</A> | |
15573 | <BR> | |
15574 | <UL> | |
15575 | <A NAME="TOC69" HREF="bashref.html#SEC69">6.1 Invoking Bash</A> | |
15576 | <BR> | |
15577 | <A NAME="TOC70" HREF="bashref.html#SEC70">6.2 Bash Startup Files</A> | |
15578 | <BR> | |
15579 | <A NAME="TOC78" HREF="bashref.html#SEC78">6.3 Interactive Shells</A> | |
15580 | <BR> | |
15581 | <UL> | |
15582 | <A NAME="TOC79" HREF="bashref.html#SEC79">6.3.1 What is an Interactive Shell?</A> | |
15583 | <BR> | |
15584 | <A NAME="TOC80" HREF="bashref.html#SEC80">6.3.2 Is this Shell Interactive?</A> | |
15585 | <BR> | |
15586 | <A NAME="TOC81" HREF="bashref.html#SEC81">6.3.3 Interactive Shell Behavior</A> | |
15587 | <BR> | |
15588 | </UL> | |
15589 | <A NAME="TOC82" HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A> | |
15590 | <BR> | |
15591 | <A NAME="TOC83" HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A> | |
15592 | <BR> | |
15593 | <A NAME="TOC84" HREF="bashref.html#SEC84">6.6 Aliases</A> | |
15594 | <BR> | |
15595 | <A NAME="TOC85" HREF="bashref.html#SEC85">6.7 Arrays</A> | |
15596 | <BR> | |
15597 | <A NAME="TOC86" HREF="bashref.html#SEC86">6.8 The Directory Stack</A> | |
15598 | <BR> | |
15599 | <UL> | |
15600 | <A NAME="TOC87" HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A> | |
15601 | <BR> | |
15602 | </UL> | |
15603 | <A NAME="TOC88" HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A> | |
15604 | <BR> | |
15605 | <A NAME="TOC89" HREF="bashref.html#SEC89">6.10 The Restricted Shell</A> | |
15606 | <BR> | |
15607 | <A NAME="TOC90" HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A> | |
15608 | <BR> | |
15609 | </UL> | |
15610 | <A NAME="TOC91" HREF="bashref.html#SEC91">7. Job Control</A> | |
15611 | <BR> | |
15612 | <UL> | |
15613 | <A NAME="TOC92" HREF="bashref.html#SEC92">7.1 Job Control Basics</A> | |
15614 | <BR> | |
15615 | <A NAME="TOC93" HREF="bashref.html#SEC93">7.2 Job Control Builtins</A> | |
15616 | <BR> | |
15617 | <A NAME="TOC94" HREF="bashref.html#SEC94">7.3 Job Control Variables</A> | |
15618 | <BR> | |
15619 | </UL> | |
15620 | <A NAME="TOC95" HREF="bashref.html#SEC95">8. Command Line Editing</A> | |
15621 | <BR> | |
15622 | <UL> | |
15623 | <A NAME="TOC96" HREF="bashref.html#SEC96">8.1 Introduction to Line Editing</A> | |
15624 | <BR> | |
15625 | <A NAME="TOC97" HREF="bashref.html#SEC97">8.2 Readline Interaction</A> | |
15626 | <BR> | |
15627 | <UL> | |
15628 | <A NAME="TOC98" HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A> | |
15629 | <BR> | |
15630 | <A NAME="TOC99" HREF="bashref.html#SEC99">8.2.2 Readline Movement Commands</A> | |
15631 | <BR> | |
15632 | <A NAME="TOC100" HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A> | |
15633 | <BR> | |
15634 | <A NAME="TOC101" HREF="bashref.html#SEC101">8.2.4 Readline Arguments</A> | |
15635 | <BR> | |
15636 | <A NAME="TOC102" HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A> | |
15637 | <BR> | |
15638 | </UL> | |
15639 | <A NAME="TOC103" HREF="bashref.html#SEC103">8.3 Readline Init File</A> | |
15640 | <BR> | |
15641 | <UL> | |
15642 | <A NAME="TOC104" HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A> | |
15643 | <BR> | |
15644 | <A NAME="TOC105" HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A> | |
15645 | <BR> | |
15646 | <A NAME="TOC106" HREF="bashref.html#SEC106">8.3.3 Sample Init File</A> | |
15647 | <BR> | |
15648 | </UL> | |
15649 | <A NAME="TOC107" HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A> | |
15650 | <BR> | |
15651 | <UL> | |
15652 | <A NAME="TOC108" HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A> | |
15653 | <BR> | |
15654 | <A NAME="TOC109" HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A> | |
15655 | <BR> | |
15656 | <A NAME="TOC110" HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A> | |
15657 | <BR> | |
15658 | <A NAME="TOC111" HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A> | |
15659 | <BR> | |
15660 | <A NAME="TOC112" HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A> | |
15661 | <BR> | |
15662 | <A NAME="TOC113" HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A> | |
15663 | <BR> | |
15664 | <A NAME="TOC114" HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A> | |
15665 | <BR> | |
15666 | <A NAME="TOC115" HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A> | |
15667 | <BR> | |
15668 | </UL> | |
15669 | <A NAME="TOC116" HREF="bashref.html#SEC116">8.5 Readline vi Mode</A> | |
15670 | <BR> | |
15671 | <A NAME="TOC117" HREF="bashref.html#SEC117">8.6 Programmable Completion</A> | |
15672 | <BR> | |
15673 | <A NAME="TOC118" HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A> | |
15674 | <BR> | |
15675 | </UL> | |
15676 | <A NAME="TOC119" HREF="bashref.html#SEC119">9. Using History Interactively</A> | |
15677 | <BR> | |
15678 | <UL> | |
15679 | <A NAME="TOC120" HREF="bashref.html#SEC120">9.1 Bash History Facilities</A> | |
15680 | <BR> | |
15681 | <A NAME="TOC121" HREF="bashref.html#SEC121">9.2 Bash History Builtins</A> | |
15682 | <BR> | |
15683 | <A NAME="TOC122" HREF="bashref.html#SEC122">9.3 History Expansion</A> | |
15684 | <BR> | |
15685 | <UL> | |
15686 | <A NAME="TOC123" HREF="bashref.html#SEC123">9.3.1 Event Designators</A> | |
15687 | <BR> | |
15688 | <A NAME="TOC124" HREF="bashref.html#SEC124">9.3.2 Word Designators</A> | |
15689 | <BR> | |
15690 | <A NAME="TOC125" HREF="bashref.html#SEC125">9.3.3 Modifiers</A> | |
15691 | <BR> | |
15692 | </UL> | |
15693 | </UL> | |
15694 | <A NAME="TOC126" HREF="bashref.html#SEC126">10. Installing Bash</A> | |
15695 | <BR> | |
15696 | <UL> | |
15697 | <A NAME="TOC127" HREF="bashref.html#SEC127">10.1 Basic Installation</A> | |
15698 | <BR> | |
15699 | <A NAME="TOC128" HREF="bashref.html#SEC128">10.2 Compilers and Options</A> | |
15700 | <BR> | |
15701 | <A NAME="TOC129" HREF="bashref.html#SEC129">10.3 Compiling For Multiple Architectures</A> | |
15702 | <BR> | |
15703 | <A NAME="TOC130" HREF="bashref.html#SEC130">10.4 Installation Names</A> | |
15704 | <BR> | |
15705 | <A NAME="TOC131" HREF="bashref.html#SEC131">10.5 Specifying the System Type</A> | |
15706 | <BR> | |
15707 | <A NAME="TOC132" HREF="bashref.html#SEC132">10.6 Sharing Defaults</A> | |
15708 | <BR> | |
15709 | <A NAME="TOC133" HREF="bashref.html#SEC133">10.7 Operation Controls</A> | |
15710 | <BR> | |
15711 | <A NAME="TOC134" HREF="bashref.html#SEC134">10.8 Optional Features</A> | |
15712 | <BR> | |
15713 | </UL> | |
15714 | <A NAME="TOC135" HREF="bashref.html#SEC135">A. Reporting Bugs</A> | |
15715 | <BR> | |
15716 | <A NAME="TOC136" HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A> | |
15717 | <BR> | |
15718 | <UL> | |
15719 | <A NAME="TOC137" HREF="bashref.html#SEC137">B.1 Implementation Differences From The SVR4.2 Shell</A> | |
15720 | <BR> | |
15721 | </UL> | |
15722 | <A NAME="TOC138" HREF="bashref.html#SEC138">C. GNU Free Documentation License</A> | |
15723 | <BR> | |
15724 | <A NAME="TOC140" HREF="bashref.html#SEC140">D. Indexes</A> | |
15725 | <BR> | |
15726 | <UL> | |
15727 | <A NAME="TOC141" HREF="bashref.html#SEC141">D.1 Index of Shell Builtin Commands</A> | |
15728 | <BR> | |
15729 | <A NAME="TOC142" HREF="bashref.html#SEC142">D.2 Index of Shell Reserved Words</A> | |
15730 | <BR> | |
15731 | <A NAME="TOC143" HREF="bashref.html#SEC143">D.3 Parameter and Variable Index</A> | |
15732 | <BR> | |
15733 | <A NAME="TOC144" HREF="bashref.html#SEC144">D.4 Function Index</A> | |
15734 | <BR> | |
15735 | <A NAME="TOC145" HREF="bashref.html#SEC145">D.5 Concept Index</A> | |
15736 | <BR> | |
15737 | </UL> | |
15738 | </UL> | |
15739 | <HR SIZE=1> | |
15740 | <A NAME="SEC_OVERVIEW"></A> | |
15741 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
15742 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
15743 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
15744 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
15745 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
15746 | </TR></TABLE> | |
15747 | <H1>Short Table of Contents</H1> | |
15748 | <BLOCKQUOTE> | |
15749 | <A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A> | |
15750 | <BR> | |
15751 | <A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A> | |
15752 | <BR> | |
15753 | <A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A> | |
15754 | <BR> | |
15755 | <A NAME="TOC58" HREF="bashref.html#SEC58">4. Shell Builtin Commands</A> | |
15756 | <BR> | |
15757 | <A NAME="TOC65" HREF="bashref.html#SEC65">5. Shell Variables</A> | |
15758 | <BR> | |
15759 | <A NAME="TOC68" HREF="bashref.html#SEC68">6. Bash Features</A> | |
15760 | <BR> | |
15761 | <A NAME="TOC91" HREF="bashref.html#SEC91">7. Job Control</A> | |
15762 | <BR> | |
15763 | <A NAME="TOC95" HREF="bashref.html#SEC95">8. Command Line Editing</A> | |
15764 | <BR> | |
15765 | <A NAME="TOC119" HREF="bashref.html#SEC119">9. Using History Interactively</A> | |
15766 | <BR> | |
15767 | <A NAME="TOC126" HREF="bashref.html#SEC126">10. Installing Bash</A> | |
15768 | <BR> | |
15769 | <A NAME="TOC135" HREF="bashref.html#SEC135">A. Reporting Bugs</A> | |
15770 | <BR> | |
15771 | <A NAME="TOC136" HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A> | |
15772 | <BR> | |
15773 | <A NAME="TOC138" HREF="bashref.html#SEC138">C. GNU Free Documentation License</A> | |
15774 | <BR> | |
15775 | <A NAME="TOC140" HREF="bashref.html#SEC140">D. Indexes</A> | |
15776 | <BR> | |
15777 | ||
15778 | </BLOCKQUOTE> | |
15779 | <HR SIZE=1> | |
15780 | <A NAME="SEC_About"></A> | |
15781 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> | |
15782 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> | |
15783 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> | |
15784 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD> | |
15785 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> | |
15786 | </TR></TABLE> | |
15787 | <H1>About this document</H1> | |
15788 | This document was generated by <I>Chet Ramey</I> on <I>February, 5 2009</I> | |
15789 | using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html | |
15790 | "><I>texi2html</I></A> | |
15791 | <P></P> | |
15792 | The buttons in the navigation panels have the following meaning: | |
15793 | <P></P> | |
15794 | <table border = "1"> | |
15795 | <TR> | |
15796 | <TH> Button </TH> | |
15797 | <TH> Name </TH> | |
15798 | <TH> Go to </TH> | |
15799 | <TH> From 1.2.3 go to</TH> | |
15800 | </TR> | |
15801 | <TR> | |
15802 | <TD ALIGN="CENTER"> | |
15803 | [ < ] </TD> | |
15804 | <TD ALIGN="CENTER"> | |
15805 | Back | |
15806 | </TD> | |
15807 | <TD> | |
15808 | previous section in reading order | |
15809 | </TD> | |
15810 | <TD> | |
15811 | 1.2.2 | |
15812 | </TD> | |
15813 | </TR> | |
15814 | <TR> | |
15815 | <TD ALIGN="CENTER"> | |
15816 | [ > ] </TD> | |
15817 | <TD ALIGN="CENTER"> | |
15818 | Forward | |
15819 | </TD> | |
15820 | <TD> | |
15821 | next section in reading order | |
15822 | </TD> | |
15823 | <TD> | |
15824 | 1.2.4 | |
15825 | </TD> | |
15826 | </TR> | |
15827 | <TR> | |
15828 | <TD ALIGN="CENTER"> | |
15829 | [ << ] </TD> | |
15830 | <TD ALIGN="CENTER"> | |
15831 | FastBack | |
15832 | </TD> | |
15833 | <TD> | |
15834 | previous or up-and-previous section | |
15835 | </TD> | |
15836 | <TD> | |
15837 | 1.1 | |
15838 | </TD> | |
15839 | </TR> | |
15840 | <TR> | |
15841 | <TD ALIGN="CENTER"> | |
15842 | [ Up ] </TD> | |
15843 | <TD ALIGN="CENTER"> | |
15844 | Up | |
15845 | </TD> | |
15846 | <TD> | |
15847 | up section | |
15848 | </TD> | |
15849 | <TD> | |
15850 | 1.2 | |
15851 | </TD> | |
15852 | </TR> | |
15853 | <TR> | |
15854 | <TD ALIGN="CENTER"> | |
15855 | [ >> ] </TD> | |
15856 | <TD ALIGN="CENTER"> | |
15857 | FastForward | |
15858 | </TD> | |
15859 | <TD> | |
15860 | next or up-and-next section | |
15861 | </TD> | |
15862 | <TD> | |
15863 | 1.3 | |
15864 | </TD> | |
15865 | </TR> | |
15866 | <TR> | |
15867 | <TD ALIGN="CENTER"> | |
15868 | [Top] </TD> | |
15869 | <TD ALIGN="CENTER"> | |
15870 | Top | |
15871 | </TD> | |
15872 | <TD> | |
15873 | cover (top) of document | |
15874 | </TD> | |
15875 | <TD> | |
15876 | | |
15877 | </TD> | |
15878 | </TR> | |
15879 | <TR> | |
15880 | <TD ALIGN="CENTER"> | |
15881 | [Contents] </TD> | |
15882 | <TD ALIGN="CENTER"> | |
15883 | Contents | |
15884 | </TD> | |
15885 | <TD> | |
15886 | table of contents | |
15887 | </TD> | |
15888 | <TD> | |
15889 | | |
15890 | </TD> | |
15891 | </TR> | |
15892 | <TR> | |
15893 | <TD ALIGN="CENTER"> | |
15894 | [Index] </TD> | |
15895 | <TD ALIGN="CENTER"> | |
15896 | Index | |
15897 | </TD> | |
15898 | <TD> | |
15899 | concept index | |
15900 | </TD> | |
15901 | <TD> | |
15902 | | |
15903 | </TD> | |
15904 | </TR> | |
15905 | <TR> | |
15906 | <TD ALIGN="CENTER"> | |
15907 | [ ? ] </TD> | |
15908 | <TD ALIGN="CENTER"> | |
15909 | About | |
15910 | </TD> | |
15911 | <TD> | |
15912 | this page | |
15913 | </TD> | |
15914 | <TD> | |
15915 | | |
15916 | </TD> | |
15917 | </TR> | |
15918 | </TABLE> | |
15919 | <P></P> | |
15920 | where the <STRONG> Example </STRONG> assumes that the current position | |
15921 | is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of | |
15922 | the following structure: | |
15923 | <UL> | |
15924 | <LI> 1. Section One </LI> | |
15925 | <UL> | |
15926 | <LI>1.1 Subsection One-One</LI> | |
15927 | <UL> | |
15928 | <LI> ... </LI> | |
15929 | </UL> | |
15930 | <LI>1.2 Subsection One-Two</LI> | |
15931 | <UL> | |
15932 | <LI>1.2.1 Subsubsection One-Two-One | |
15933 | </LI><LI>1.2.2 Subsubsection One-Two-Two | |
15934 | </LI><LI>1.2.3 Subsubsection One-Two-Three <STRONG> | |
15935 | <== Current Position </STRONG> | |
15936 | </LI><LI>1.2.4 Subsubsection One-Two-Four | |
15937 | </LI></UL> | |
15938 | <LI>1.3 Subsection One-Three</LI> | |
15939 | <UL> | |
15940 | <LI> ... </LI> | |
15941 | </UL> | |
15942 | <LI>1.4 Subsection One-Four</LI> | |
15943 | </UL> | |
15944 | </UL> | |
15945 | ||
15946 | <HR SIZE=1> | |
15947 | <BR> | |
15948 | <FONT SIZE="-1"> | |
15949 | This document was generated | |
15950 | by <I>Chet Ramey</I> on <I>February, 5 2009</I> | |
15951 | using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html | |
15952 | "><I>texi2html</I></A> | |
15953 | ||
15954 | </BODY> | |
15955 | </HTML> |