1<HTML> 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 3<!-- Created on October, 3 2005 by texi2html 1.64 --> 4<!-- 5Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) 6 Karl Berry <karl@freefriends.org> 7 Olaf Bachmann <obachman@mathematik.uni-kl.de> 8 and many others. 9Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de> 10Send bugs and suggestions to <texi2html@mathematik.uni-kl.de> 11 12--> 13<HEAD> 14<TITLE>Bash Reference Manual: </TITLE> 15 16<META NAME="description" CONTENT="Bash Reference Manual: "> 17<META NAME="keywords" CONTENT="Bash Reference Manual: "> 18<META NAME="resource-type" CONTENT="document"> 19<META NAME="distribution" CONTENT="global"> 20<META NAME="Generator" CONTENT="texi2html 1.64"> 21 22</HEAD> 23 24<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"> 25 26<A NAME="SEC_Top"></A> 27<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 28<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 29<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 30<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 31<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 32</TR></TABLE> 33<H1>Bash Reference Manual</H1></P><P> 34 35This text is a brief description of the features that are present in 36the Bash shell (version 3.1-beta1, 5 September 2005).. 37</P><P> 38 39This is Edition 3.1-beta1, last updated 5 September 2005, 40of <CITE>The GNU Bash Reference Manual</CITE>, 41for <CODE>Bash</CODE>, Version 3.1-beta1. 42</P><P> 43 44Bash contains features that appear in other popular shells, and some 45features that only appear in Bash. Some of the shells that Bash has 46borrowed concepts from are the Bourne Shell (<TT>`sh'</TT>), the Korn Shell 47(<TT>`ksh'</TT>), and the C-shell (<TT>`csh'</TT> and its successor, 48<TT>`tcsh'</TT>). The following menu breaks the features up into 49categories based upon which one of these other shells inspired the 50feature. 51</P><P> 52 53This manual is meant as a brief introduction to features found in 54Bash. The Bash manual page should be used as the definitive 55reference on shell behavior. 56</P><P> 57 58<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 59<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC1">1. Introduction</A></TD><TD> </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#SEC56">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#SEC61">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#SEC64">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#SEC87">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#SEC115">9. Using History Interactively</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Command History Expansion</TD></TR> 69<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC91">8. Command Line Editing</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Chapter describing the command line 70 editing features.</TD></TR> 71<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC122">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#SEC131">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#SEC132">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#SEC134">C. Copying This Manual</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Copying this manual.</TD></TR> 77<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC137">Index of Shell Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash builtin commands.</TD></TR> 78<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC138">Index of Shell Reserved Words</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash reserved words.</TD></TR> 79<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC139">Parameter and Variable Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Quick reference helps you find the 80 variable you want.</TD></TR> 81<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC140">Function Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of bindable Readline functions.</TD></TR> 82<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC141">Concept Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">General index for concepts described in 83 this manual.</TD></TR> 84</TABLE></BLOCKQUOTE> 85<P> 86 87<HR SIZE=1> 88<A NAME="SEC1"></A> 89<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 90<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> < </A>]</TD> 91<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> > </A>]</TD> 92<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 93<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 94<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD> 95<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 96<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 97<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 98<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 99</TR></TABLE> 100<A NAME="Introduction"></A> 101<H1> 1. Introduction </H1> 102<!--docid::SEC1::--> 103<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 104<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> 105<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> 106</TABLE></BLOCKQUOTE> 107<P> 108 109<A NAME="What is Bash?"></A> 110<HR SIZE="6"> 111<A NAME="SEC2"></A> 112<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 113<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> < </A>]</TD> 114<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> > </A>]</TD> 115<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 116<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD> 117<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD> 118<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 119<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 120<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 121<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 122</TR></TABLE> 123<H2> 1.1 What is Bash? </H2> 124<!--docid::SEC2::--> 125<P> 126 127Bash is the shell, or command language interpreter, 128for the GNU operating system. 129The name is an acronym for the <SAMP>`Bourne-Again SHell'</SAMP>, 130a pun on Stephen Bourne, the author of the direct ancestor of 131the current Unix shell <CODE>sh</CODE>, 132which appeared in the Seventh Edition Bell Labs Research version 133of Unix. 134</P><P> 135 136Bash is largely compatible with <CODE>sh</CODE> and incorporates useful 137features from the Korn shell <CODE>ksh</CODE> and the C shell <CODE>csh</CODE>. 138It is intended to be a conformant implementation of the IEEE 139POSIX Shell and Tools specification (IEEE Working Group 1003.2). 140It offers functional improvements over <CODE>sh</CODE> for both interactive and 141programming use. 142</P><P> 143 144While the GNU operating system provides other shells, including 145a version of <CODE>csh</CODE>, Bash is the default shell. 146Like other GNU software, Bash is quite portable. It currently runs 147on nearly every version of Unix and a few other operating systems - 148independently-supported ports exist for MS-DOS, OS/2, 149and Windows platforms. 150</P><P> 151 152<A NAME="What is a shell?"></A> 153<HR SIZE="6"> 154<A NAME="SEC3"></A> 155<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 156<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> < </A>]</TD> 157<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> > </A>]</TD> 158<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 159<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD> 160<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD> 161<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 162<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 163<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 164<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 165</TR></TABLE> 166<H2> 1.2 What is a shell? </H2> 167<!--docid::SEC3::--> 168<P> 169 170At its base, a shell is simply a macro processor that executes 171commands. The term macro processor means functionality where text 172and symbols are expanded to create larger expressions. 173</P><P> 174 175A Unix shell is both a command interpreter and a programming 176language. As a command interpreter, the shell provides the user 177interface to the rich set of GNU utilities. The programming 178language features allow these utilitites to be combined. 179Files containing commands can be created, and become 180commands themselves. These new commands have the same status as 181system commands in directories such as <TT>`/bin'</TT>, allowing users 182or groups to establish custom environments to automate their common 183tasks. 184</P><P> 185 186Shells may be used interactively or non-interactively. In 187interactive mode, they accept input typed from the keyboard. 188When executing non-interactively, shells execute commands read 189from a file. 190</P><P> 191 192A shell allows execution of GNU commands, both synchronously and 193asynchronously. 194The shell waits for synchronous commands to complete before accepting 195more input; asynchronous commands continue to execute in parallel 196with the shell while it reads and executes additional commands. 197The <EM>redirection</EM> constructs permit 198fine-grained control of the input and output of those commands. 199Moreover, the shell allows control over the contents of commands' 200environments. 201</P><P> 202 203Shells also provide a small set of built-in 204commands (<EM>builtins</EM>) implementing functionality impossible 205or inconvenient to obtain via separate utilities. 206For example, <CODE>cd</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, and 207<CODE>exec</CODE>) cannot be implemented outside of the shell because 208they directly manipulate the shell itself. 209The <CODE>history</CODE>, <CODE>getopts</CODE>, <CODE>kill</CODE>, or <CODE>pwd</CODE> 210builtins, among others, could be implemented in separate utilities, 211but they are more convenient to use as builtin commands. 212All of the shell builtins are described in 213subsequent sections. 214</P><P> 215 216While executing commands is essential, most of the power (and 217complexity) of shells is due to their embedded programming 218languages. Like any high-level language, the shell provides 219variables, flow control constructs, quoting, and functions. 220</P><P> 221 222Shells offer features geared specifically for 223interactive use rather than to augment the programming language. 224These interactive features include job control, command line 225editing, command history and aliases. Each of these features is 226described in this manual. 227</P><P> 228 229<A NAME="Definitions"></A> 230<HR SIZE="6"> 231<A NAME="SEC4"></A> 232<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 233<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> < </A>]</TD> 234<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> > </A>]</TD> 235<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> 236<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 237<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> >> </A>]</TD> 238<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 239<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 240<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 241<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 242</TR></TABLE> 243<H1> 2. Definitions </H1> 244<!--docid::SEC4::--> 245These definitions are used throughout the remainder of this manual. 246<P> 247 248<DL COMPACT> 249 250<DT><CODE>POSIX</CODE> 251<DD><A NAME="IDX1"></A> 252A family of open system standards based on Unix. Bash 253is concerned with POSIX 1003.2, the Shell and Tools Standard. 254<P> 255 256<DT><CODE>blank</CODE> 257<DD>A space or tab character. 258<P> 259 260<DT><CODE>builtin</CODE> 261<DD><A NAME="IDX2"></A> 262A command that is implemented internally by the shell itself, rather 263than by an executable program somewhere in the file system. 264<P> 265 266<DT><CODE>control operator</CODE> 267<DD><A NAME="IDX3"></A> 268A <CODE>word</CODE> that performs a control function. It is a <CODE>newline</CODE> 269or one of the following: 270<SAMP>`||'</SAMP>, <SAMP>`&&'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`;;'</SAMP>, 271<SAMP>`|'</SAMP>, <SAMP>`('</SAMP>, or <SAMP>`)'</SAMP>. 272<P> 273 274<DT><CODE>exit status</CODE> 275<DD><A NAME="IDX4"></A> 276The value returned by a command to its caller. The value is restricted 277to eight bits, so the maximum value is 255. 278<P> 279 280<DT><CODE>field</CODE> 281<DD><A NAME="IDX5"></A> 282A unit of text that is the result of one of the shell expansions. After 283expansion, when executing a command, the resulting fields are used as 284the command name and arguments. 285<P> 286 287<DT><CODE>filename</CODE> 288<DD><A NAME="IDX6"></A> 289A string of characters used to identify a file. 290<P> 291 292<DT><CODE>job</CODE> 293<DD><A NAME="IDX7"></A> 294A set of processes comprising a pipeline, and any processes descended 295from it, that are all in the same process group. 296<P> 297 298<DT><CODE>job control</CODE> 299<DD><A NAME="IDX8"></A> 300A mechanism by which users can selectively stop (suspend) and restart 301(resume) execution of processes. 302<P> 303 304<DT><CODE>metacharacter</CODE> 305<DD><A NAME="IDX9"></A> 306A character that, when unquoted, separates words. A metacharacter is 307a <CODE>blank</CODE> or one of the following characters: 308<SAMP>`|'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`('</SAMP>, <SAMP>`)'</SAMP>, <SAMP>`<'</SAMP>, or 309<SAMP>`>'</SAMP>. 310<P> 311 312<DT><CODE>name</CODE> 313<DD><A NAME="IDX10"></A> 314<A NAME="IDX11"></A> 315A <CODE>word</CODE> consisting solely of letters, numbers, and underscores, 316and beginning with a letter or underscore. <CODE>Name</CODE>s are used as 317shell variable and function names. 318Also referred to as an <CODE>identifier</CODE>. 319<P> 320 321<DT><CODE>operator</CODE> 322<DD><A NAME="IDX12"></A> 323A <CODE>control operator</CODE> or a <CODE>redirection operator</CODE>. 324See section <A HREF="bashref.html#SEC38">3.6 Redirections</A>, for a list of redirection operators. 325<P> 326 327<DT><CODE>process group</CODE> 328<DD><A NAME="IDX13"></A> 329A collection of related processes each having the same process 330group ID. 331<P> 332 333<DT><CODE>process group ID</CODE> 334<DD><A NAME="IDX14"></A> 335A unique identifer that represents a <CODE>process group</CODE> 336during its lifetime. 337<P> 338 339<DT><CODE>reserved word</CODE> 340<DD><A NAME="IDX15"></A> 341A <CODE>word</CODE> that has a special meaning to the shell. Most reserved 342words introduce shell flow control constructs, such as <CODE>for</CODE> and 343<CODE>while</CODE>. 344<P> 345 346<DT><CODE>return status</CODE> 347<DD><A NAME="IDX16"></A> 348A synonym for <CODE>exit status</CODE>. 349<P> 350 351<DT><CODE>signal</CODE> 352<DD><A NAME="IDX17"></A> 353A mechanism by which a process may be notified by the kernel 354of an event occurring in the system. 355<P> 356 357<DT><CODE>special builtin</CODE> 358<DD><A NAME="IDX18"></A> 359A shell builtin command that has been classified as special by the 360POSIX 1003.2 standard. 361<P> 362 363<DT><CODE>token</CODE> 364<DD><A NAME="IDX19"></A> 365A sequence of characters considered a single unit by the shell. It is 366either a <CODE>word</CODE> or an <CODE>operator</CODE>. 367<P> 368 369<DT><CODE>word</CODE> 370<DD><A NAME="IDX20"></A> 371A <CODE>token</CODE> that is not an <CODE>operator</CODE>. 372</DL> 373<P> 374 375<A NAME="Basic Shell Features"></A> 376<HR SIZE="6"> 377<A NAME="SEC5"></A> 378<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 379<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> < </A>]</TD> 380<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> > </A>]</TD> 381<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> << </A>]</TD> 382<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 383<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> >> </A>]</TD> 384<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 385<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 386<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 387<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 388</TR></TABLE> 389<H1> 3. Basic Shell Features </H1> 390<!--docid::SEC5::--> 391<P> 392 393Bash is an acronym for <SAMP>`Bourne-Again SHell'</SAMP>. 394The Bourne shell is 395the traditional Unix shell originally written by Stephen Bourne. 396All of the Bourne shell builtin commands are available in Bash, 397The rules for evaluation and quoting are taken from the POSIX 398specification for the `standard' Unix shell. 399</P><P> 400 401This chapter briefly summarizes the shell's `building blocks': 402commands, control structures, shell functions, shell <I>parameters</I>, 403shell expansions, 404<I>redirections</I>, which are a way to direct input and output from 405and to named files, and how the shell executes commands. 406</P><P> 407 408<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 409<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> 410<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> 411<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC23">3.3 Shell Functions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Grouping commands by name.</TD></TR> 412<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC24">3.4 Shell Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the shell stores values.</TD></TR> 413<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC27">3.5 Shell Expansions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands parameters and the various 414 expansions available.</TD></TR> 415<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC38">3.6 Redirections</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A way to control where input and output go.</TD></TR> 416<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC48">3.7 Executing Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What happens when you run a command.</TD></TR> 417<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC55">3.8 Shell Scripts</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Executing files of shell commands.</TD></TR> 418</TABLE></BLOCKQUOTE> 419<P> 420 421<A NAME="Shell Syntax"></A> 422<HR SIZE="6"> 423<A NAME="SEC6"></A> 424<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 425<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> < </A>]</TD> 426<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> > </A>]</TD> 427<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> 428<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> 429<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD> 430<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 431<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 432<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 433<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 434</TR></TABLE> 435<H2> 3.1 Shell Syntax </H2> 436<!--docid::SEC6::--> 437<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 438<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> 439<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> 440<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> 441</TABLE></BLOCKQUOTE> 442<P> 443 444When the shell reads input, it proceeds through a 445sequence of operations. If the input indicates the beginning of a 446comment, the shell ignores the comment symbol (<SAMP>`#'</SAMP>), and the rest 447of that line. 448 449Otherwise, roughly speaking, the shell reads its input and 450divides the input into words and operators, employing the quoting rules 451to select which meanings to assign various words and characters. 452</P><P> 453 454The shell then parses these tokens into commands and other constructs, 455removes the special meaning of certain words or characters, expands 456others, redirects input and output as needed, executes the specified 457command, waits for the command's exit status, and makes that exit status 458available for further inspection or processing. 459</P><P> 460 461<A NAME="Shell Operation"></A> 462<HR SIZE="6"> 463<A NAME="SEC7"></A> 464<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 465<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> < </A>]</TD> 466<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> > </A>]</TD> 467<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> 468<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD> 469<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD> 470<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 471<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 472<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 473<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 474</TR></TABLE> 475<H3> 3.1.1 Shell Operation </H3> 476<!--docid::SEC7::--> 477<P> 478 479The following is a brief description of the shell's operation when it 480reads and executes a command. Basically, the shell does the 481following: 482</P><P> 483 484<OL> 485<LI> 486Reads its input from a file (see section <A HREF="bashref.html#SEC55">3.8 Shell Scripts</A>), from a string 487supplied as an argument to the <SAMP>`-c'</SAMP> invocation option 488(see section <A HREF="bashref.html#SEC65">6.1 Invoking Bash</A>), or from the user's terminal. 489<P> 490 491<LI> 492Breaks the input into words and operators, obeying the quoting rules 493described in <A HREF="bashref.html#SEC8">3.1.2 Quoting</A>. These tokens are separated by 494<CODE>metacharacters</CODE>. Alias expansion is performed by this step 495(see section <A HREF="bashref.html#SEC80">6.6 Aliases</A>). 496<P> 497 498<LI> 499Parses the tokens into simple and compound commands 500(see section <A HREF="bashref.html#SEC15">3.2 Shell Commands</A>). 501<P> 502 503<LI> 504Performs the various shell expansions (see section <A HREF="bashref.html#SEC27">3.5 Shell Expansions</A>), breaking 505the expanded tokens into lists of filenames (see section <A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A>) 506and commands and arguments. 507<P> 508 509<LI> 510Performs any necessary redirections (see section <A HREF="bashref.html#SEC38">3.6 Redirections</A>) and removes 511the redirection operators and their operands from the argument list. 512<P> 513 514<LI> 515Executes the command (see section <A HREF="bashref.html#SEC48">3.7 Executing Commands</A>). 516<P> 517 518<LI> 519Optionally waits for the command to complete and collects its exit 520status (see section <A HREF="bashref.html#SEC53">3.7.5 Exit Status</A>). 521<P> 522 523</OL> 524<P> 525 526<A NAME="Quoting"></A> 527<HR SIZE="6"> 528<A NAME="SEC8"></A> 529<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 530<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> < </A>]</TD> 531<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> > </A>]</TD> 532<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD> 533<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD> 534<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> 535<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 536<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 537<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 538<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 539</TR></TABLE> 540<H3> 3.1.2 Quoting </H3> 541<!--docid::SEC8::--> 542<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 543<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 544 character.</TD></TR> 545<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 546 of characters.</TD></TR> 547<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 548 sequence of characters.</TD></TR> 549<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> 550<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> 551</TABLE></BLOCKQUOTE> 552<P> 553 554Quoting is used to remove the special meaning of certain 555characters or words to the shell. Quoting can be used to 556disable special treatment for special characters, to prevent 557reserved words from being recognized as such, and to prevent 558parameter expansion. 559</P><P> 560 561Each of the shell metacharacters (see section <A HREF="bashref.html#SEC4">2. Definitions</A>) 562has special meaning to the shell and must be quoted if it is to 563represent itself. 564When the command history expansion facilities are being used 565(see section <A HREF="bashref.html#SEC118">9.3 History Expansion</A>), the 566<VAR>history expansion</VAR> character, usually <SAMP>`!'</SAMP>, must be quoted 567to prevent history expansion. See section <A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A>, for 568more details concerning history expansion. 569</P><P> 570 571There are three quoting mechanisms: the 572<VAR>escape character</VAR>, single quotes, and double quotes. 573</P><P> 574 575<A NAME="Escape Character"></A> 576<HR SIZE="6"> 577<A NAME="SEC9"></A> 578<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 579<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> < </A>]</TD> 580<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> > </A>]</TD> 581<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD> 582<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> 583<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> 584<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 585<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 586<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 587<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 588</TR></TABLE> 589<H4> 3.1.2.1 Escape Character </H4> 590<!--docid::SEC9::--> 591A non-quoted backslash <SAMP>`\'</SAMP> is the Bash escape character. 592It preserves the literal value of the next character that follows, 593with the exception of <CODE>newline</CODE>. If a <CODE>\newline</CODE> pair 594appears, and the backslash itself is not quoted, the <CODE>\newline</CODE> 595is treated as a line continuation (that is, it is removed from 596the input stream and effectively ignored). 597<P> 598 599<A NAME="Single Quotes"></A> 600<HR SIZE="6"> 601<A NAME="SEC10"></A> 602<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 603<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> < </A>]</TD> 604<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> > </A>]</TD> 605<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> << </A>]</TD> 606<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> 607<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> 608<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 609<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 610<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 611<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 612</TR></TABLE> 613<H4> 3.1.2.2 Single Quotes </H4> 614<!--docid::SEC10::--> 615<P> 616 617Enclosing characters in single quotes (<SAMP>`''</SAMP>) preserves the literal value 618of each character within the quotes. A single quote may not occur 619between single quotes, even when preceded by a backslash. 620</P><P> 621 622<A NAME="Double Quotes"></A> 623<HR SIZE="6"> 624<A NAME="SEC11"></A> 625<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 626<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> < </A>]</TD> 627<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> > </A>]</TD> 628<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> << </A>]</TD> 629<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> 630<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> 631<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 632<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 633<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 634<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 635</TR></TABLE> 636<H4> 3.1.2.3 Double Quotes </H4> 637<!--docid::SEC11::--> 638<P> 639 640Enclosing characters in double quotes (<SAMP>`"'</SAMP>) preserves the literal value 641of all characters within the quotes, with the exception of 642<SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`\'</SAMP>, 643and, when history expansion is enabled, <SAMP>`!'</SAMP>. 644The characters <SAMP>`$'</SAMP> and <SAMP>``'</SAMP> 645retain their special meaning within double quotes (see section <A HREF="bashref.html#SEC27">3.5 Shell Expansions</A>). 646The backslash retains its special meaning only when followed by one of 647the following characters: 648<SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`"'</SAMP>, <SAMP>`\'</SAMP>, or <CODE>newline</CODE>. 649Within double quotes, backslashes that are followed by one of these 650characters are removed. Backslashes preceding characters without a 651special meaning are left unmodified. 652A double quote may be quoted within double quotes by preceding it with 653a backslash. 654If enabled, history expansion will be performed unless an <SAMP>`!'</SAMP> 655appearing in double quotes is escaped using a backslash. 656The backslash preceding the <SAMP>`!'</SAMP> is not removed. 657</P><P> 658 659The special parameters <SAMP>`*'</SAMP> and <SAMP>`@'</SAMP> have special meaning 660when in double quotes (see section <A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A>). 661</P><P> 662 663<A NAME="ANSI-C Quoting"></A> 664<HR SIZE="6"> 665<A NAME="SEC12"></A> 666<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 667<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> < </A>]</TD> 668<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> > </A>]</TD> 669<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> << </A>]</TD> 670<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> 671<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> 672<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 673<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 674<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 675<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 676</TR></TABLE> 677<H4> 3.1.2.4 ANSI-C Quoting </H4> 678<!--docid::SEC12::--> 679<P> 680 681Words of the form <CODE>$'<VAR>string</VAR>'</CODE> are treated specially. The 682word expands to <VAR>string</VAR>, with backslash-escaped characters replaced 683as specified by the ANSI C standard. Backslash escape sequences, if 684present, are decoded as follows: 685</P><P> 686 687<DL COMPACT> 688<DT><CODE>\a</CODE> 689<DD>alert (bell) 690<DT><CODE>\b</CODE> 691<DD>backspace 692<DT><CODE>\e</CODE> 693<DD>an escape character (not ANSI C) 694<DT><CODE>\f</CODE> 695<DD>form feed 696<DT><CODE>\n</CODE> 697<DD>newline 698<DT><CODE>\r</CODE> 699<DD>carriage return 700<DT><CODE>\t</CODE> 701<DD>horizontal tab 702<DT><CODE>\v</CODE> 703<DD>vertical tab 704<DT><CODE>\\</CODE> 705<DD>backslash 706<DT><CODE>\'</CODE> 707<DD>single quote 708<DT><CODE>\<VAR>nnn</VAR></CODE> 709<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR> 710(one to three digits) 711<DT><CODE>\x<VAR>HH</VAR></CODE> 712<DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR> 713(one or two hex digits) 714<DT><CODE>\c<VAR>x</VAR></CODE> 715<DD>a control-<VAR>x</VAR> character 716</DL> 717<P> 718 719The expanded result is single-quoted, as if the dollar sign had not 720been present. 721</P><P> 722 723<A NAME="Locale Translation"></A> 724<HR SIZE="6"> 725<A NAME="SEC13"></A> 726<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 727<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> < </A>]</TD> 728<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> > </A>]</TD> 729<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD> 730<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD> 731<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD> 732<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 733<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 734<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 735<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 736</TR></TABLE> 737<H4> 3.1.2.5 Locale-Specific Translation </H4> 738<!--docid::SEC13::--> 739<P> 740 741A double-quoted string preceded by a dollar sign (<SAMP>`$'</SAMP>) will cause 742the string to be translated according to the current locale. 743If the current locale is <CODE>C</CODE> or <CODE>POSIX</CODE>, the dollar sign 744is ignored. 745If the string is translated and replaced, the replacement is 746double-quoted. 747</P><P> 748 749<A NAME="IDX21"></A> 750<A NAME="IDX22"></A> 751<A NAME="IDX23"></A> 752Some systems use the message catalog selected by the <CODE>LC_MESSAGES</CODE> 753shell variable. Others create the name of the message catalog from the 754value of the <CODE>TEXTDOMAIN</CODE> shell variable, possibly adding a 755suffix of <SAMP>`.mo'</SAMP>. If you use the <CODE>TEXTDOMAIN</CODE> variable, you 756may need to set the <CODE>TEXTDOMAINDIR</CODE> variable to the location of 757the message catalog files. Still others use both variables in this 758fashion: 759<CODE>TEXTDOMAINDIR</CODE>/<CODE>LC_MESSAGES</CODE>/LC_MESSAGES/<CODE>TEXTDOMAIN</CODE>.mo. 760</P><P> 761 762<A NAME="Comments"></A> 763<HR SIZE="6"> 764<A NAME="SEC14"></A> 765<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 766<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> < </A>]</TD> 767<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> > </A>]</TD> 768<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> 769<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD> 770<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD> 771<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 772<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 773<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 774<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 775</TR></TABLE> 776<H3> 3.1.3 Comments </H3> 777<!--docid::SEC14::--> 778<P> 779 780In a non-interactive shell, or an interactive shell in which the 781<CODE>interactive_comments</CODE> option to the <CODE>shopt</CODE> 782builtin is enabled (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>), 783a word beginning with <SAMP>`#'</SAMP> 784causes that word and all remaining characters on that line to 785be ignored. An interactive shell without the <CODE>interactive_comments</CODE> 786option enabled does not allow comments. The <CODE>interactive_comments</CODE> 787option is on by default in interactive shells. 788See section <A HREF="bashref.html#SEC74">6.3 Interactive Shells</A>, for a description of what makes 789a shell interactive. 790</P><P> 791 792<A NAME="Shell Commands"></A> 793<HR SIZE="6"> 794<A NAME="SEC15"></A> 795<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 796<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> < </A>]</TD> 797<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> > </A>]</TD> 798<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> 799<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> 800<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> 801<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 802<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 803<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 804<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 805</TR></TABLE> 806<H2> 3.2 Shell Commands </H2> 807<!--docid::SEC15::--> 808<P> 809 810A simple shell command such as <CODE>echo a b c</CODE> consists of the command 811itself followed by arguments, separated by spaces. 812</P><P> 813 814More complex shell commands are composed of simple commands arranged together 815in a variety of ways: in a pipeline in which the output of one command 816becomes the input of a second, in a loop or conditional construct, or in 817some other grouping. 818</P><P> 819 820<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 821<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> 822<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 823 commands.</TD></TR> 824<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> 825<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> 826</TABLE></BLOCKQUOTE> 827<P> 828 829<A NAME="Simple Commands"></A> 830<HR SIZE="6"> 831<A NAME="SEC16"></A> 832<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 833<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> < </A>]</TD> 834<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> > </A>]</TD> 835<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> 836<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> 837<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> 838<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 839<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 840<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 841<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 842</TR></TABLE> 843<H3> 3.2.1 Simple Commands </H3> 844<!--docid::SEC16::--> 845<P> 846 847A simple command is the kind of command encountered most often. 848It's just a sequence of words separated by <CODE>blank</CODE>s, terminated 849by one of the shell's control operators (see section <A HREF="bashref.html#SEC4">2. Definitions</A>). The 850first word generally specifies a command to be executed, with the 851rest of the words being that command's arguments. 852</P><P> 853 854The return status (see section <A HREF="bashref.html#SEC53">3.7.5 Exit Status</A>) of a simple command is 855its exit status as provided 856by the POSIX 1003.1 <CODE>waitpid</CODE> function, or 128+<VAR>n</VAR> if 857the command was terminated by signal <VAR>n</VAR>. 858</P><P> 859 860<A NAME="Pipelines"></A> 861<HR SIZE="6"> 862<A NAME="SEC17"></A> 863<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 864<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> < </A>]</TD> 865<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> > </A>]</TD> 866<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> << </A>]</TD> 867<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> 868<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> 869<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 870<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 871<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 872<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 873</TR></TABLE> 874<H3> 3.2.2 Pipelines </H3> 875<!--docid::SEC17::--> 876<P> 877 878A <CODE>pipeline</CODE> is a sequence of simple commands separated by 879<SAMP>`|'</SAMP>. 880</P><P> 881 882<A NAME="IDX24"></A> 883<A NAME="IDX25"></A> 884<A NAME="IDX26"></A> 885The format for a pipeline is 886<TABLE><tr><td> </td><td class=example><pre>[<CODE>time</CODE> [<CODE>-p</CODE>]] [<CODE>!</CODE>] <VAR>command1</VAR> [<CODE>|</CODE> <VAR>command2</VAR> <small>...</small>] 887</pre></td></tr></table></P><P> 888 889The output of each command in the pipeline is connected via a pipe 890to the input of the next command. 891That is, each command reads the previous command's output. 892</P><P> 893 894The reserved word <CODE>time</CODE> causes timing statistics 895to be printed for the pipeline once it finishes. 896The statistics currently consist of elapsed (wall-clock) time and 897user and system time consumed by the command's execution. 898The <SAMP>`-p'</SAMP> option changes the output format to that specified 899by POSIX. 900The <CODE>TIMEFORMAT</CODE> variable may be set to a format string that 901specifies how the timing information should be displayed. 902See section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>, for a description of the available formats. 903The use of <CODE>time</CODE> as a reserved word permits the timing of 904shell builtins, shell functions, and pipelines. An external 905<CODE>time</CODE> command cannot time these easily. 906</P><P> 907 908If the pipeline is not executed asynchronously (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the 909shell waits for all commands in the pipeline to complete. 910</P><P> 911 912Each command in a pipeline is executed in its own subshell 913(see section <A HREF="bashref.html#SEC51">3.7.3 Command Execution Environment</A>). The exit 914status of a pipeline is the exit status of the last command in the 915pipeline, unless the <CODE>pipefail</CODE> option is enabled 916(see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 917If <CODE>pipefail</CODE> is enabled, the pipeline's return status is the 918value of the last (rightmost) command to exit with a non-zero status, 919or zero if all commands exit successfully. 920If the reserved word <SAMP>`!'</SAMP> precedes the pipeline, the 921exit status is the logical negation of the exit status as described 922above. 923The shell waits for all commands in the pipeline to terminate before 924returning a value. 925</P><P> 926 927<A NAME="Lists"></A> 928<HR SIZE="6"> 929<A NAME="SEC18"></A> 930<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 931<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> < </A>]</TD> 932<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> > </A>]</TD> 933<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> << </A>]</TD> 934<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> 935<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> 936<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 937<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 938<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 939<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 940</TR></TABLE> 941<H3> 3.2.3 Lists of Commands </H3> 942<!--docid::SEC18::--> 943<P> 944 945A <CODE>list</CODE> is a sequence of one or more pipelines separated by one 946of the operators <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`&&'</SAMP>, or <SAMP>`||'</SAMP>, 947and optionally terminated by one of <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, or a 948<CODE>newline</CODE>. 949</P><P> 950 951Of these list operators, <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP> 952have equal precedence, followed by <SAMP>`;'</SAMP> and <SAMP>`&'</SAMP>, 953which have equal precedence. 954</P><P> 955 956A sequence of one or more newlines may appear in a <CODE>list</CODE> 957to delimit commands, equivalent to a semicolon. 958</P><P> 959 960If a command is terminated by the control operator <SAMP>`&'</SAMP>, 961the shell executes the command asynchronously in a subshell. 962This is known as executing the command in the <VAR>background</VAR>. 963The shell does not wait for the command to finish, and the return 964status is 0 (true). 965When job control is not active (see section <A HREF="bashref.html#SEC87">7. Job Control</A>), 966the standard input for asynchronous commands, in the absence of any 967explicit redirections, is redirected from <CODE>/dev/null</CODE>. 968</P><P> 969 970Commands separated by a <SAMP>`;'</SAMP> are executed sequentially; the shell 971waits for each command to terminate in turn. The return status is the 972exit status of the last command executed. 973</P><P> 974 975The control operators <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP> 976denote AND lists and OR lists, respectively. 977An AND list has the form 978<TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> && <VAR>command2</VAR> 979</pre></td></tr></table></P><P> 980 981<VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR> 982returns an exit status of zero. 983</P><P> 984 985An OR list has the form 986<TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> || <VAR>command2</VAR> 987</pre></td></tr></table></P><P> 988 989<VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR> 990returns a non-zero exit status. 991</P><P> 992 993The return status of 994AND and OR lists is the exit status of the last command 995executed in the list. 996</P><P> 997 998<A NAME="Compound Commands"></A> 999<HR SIZE="6"> 1000<A NAME="SEC19"></A> 1001<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1002<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> < </A>]</TD> 1003<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> > </A>]</TD> 1004<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> 1005<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD> 1006<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> 1007<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1008<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1009<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1010<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1011</TR></TABLE> 1012<H3> 3.2.4 Compound Commands </H3> 1013<!--docid::SEC19::--> 1014<P> 1015 1016<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 1017<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> 1018<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> 1019<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> 1020</TABLE></BLOCKQUOTE> 1021<P> 1022 1023Compound commands are the shell programming constructs. 1024Each construct begins with a reserved word or control operator and is 1025terminated by a corresponding reserved word or operator. 1026Any redirections (see section <A HREF="bashref.html#SEC38">3.6 Redirections</A>) associated with a compound command 1027apply to all commands within that compound command unless explicitly overridden. 1028</P><P> 1029 1030Bash provides looping constructs, conditional commands, and mechanisms 1031to group commands and execute them as a unit. 1032</P><P> 1033 1034<A NAME="Looping Constructs"></A> 1035<HR SIZE="6"> 1036<A NAME="SEC20"></A> 1037<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1038<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> < </A>]</TD> 1039<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> > </A>]</TD> 1040<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> 1041<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD> 1042<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> 1043<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1044<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1045<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1046<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1047</TR></TABLE> 1048<H4> 3.2.4.1 Looping Constructs </H4> 1049<!--docid::SEC20::--> 1050<P> 1051 1052Bash supports the following looping constructs. 1053</P><P> 1054 1055Note that wherever a <SAMP>`;'</SAMP> appears in the description of a 1056command's syntax, it may be replaced with one or more newlines. 1057</P><P> 1058 1059<DL COMPACT> 1060<DT><CODE>until</CODE> 1061<DD><A NAME="IDX27"></A> 1062<A NAME="IDX28"></A> 1063<A NAME="IDX29"></A> 1064The syntax of the <CODE>until</CODE> command is: 1065<TABLE><tr><td> </td><td class=example><pre>until <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done 1066</pre></td></tr></table>Execute <VAR>consequent-commands</VAR> as long as 1067<VAR>test-commands</VAR> has an exit status which is not zero. 1068The return status is the exit status of the last command executed 1069in <VAR>consequent-commands</VAR>, or zero if none was executed. 1070<P> 1071 1072<DT><CODE>while</CODE> 1073<DD><A NAME="IDX30"></A> 1074The syntax of the <CODE>while</CODE> command is: 1075<TABLE><tr><td> </td><td class=example><pre>while <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done 1076</pre></td></tr></table><P> 1077 1078Execute <VAR>consequent-commands</VAR> as long as 1079<VAR>test-commands</VAR> has an exit status of zero. 1080The return status is the exit status of the last command executed 1081in <VAR>consequent-commands</VAR>, or zero if none was executed. 1082</P><P> 1083 1084<DT><CODE>for</CODE> 1085<DD><A NAME="IDX31"></A> 1086The syntax of the <CODE>for</CODE> command is: 1087<P> 1088 1089<TABLE><tr><td> </td><td class=example><pre>for <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done 1090</pre></td></tr></table>Expand <VAR>words</VAR>, and execute <VAR>commands</VAR> once for each member 1091in the resultant list, with <VAR>name</VAR> bound to the current member. 1092If <SAMP>`in <VAR>words</VAR>'</SAMP> is not present, the <CODE>for</CODE> command 1093executes the <VAR>commands</VAR> once for each positional parameter that is 1094set, as if <SAMP>`in "$@"'</SAMP> had been specified 1095(see section <A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A>). 1096The return status is the exit status of the last command that executes. 1097If there are no items in the expansion of <VAR>words</VAR>, no commands are 1098executed, and the return status is zero. 1099</P><P> 1100 1101An alternate form of the <CODE>for</CODE> command is also supported: 1102</P><P> 1103 1104<TABLE><tr><td> </td><td class=example><pre>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> )) ; do <VAR>commands</VAR> ; done 1105</pre></td></tr></table>First, the arithmetic expression <VAR>expr1</VAR> is evaluated according 1106to the rules described below (see section <A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A>). 1107The arithmetic expression <VAR>expr2</VAR> is then evaluated repeatedly 1108until it evaluates to zero. 1109Each time <VAR>expr2</VAR> evaluates to a non-zero value, <VAR>commands</VAR> are 1110executed and the arithmetic expression <VAR>expr3</VAR> is evaluated. 1111If any expression is omitted, it behaves as if it evaluates to 1. 1112The return value is the exit status of the last command in <VAR>list</VAR> 1113that is executed, or false if any of the expressions is invalid. 1114</P><P> 1115 1116</DL> 1117<P> 1118 1119The <CODE>break</CODE> and <CODE>continue</CODE> builtins (see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>) 1120may be used to control loop execution. 1121</P><P> 1122 1123<A NAME="Conditional Constructs"></A> 1124<HR SIZE="6"> 1125<A NAME="SEC21"></A> 1126<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1127<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> < </A>]</TD> 1128<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> > </A>]</TD> 1129<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> << </A>]</TD> 1130<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD> 1131<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> 1132<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1133<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1134<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1135<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1136</TR></TABLE> 1137<H4> 3.2.4.2 Conditional Constructs </H4> 1138<!--docid::SEC21::--> 1139<P> 1140 1141<DL COMPACT> 1142<DT><CODE>if</CODE> 1143<DD><A NAME="IDX32"></A> 1144<A NAME="IDX33"></A> 1145<A NAME="IDX34"></A> 1146<A NAME="IDX35"></A> 1147<A NAME="IDX36"></A> 1148The syntax of the <CODE>if</CODE> command is: 1149<P> 1150 1151<TABLE><tr><td> </td><td class=example><pre>if <VAR>test-commands</VAR>; then 1152 <VAR>consequent-commands</VAR>; 1153[elif <VAR>more-test-commands</VAR>; then 1154 <VAR>more-consequents</VAR>;] 1155[else <VAR>alternate-consequents</VAR>;] 1156fi 1157</pre></td></tr></table></P><P> 1158 1159The <VAR>test-commands</VAR> list is executed, and if its return status is zero, 1160the <VAR>consequent-commands</VAR> list is executed. 1161If <VAR>test-commands</VAR> returns a non-zero status, each <CODE>elif</CODE> list 1162is executed in turn, and if its exit status is zero, 1163the corresponding <VAR>more-consequents</VAR> is executed and the 1164command completes. 1165If <SAMP>`else <VAR>alternate-consequents</VAR>'</SAMP> is present, and 1166the final command in the final <CODE>if</CODE> or <CODE>elif</CODE> clause 1167has a non-zero exit status, then <VAR>alternate-consequents</VAR> is executed. 1168The return status is the exit status of the last command executed, or 1169zero if no condition tested true. 1170</P><P> 1171 1172<DT><CODE>case</CODE> 1173<DD><A NAME="IDX37"></A> 1174<A NAME="IDX38"></A> 1175<A NAME="IDX39"></A> 1176The syntax of the <CODE>case</CODE> command is: 1177<P> 1178 1179<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> 1180</pre></td></tr></table></P><P> 1181 1182<CODE>case</CODE> will selectively execute the <VAR>command-list</VAR> corresponding to 1183the first <VAR>pattern</VAR> that matches <VAR>word</VAR>. 1184If the shell option <CODE>nocasematch</CODE> 1185(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>) 1186is enabled, the match is performed without regard to the case 1187of alphabetic characters. 1188The <SAMP>`|'</SAMP> is used to separate multiple patterns, and the <SAMP>`)'</SAMP> 1189operator terminates a pattern list. 1190A list of patterns and an associated command-list is known 1191as a <VAR>clause</VAR>. Each clause must be terminated with <SAMP>`;;'</SAMP>. 1192The <VAR>word</VAR> undergoes tilde expansion, parameter expansion, command 1193substitution, arithmetic expansion, and quote removal before matching is 1194attempted. Each <VAR>pattern</VAR> undergoes tilde expansion, parameter 1195expansion, command substitution, and arithmetic expansion. 1196</P><P> 1197 1198There may be an arbitrary number of <CODE>case</CODE> clauses, each terminated 1199by a <SAMP>`;;'</SAMP>. The first pattern that matches determines the 1200command-list that is executed. 1201</P><P> 1202 1203Here is an example using <CODE>case</CODE> in a script that could be used to 1204describe one interesting feature of an animal: 1205</P><P> 1206 1207<TABLE><tr><td> </td><td class=example><pre>echo -n "Enter the name of an animal: " 1208read ANIMAL 1209echo -n "The $ANIMAL has " 1210case $ANIMAL in 1211 horse | dog | cat) echo -n "four";; 1212 man | kangaroo ) echo -n "two";; 1213 *) echo -n "an unknown number of";; 1214esac 1215echo " legs." 1216</pre></td></tr></table></P><P> 1217 1218The return status is zero if no <VAR>pattern</VAR> is matched. Otherwise, the 1219return status is the exit status of the <VAR>command-list</VAR> executed. 1220</P><P> 1221 1222<DT><CODE>select</CODE> 1223<DD><A NAME="IDX40"></A> 1224<P> 1225 1226The <CODE>select</CODE> construct allows the easy generation of menus. 1227It has almost the same syntax as the <CODE>for</CODE> command: 1228</P><P> 1229 1230<TABLE><tr><td> </td><td class=example><pre>select <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done 1231</pre></td></tr></table></P><P> 1232 1233The list of words following <CODE>in</CODE> is expanded, generating a list 1234of items. The set of expanded words is printed on the standard 1235error output stream, each preceded by a number. If the 1236<SAMP>`in <VAR>words</VAR>'</SAMP> is omitted, the positional parameters are printed, 1237as if <SAMP>`in "$@"'</SAMP> had been specifed. 1238The <CODE>PS3</CODE> prompt is then displayed and a line is read from the 1239standard input. 1240If the line consists of a number corresponding to one of the displayed 1241words, then the value of <VAR>name</VAR> is set to that word. 1242If the line is empty, the words and prompt are displayed again. 1243If <CODE>EOF</CODE> is read, the <CODE>select</CODE> command completes. 1244Any other value read causes <VAR>name</VAR> to be set to null. 1245The line read is saved in the variable <CODE>REPLY</CODE>. 1246</P><P> 1247 1248The <VAR>commands</VAR> are executed after each selection until a 1249<CODE>break</CODE> command is executed, at which 1250point the <CODE>select</CODE> command completes. 1251</P><P> 1252 1253Here is an example that allows the user to pick a filename from the 1254current directory, and displays the name and index of the file 1255selected. 1256</P><P> 1257 1258<TABLE><tr><td> </td><td class=example><pre>select fname in *; 1259do 1260 echo you picked $fname \($REPLY\) 1261 break; 1262done 1263</pre></td></tr></table></P><P> 1264 1265<DT><CODE>((<small>...</small>))</CODE> 1266<DD><TABLE><tr><td> </td><td class=example><pre>(( <VAR>expression</VAR> )) 1267</pre></td></tr></table><P> 1268 1269The arithmetic <VAR>expression</VAR> is evaluated according to the rules 1270described below (see section <A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A>). 1271If the value of the expression is non-zero, the return status is 0; 1272otherwise the return status is 1. This is exactly equivalent to 1273<TABLE><tr><td> </td><td class=example><pre>let "<VAR>expression</VAR>" 1274</pre></td></tr></table>See section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>, for a full description of the <CODE>let</CODE> builtin. 1275</P><P> 1276 1277<DT><CODE>[[<small>...</small>]]</CODE> 1278<DD><A NAME="IDX41"></A> 1279<A NAME="IDX42"></A> 1280<TABLE><tr><td> </td><td class=example><pre>[[ <VAR>expression</VAR> ]] 1281</pre></td></tr></table><P> 1282 1283Return a status of 0 or 1 depending on the evaluation of 1284the conditional expression <VAR>expression</VAR>. 1285Expressions are composed of the primaries described below in 1286<A HREF="bashref.html#SEC78">6.4 Bash Conditional Expressions</A>. 1287Word splitting and filename expansion are not performed on the words 1288between the <SAMP>`[['</SAMP> and <SAMP>`]]'</SAMP>; tilde expansion, parameter and 1289variable expansion, arithmetic expansion, command substitution, process 1290substitution, and quote removal are performed. 1291Conditional operators such as <SAMP>`-f'</SAMP> must be unquoted to be recognized 1292as primaries. 1293</P><P> 1294 1295When the <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP> operators are used, the string to the 1296right of the operator is considered a pattern and matched according 1297to the rules described below in <A HREF="bashref.html#SEC36">3.5.8.1 Pattern Matching</A>. 1298If the shell option <CODE>nocasematch</CODE> 1299(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>) 1300is enabled, the match is performed without regard to the case 1301of alphabetic characters. 1302The return value is 0 if the string matches or does not match 1303the pattern, respectively, and 1 otherwise. 1304Any part of the pattern may be quoted to force it to be matched as a 1305string. 1306</P><P> 1307 1308An additional binary operator, <SAMP>`=~'</SAMP>, is available, with the same 1309precedence as <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP>. 1310When it is used, the string to the right of the operator is considered 1311an extended regular expression and matched accordingly (as in <I>regex</I>3)). 1312The return value is 0 if the string matches 1313the pattern, and 1 otherwise. 1314If the regular expression is syntactically incorrect, the conditional 1315expression's return value is 2. 1316If the shell option <CODE>nocasematch</CODE> 1317(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>) 1318is enabled, the match is performed without regard to the case 1319of alphabetic characters. 1320Substrings matched by parenthesized subexpressions within the regular 1321expression are saved in the array variable <CODE>BASH_REMATCH</CODE>. 1322The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string 1323matching the entire regular expression. 1324The element of <CODE>BASH_REMATCH</CODE> with index <VAR>n</VAR> is the portion of the 1325string matching the <VAR>n</VAR>th parenthesized subexpression. 1326</P><P> 1327 1328Expressions may be combined using the following operators, listed 1329in decreasing order of precedence: 1330</P><P> 1331 1332<DL COMPACT> 1333<DT><CODE>( <VAR>expression</VAR> )</CODE> 1334<DD>Returns the value of <VAR>expression</VAR>. 1335This may be used to override the normal precedence of operators. 1336<P> 1337 1338<DT><CODE>! <VAR>expression</VAR></CODE> 1339<DD>True if <VAR>expression</VAR> is false. 1340<P> 1341 1342<DT><CODE><VAR>expression1</VAR> && <VAR>expression2</VAR></CODE> 1343<DD>True if both <VAR>expression1</VAR> and <VAR>expression2</VAR> are true. 1344<P> 1345 1346<DT><CODE><VAR>expression1</VAR> || <VAR>expression2</VAR></CODE> 1347<DD>True if either <VAR>expression1</VAR> or <VAR>expression2</VAR> is true. 1348</DL> 1349The <CODE>&&</CODE> and <CODE>||</CODE> operators do not evaluate <VAR>expression2</VAR> if the 1350value of <VAR>expression1</VAR> is sufficient to determine the return 1351value of the entire conditional expression. 1352<P> 1353 1354</DL> 1355<P> 1356 1357<A NAME="Command Grouping"></A> 1358<HR SIZE="6"> 1359<A NAME="SEC22"></A> 1360<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1361<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> < </A>]</TD> 1362<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> > </A>]</TD> 1363<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD> 1364<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD> 1365<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD> 1366<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1367<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1368<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1369<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1370</TR></TABLE> 1371<H4> 3.2.4.3 Grouping Commands </H4> 1372<!--docid::SEC22::--> 1373<P> 1374 1375Bash provides two ways to group a list of commands to be executed 1376as a unit. When commands are grouped, redirections may be applied 1377to the entire command list. For example, the output of all the 1378commands in the list may be redirected to a single stream. 1379</P><P> 1380 1381<DL COMPACT> 1382<DT><CODE>()</CODE> 1383<DD><TABLE><tr><td> </td><td class=example><pre>( <VAR>list</VAR> ) 1384</pre></td></tr></table><P> 1385 1386Placing a list of commands between parentheses causes a subshell 1387environment to be created (see section <A HREF="bashref.html#SEC51">3.7.3 Command Execution Environment</A>), and each 1388of the commands in <VAR>list</VAR> to be executed in that subshell. Since the 1389<VAR>list</VAR> is executed in a subshell, variable assignments do not remain in 1390effect after the subshell completes. 1391</P><P> 1392 1393<DT><CODE>{}</CODE> 1394<DD><A NAME="IDX43"></A> 1395<A NAME="IDX44"></A> 1396<TABLE><tr><td> </td><td class=example><pre>{ <VAR>list</VAR>; } 1397</pre></td></tr></table><P> 1398 1399Placing a list of commands between curly braces causes the list to 1400be executed in the current shell context. No subshell is created. 1401The semicolon (or newline) following <VAR>list</VAR> is required. 1402</DL> 1403<P> 1404 1405In addition to the creation of a subshell, there is a subtle difference 1406between these two constructs due to historical reasons. The braces 1407are <CODE>reserved words</CODE>, so they must be separated from the <VAR>list</VAR> 1408by <CODE>blank</CODE>s. The parentheses are <CODE>operators</CODE>, and are 1409recognized as separate tokens by the shell even if they are not separated 1410from the <VAR>list</VAR> by whitespace. 1411</P><P> 1412 1413The exit status of both of these constructs is the exit status of 1414<VAR>list</VAR>. 1415</P><P> 1416 1417<A NAME="Shell Functions"></A> 1418<HR SIZE="6"> 1419<A NAME="SEC23"></A> 1420<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1421<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> < </A>]</TD> 1422<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> > </A>]</TD> 1423<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD> 1424<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> 1425<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> >> </A>]</TD> 1426<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1427<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1428<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1429<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1430</TR></TABLE> 1431<H2> 3.3 Shell Functions </H2> 1432<!--docid::SEC23::--> 1433<P> 1434 1435Shell functions are a way to group commands for later execution 1436using a single name for the group. They are executed just like 1437a "regular" command. 1438When the name of a shell function is used as a simple command name, 1439the list of commands associated with that function name is executed. 1440Shell functions are executed in the current 1441shell context; no new process is created to interpret them. 1442</P><P> 1443 1444Functions are declared using this syntax: 1445<A NAME="IDX45"></A> 1446<TABLE><tr><td> </td><td class=example><pre>[ <CODE>function</CODE> ] <VAR>name</VAR> () <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ] 1447</pre></td></tr></table></P><P> 1448 1449This defines a shell function named <VAR>name</VAR>. The reserved 1450word <CODE>function</CODE> is optional. 1451If the <CODE>function</CODE> reserved 1452word is supplied, the parentheses are optional. 1453The <VAR>body</VAR> of the function is the compound command 1454<VAR>compound-command</VAR> (see section <A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>). 1455That command is usually a <VAR>list</VAR> enclosed between { and }, but 1456may be any compound command listed above. 1457<VAR>compound-command</VAR> is executed whenever <VAR>name</VAR> is specified as the 1458name of a command. 1459Any redirections (see section <A HREF="bashref.html#SEC38">3.6 Redirections</A>) associated with the shell function 1460are performed when the function is executed. 1461</P><P> 1462 1463The exit status of a function definition is zero unless a syntax error 1464occurs or a readonly function with the same name already exists. 1465When executed, the exit status of a function is the exit status of the 1466last command executed in the body. 1467</P><P> 1468 1469Note that for historical reasons, in the most common usage the curly braces 1470that surround the body of the function must be separated from the body by 1471<CODE>blank</CODE>s or newlines. 1472This is because the braces are reserved words and are only recognized 1473as such when they are separated by whitespace. 1474Also, when using the braces, the <VAR>list</VAR> must be terminated by a semicolon, 1475a <SAMP>`&'</SAMP>, or a newline. 1476</P><P> 1477 1478When a function is executed, the arguments to the 1479function become the positional parameters 1480during its execution (see section <A HREF="bashref.html#SEC25">3.4.1 Positional Parameters</A>). 1481The special parameter <SAMP>`#'</SAMP> that expands to the number of 1482positional parameters is updated to reflect the change. 1483Special parameter <CODE>0</CODE> is unchanged. 1484The first element of the <CODE>FUNCNAME</CODE> variable is set to the 1485name of the function while the function is executing. 1486All other aspects of the shell execution 1487environment are identical between a function and its caller 1488with the exception that the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps 1489are not inherited unless the function has been given the 1490<CODE>trace</CODE> attribute using the <CODE>declare</CODE> builtin or 1491the <CODE>-o functrace</CODE> option has been enabled with 1492the <CODE>set</CODE> builtin, 1493(in which case all functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps). 1494See section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>, for the description of the 1495<CODE>trap</CODE> builtin. 1496</P><P> 1497 1498If the builtin command <CODE>return</CODE> 1499is executed in a function, the function completes and 1500execution resumes with the next command after the function 1501call. 1502Any command associated with the <CODE>RETURN</CODE> trap is executed 1503before execution resumes. 1504When a function completes, the values of the 1505positional parameters and the special parameter <SAMP>`#'</SAMP> 1506are restored to the values they had prior to the function's 1507execution. If a numeric argument is given to <CODE>return</CODE>, 1508that is the function's return status; otherwise the function's 1509return status is the exit status of the last command executed 1510before the <CODE>return</CODE>. 1511</P><P> 1512 1513Variables local to the function may be declared with the 1514<CODE>local</CODE> builtin. These variables are visible only to 1515the function and the commands it invokes. 1516</P><P> 1517 1518Function names and definitions may be listed with the 1519<SAMP>`-f'</SAMP> option to the <CODE>declare</CODE> or <CODE>typeset</CODE> 1520builtin commands (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 1521The <SAMP>`-F'</SAMP> option to <CODE>declare</CODE> or <CODE>typeset</CODE> 1522will list the function names only 1523(and optionally the source file and line number, if the <CODE>extdebug</CODE> 1524shell option is enabled). 1525Functions may be exported so that subshells 1526automatically have them defined with the 1527<SAMP>`-f'</SAMP> option to the <CODE>export</CODE> builtin 1528(see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>). 1529Note that shell functions and variables with the same name may result 1530in multiple identically-named entries in the environment passed to the 1531shell's children. 1532Care should be taken in cases where this may cause a problem. 1533</P><P> 1534 1535Functions may be recursive. No limit is placed on the number of 1536recursive calls. 1537</P><P> 1538 1539<A NAME="Shell Parameters"></A> 1540<HR SIZE="6"> 1541<A NAME="SEC24"></A> 1542<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1543<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> < </A>]</TD> 1544<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> > </A>]</TD> 1545<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> << </A>]</TD> 1546<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> 1547<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> >> </A>]</TD> 1548<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1549<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1550<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1551<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1552</TR></TABLE> 1553<H2> 3.4 Shell Parameters </H2> 1554<!--docid::SEC24::--> 1555<P> 1556 1557<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 1558<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC25">3.4.1 Positional Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The shell's command-line arguments.</TD></TR> 1559<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Parameters denoted by special characters.</TD></TR> 1560</TABLE></BLOCKQUOTE> 1561<P> 1562 1563A <VAR>parameter</VAR> is an entity that stores values. 1564It can be a <CODE>name</CODE>, a number, or one of the special characters 1565listed below. 1566A <VAR>variable</VAR> is a parameter denoted by a <CODE>name</CODE>. 1567A variable has a <VAR>value</VAR> and zero or more <VAR>attributes</VAR>. 1568Attributes are assigned using the <CODE>declare</CODE> builtin command 1569(see the description of the <CODE>declare</CODE> builtin in <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 1570</P><P> 1571 1572A parameter is set if it has been assigned a value. The null string is 1573a valid value. Once a variable is set, it may be unset only by using 1574the <CODE>unset</CODE> builtin command. 1575</P><P> 1576 1577A variable may be assigned to by a statement of the form 1578<TABLE><tr><td> </td><td class=example><pre><VAR>name</VAR>=[<VAR>value</VAR>] 1579</pre></td></tr></table>If <VAR>value</VAR> 1580is not given, the variable is assigned the null string. All 1581<VAR>value</VAR>s undergo tilde expansion, parameter and variable expansion, 1582command substitution, arithmetic expansion, and quote 1583removal (detailed below). If the variable has its <CODE>integer</CODE> 1584attribute set, then <VAR>value</VAR> 1585is evaluated as an arithmetic expression even if the <CODE>$((<small>...</small>))</CODE> 1586expansion is not used (see section <A HREF="bashref.html#SEC32">3.5.5 Arithmetic Expansion</A>). 1587Word splitting is not performed, with the exception 1588of <CODE>"$@"</CODE> as explained below. 1589Filename expansion is not performed. 1590Assignment statements may also appear as arguments to the 1591<CODE>alias</CODE>, 1592<CODE>declare</CODE>, <CODE>typeset</CODE>, <CODE>export</CODE>, <CODE>readonly</CODE>, 1593and <CODE>local</CODE> builtin commands. 1594</P><P> 1595 1596In the context where an assignment statement is assigning a value 1597to a shell variable or array index (see section <A HREF="bashref.html#SEC81">6.7 Arrays</A>), the <SAMP>`+='</SAMP> 1598operator can be used to 1599append to or add to the variable's previous value. 1600When <SAMP>`+='</SAMP> is applied to a variable for which the integer attribute 1601has been set, <VAR>value</VAR> is evaluated as an arithmetic expression and 1602added to the variable's current value, which is also evaluated. 1603When <SAMP>`+='</SAMP> is applied to an array variable using compound assignment 1604(see section <A HREF="bashref.html#SEC81">6.7 Arrays</A>), the 1605variable's value is not unset (as it is when using <SAMP>`='</SAMP>), and new 1606values are appended to the array beginning at one greater than the array's 1607maximum index. 1608When applied to a string-valued variable, <VAR>value</VAR> is expanded and 1609appended to the variable's value. 1610</P><P> 1611 1612<A NAME="Positional Parameters"></A> 1613<HR SIZE="6"> 1614<A NAME="SEC25"></A> 1615<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1616<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> < </A>]</TD> 1617<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> > </A>]</TD> 1618<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> << </A>]</TD> 1619<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> Up </A>]</TD> 1620<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> >> </A>]</TD> 1621<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1622<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1623<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1624<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1625</TR></TABLE> 1626<H3> 3.4.1 Positional Parameters </H3> 1627<!--docid::SEC25::--> 1628<P> 1629 1630A <VAR>positional parameter</VAR> is a parameter denoted by one or more 1631digits, other than the single digit <CODE>0</CODE>. Positional parameters are 1632assigned from the shell's arguments when it is invoked, 1633and may be reassigned using the <CODE>set</CODE> builtin command. 1634Positional parameter <CODE>N</CODE> may be referenced as <CODE>${N}</CODE>, or 1635as <CODE>$N</CODE> when <CODE>N</CODE> consists of a single digit. 1636Positional parameters may not be assigned to with assignment statements. 1637The <CODE>set</CODE> and <CODE>shift</CODE> builtins are used to set and 1638unset them (see section <A HREF="bashref.html#SEC56">4. Shell Builtin Commands</A>). 1639The positional parameters are 1640temporarily replaced when a shell function is executed 1641(see section <A HREF="bashref.html#SEC23">3.3 Shell Functions</A>). 1642</P><P> 1643 1644When a positional parameter consisting of more than a single 1645digit is expanded, it must be enclosed in braces. 1646</P><P> 1647 1648<A NAME="Special Parameters"></A> 1649<HR SIZE="6"> 1650<A NAME="SEC26"></A> 1651<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1652<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> < </A>]</TD> 1653<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> > </A>]</TD> 1654<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> << </A>]</TD> 1655<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> Up </A>]</TD> 1656<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> >> </A>]</TD> 1657<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1658<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1659<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1660<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1661</TR></TABLE> 1662<H3> 3.4.2 Special Parameters </H3> 1663<!--docid::SEC26::--> 1664<P> 1665 1666The shell treats several parameters specially. These parameters may 1667only be referenced; assignment to them is not allowed. 1668</P><P> 1669 1670<DL COMPACT> 1671 1672<A NAME="IDX46"></A> 1673<DT><CODE>*</CODE> 1674<DD><A NAME="IDX47"></A> 1675Expands to the positional parameters, starting from one. When the 1676expansion occurs within double quotes, it expands to a single word 1677with the value of each parameter separated by the first character 1678of the <CODE>IFS</CODE> 1679special variable. That is, <CODE>"$*"</CODE> is equivalent 1680to <CODE>"$1<VAR>c</VAR>$2<VAR>c</VAR><small>...</small>"</CODE>, where <VAR>c</VAR> 1681is the first character of the value of the <CODE>IFS</CODE> 1682variable. 1683If <CODE>IFS</CODE> is unset, the parameters are separated by spaces. 1684If <CODE>IFS</CODE> is null, the parameters are joined without intervening 1685separators. 1686<P> 1687 1688<A NAME="IDX48"></A> 1689<DT><CODE>@</CODE> 1690<DD><A NAME="IDX49"></A> 1691Expands to the positional parameters, starting from one. When the 1692expansion occurs within double quotes, each parameter expands to a 1693separate word. That is, <CODE>"$@"</CODE> is equivalent to 1694<CODE>"$1" "$2" <small>...</small></CODE>. 1695If the double-quoted expansion occurs within a word, the expansion of 1696the first parameter is joined with the beginning part of the original 1697word, and the expansion of the last parameter is joined with the last 1698part of the original word. 1699When there are no positional parameters, <CODE>"$@"</CODE> and 1700<CODE>$@</CODE> 1701expand to nothing (i.e., they are removed). 1702<P> 1703 1704<A NAME="IDX50"></A> 1705<DT><CODE>#</CODE> 1706<DD><A NAME="IDX51"></A> 1707Expands to the number of positional parameters in decimal. 1708<P> 1709 1710<A NAME="IDX52"></A> 1711<DT><CODE>?</CODE> 1712<DD><A NAME="IDX53"></A> 1713Expands to the exit status of the most recently executed foreground 1714pipeline. 1715<P> 1716 1717<A NAME="IDX54"></A> 1718<DT><CODE>-</CODE> 1719<DD><A NAME="IDX55"></A> 1720(A hyphen.) Expands to the current option flags as specified upon 1721invocation, by the <CODE>set</CODE> 1722builtin command, or those set by the shell itself 1723(such as the <SAMP>`-i'</SAMP> option). 1724<P> 1725 1726<A NAME="IDX56"></A> 1727<DT><CODE>$</CODE> 1728<DD><A NAME="IDX57"></A> 1729Expands to the process ID of the shell. In a <CODE>()</CODE> subshell, it 1730expands to the process ID of the invoking shell, not the subshell. 1731<P> 1732 1733<A NAME="IDX58"></A> 1734<DT><CODE>!</CODE> 1735<DD><A NAME="IDX59"></A> 1736Expands to the process ID of the most recently executed background 1737(asynchronous) command. 1738<P> 1739 1740<A NAME="IDX60"></A> 1741<DT><CODE>0</CODE> 1742<DD><A NAME="IDX61"></A> 1743Expands to the name of the shell or shell script. This is set at 1744shell initialization. If Bash is invoked with a file of commands 1745(see section <A HREF="bashref.html#SEC55">3.8 Shell Scripts</A>), <CODE>$0</CODE> is set to the name of that file. 1746If Bash is started with the <SAMP>`-c'</SAMP> option (see section <A HREF="bashref.html#SEC65">6.1 Invoking Bash</A>), 1747then <CODE>$0</CODE> is set to the first argument after the string to be 1748executed, if one is present. Otherwise, it is set 1749to the filename used to invoke Bash, as given by argument zero. 1750<P> 1751 1752<A NAME="IDX62"></A> 1753<DT><CODE>_</CODE> 1754<DD><A NAME="IDX63"></A> 1755(An underscore.) 1756At shell startup, set to the absolute pathname used to invoke the 1757shell or shell script being executed as passed in the environment 1758or argument list. 1759Subsequently, expands to the last argument to the previous command, 1760after expansion. 1761Also set to the full pathname used to invoke each command executed 1762and placed in the environment exported to that command. 1763When checking mail, this parameter holds the name of the mail file. 1764</DL> 1765<P> 1766 1767<A NAME="Shell Expansions"></A> 1768<HR SIZE="6"> 1769<A NAME="SEC27"></A> 1770<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1771<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> < </A>]</TD> 1772<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> > </A>]</TD> 1773<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> << </A>]</TD> 1774<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> 1775<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> 1776<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1777<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1778<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1779<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1780</TR></TABLE> 1781<H2> 3.5 Shell Expansions </H2> 1782<!--docid::SEC27::--> 1783<P> 1784 1785Expansion is performed on the command line after it has been split into 1786<CODE>token</CODE>s. There are seven kinds of expansion performed: 1787<UL> 1788<LI>brace expansion 1789<LI>tilde expansion 1790<LI>parameter and variable expansion 1791<LI>command substitution 1792<LI>arithmetic expansion 1793<LI>word splitting 1794<LI>filename expansion 1795</UL> 1796<P> 1797 1798<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 1799<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC28">3.5.1 Brace Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of expressions within braces.</TD></TR> 1800<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC29">3.5.2 Tilde Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of the ~ character.</TD></TR> 1801<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands variables to their values.</TD></TR> 1802<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC31">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> 1803<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC32">3.5.5 Arithmetic Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to use arithmetic in shell expansions.</TD></TR> 1804<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC33">3.5.6 Process Substitution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A way to write and read to and from a 1805 command.</TD></TR> 1806<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC34">3.5.7 Word Splitting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the results of expansion are split into separate 1807 arguments.</TD></TR> 1808<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A shorthand for specifying filenames matching patterns.</TD></TR> 1809<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC37">3.5.9 Quote Removal</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How and when quote characters are removed from 1810 words.</TD></TR> 1811</TABLE></BLOCKQUOTE> 1812<P> 1813 1814The order of expansions is: brace expansion, tilde expansion, 1815parameter, variable, and arithmetic expansion and 1816command substitution 1817(done in a left-to-right fashion), word splitting, and filename 1818expansion. 1819</P><P> 1820 1821On systems that can support it, there is an additional expansion 1822available: <VAR>process substitution</VAR>. This is performed at the 1823same time as parameter, variable, and arithmetic expansion and 1824command substitution. 1825</P><P> 1826 1827Only brace expansion, word splitting, and filename expansion 1828can change the number of words of the expansion; other expansions 1829expand a single word to a single word. 1830The only exceptions to this are the expansions of 1831<CODE>"$@"</CODE> (see section <A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A>) and <CODE>"${<VAR>name</VAR>[@]}"</CODE> 1832(see section <A HREF="bashref.html#SEC81">6.7 Arrays</A>). 1833</P><P> 1834 1835After all expansions, <CODE>quote removal</CODE> (see section <A HREF="bashref.html#SEC37">3.5.9 Quote Removal</A>) 1836is performed. 1837</P><P> 1838 1839<A NAME="Brace Expansion"></A> 1840<HR SIZE="6"> 1841<A NAME="SEC28"></A> 1842<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1843<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> < </A>]</TD> 1844<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> > </A>]</TD> 1845<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> << </A>]</TD> 1846<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> Up </A>]</TD> 1847<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> 1848<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1849<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1850<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1851<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1852</TR></TABLE> 1853<H3> 3.5.1 Brace Expansion </H3> 1854<!--docid::SEC28::--> 1855<P> 1856 1857Brace expansion is a mechanism by which arbitrary strings may be generated. 1858This mechanism is similar to 1859<VAR>filename expansion</VAR> (see section <A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A>), 1860but the file names generated need not exist. 1861Patterns to be brace expanded take the form of an optional <VAR>preamble</VAR>, 1862followed by either a series of comma-separated strings or a sequnce expression 1863between a pair of braces, 1864followed by an optional <VAR>postscript</VAR>. 1865The preamble is prefixed to each string contained within the braces, and 1866the postscript is then appended to each resulting string, expanding left 1867to right. 1868</P><P> 1869 1870Brace expansions may be nested. 1871The results of each expanded string are not sorted; left to right order 1872is preserved. 1873For example, 1874<TABLE><tr><td> </td><td class=example><pre>bash$ echo a{d,c,b}e 1875ade ace abe 1876</pre></td></tr></table></P><P> 1877 1878A sequence expression takes the form <CODE>{<VAR>x</VAR>..<VAR>y</VAR>}</CODE>, 1879where <VAR>x</VAR> and <VAR>y</VAR> are either integers or single characters. 1880When integers are supplied, the expression expands to each number between 1881<VAR>x</VAR> and <VAR>y</VAR>, inclusive. 1882When characters are supplied, the expression expands to each character 1883lexicographically between <VAR>x</VAR> and <VAR>y</VAR>, inclusive. Note that 1884both <VAR>x</VAR> and <VAR>y</VAR> must be of the same type. 1885</P><P> 1886 1887Brace expansion is performed before any other expansions, 1888and any characters special to other expansions are preserved 1889in the result. It is strictly textual. Bash 1890does not apply any syntactic interpretation to the context of the 1891expansion or the text between the braces. 1892To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP> 1893is not considered eligible for brace expansion. 1894</P><P> 1895 1896A correctly-formed brace expansion must contain unquoted opening 1897and closing braces, and at least one unquoted comma or a valid 1898sequence expression. 1899Any incorrectly formed brace expansion is left unchanged. 1900</P><P> 1901 1902A { or <SAMP>`,'</SAMP> may be quoted with a backslash to prevent its 1903being considered part of a brace expression. 1904To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP> 1905is not considered eligible for brace expansion. 1906</P><P> 1907 1908This construct is typically used as shorthand when the common 1909prefix of the strings to be generated is longer than in the 1910above example: 1911<TABLE><tr><td> </td><td class=example><pre>mkdir /usr/local/src/bash/{old,new,dist,bugs} 1912</pre></td></tr></table>or 1913<TABLE><tr><td> </td><td class=example><pre>chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} 1914</pre></td></tr></table></P><P> 1915 1916<A NAME="Tilde Expansion"></A> 1917<HR SIZE="6"> 1918<A NAME="SEC29"></A> 1919<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 1920<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> < </A>]</TD> 1921<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> > </A>]</TD> 1922<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> << </A>]</TD> 1923<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> Up </A>]</TD> 1924<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> 1925<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 1926<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 1927<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 1928<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 1929</TR></TABLE> 1930<H3> 3.5.2 Tilde Expansion </H3> 1931<!--docid::SEC29::--> 1932<P> 1933 1934If a word begins with an unquoted tilde character (<SAMP>`~'</SAMP>), all of the 1935characters up to the first unquoted slash (or all characters, 1936if there is no unquoted slash) are considered a <VAR>tilde-prefix</VAR>. 1937If none of the characters in the tilde-prefix are quoted, the 1938characters in the tilde-prefix following the tilde are treated as a 1939possible <VAR>login name</VAR>. 1940If this login name is the null string, the tilde is replaced with the 1941value of the <CODE>HOME</CODE> shell variable. 1942If <CODE>HOME</CODE> is unset, the home directory of the user executing the 1943shell is substituted instead. 1944Otherwise, the tilde-prefix is replaced with the home directory 1945associated with the specified login name. 1946</P><P> 1947 1948If the tilde-prefix is <SAMP>`~+'</SAMP>, the value of 1949the shell variable <CODE>PWD</CODE> replaces the tilde-prefix. 1950If the tilde-prefix is <SAMP>`~-'</SAMP>, the value of the shell variable 1951<CODE>OLDPWD</CODE>, if it is set, is substituted. 1952</P><P> 1953 1954If the characters following the tilde in the tilde-prefix consist of a 1955number <VAR>N</VAR>, optionally prefixed by a <SAMP>`+'</SAMP> or a <SAMP>`-'</SAMP>, 1956the tilde-prefix is replaced with the 1957corresponding element from the directory stack, as it would be displayed 1958by the <CODE>dirs</CODE> builtin invoked with the characters following tilde 1959in the tilde-prefix as an argument (see section <A HREF="bashref.html#SEC82">6.8 The Directory Stack</A>). 1960If the tilde-prefix, sans the tilde, consists of a number without a 1961leading <SAMP>`+'</SAMP> or <SAMP>`-'</SAMP>, <SAMP>`+'</SAMP> is assumed. 1962</P><P> 1963 1964If the login name is invalid, or the tilde expansion fails, the word is 1965left unchanged. 1966</P><P> 1967 1968Each variable assignment is checked for unquoted tilde-prefixes immediately 1969following a <SAMP>`:'</SAMP> or the first <SAMP>`='</SAMP>. 1970In these cases, tilde expansion is also performed. 1971Consequently, one may use file names with tildes in assignments to 1972<CODE>PATH</CODE>, <CODE>MAILPATH</CODE>, and <CODE>CDPATH</CODE>, 1973and the shell assigns the expanded value. 1974</P><P> 1975 1976The following table shows how Bash treats unquoted tilde-prefixes: 1977</P><P> 1978 1979<DL COMPACT> 1980<DT><CODE>~</CODE> 1981<DD>The value of <CODE>$HOME</CODE> 1982<DT><CODE>~/foo</CODE> 1983<DD><TT>`$HOME/foo'</TT> 1984<P> 1985 1986<DT><CODE>~fred/foo</CODE> 1987<DD>The subdirectory <CODE>foo</CODE> of the home directory of the user 1988<CODE>fred</CODE> 1989<P> 1990 1991<DT><CODE>~+/foo</CODE> 1992<DD><TT>`$PWD/foo'</TT> 1993<P> 1994 1995<DT><CODE>~-/foo</CODE> 1996<DD><TT>`${OLDPWD-'~-'}/foo'</TT> 1997<P> 1998 1999<DT><CODE>~<VAR>N</VAR></CODE> 2000<DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP> 2001<P> 2002 2003<DT><CODE>~+<VAR>N</VAR></CODE> 2004<DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP> 2005<P> 2006 2007<DT><CODE>~-<VAR>N</VAR></CODE> 2008<DD>The string that would be displayed by <SAMP>`dirs -<VAR>N</VAR>'</SAMP> 2009<P> 2010 2011</DL> 2012<P> 2013 2014<A NAME="Shell Parameter Expansion"></A> 2015<HR SIZE="6"> 2016<A NAME="SEC30"></A> 2017<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2018<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> < </A>]</TD> 2019<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> > </A>]</TD> 2020<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> << </A>]</TD> 2021<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> Up </A>]</TD> 2022<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> 2023<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2024<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2025<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2026<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2027</TR></TABLE> 2028<H3> 3.5.3 Shell Parameter Expansion </H3> 2029<!--docid::SEC30::--> 2030<P> 2031 2032The <SAMP>`$'</SAMP> character introduces parameter expansion, 2033command substitution, or arithmetic expansion. The parameter name 2034or symbol to be expanded may be enclosed in braces, which 2035are optional but serve to protect the variable to be expanded from 2036characters immediately following it which could be 2037interpreted as part of the name. 2038</P><P> 2039 2040When braces are used, the matching ending brace is the first <SAMP>`}'</SAMP> 2041not escaped by a backslash or within a quoted string, and not within an 2042embedded arithmetic expansion, command substitution, or parameter 2043expansion. 2044</P><P> 2045 2046The basic form of parameter expansion is ${<VAR>parameter</VAR>}. 2047The value of <VAR>parameter</VAR> is substituted. The braces are required 2048when <VAR>parameter</VAR> 2049is a positional parameter with more than one digit, 2050or when <VAR>parameter</VAR> 2051is followed by a character that is not to be 2052interpreted as part of its name. 2053</P><P> 2054 2055If the first character of <VAR>parameter</VAR> is an exclamation point, 2056a level of variable indirection is introduced. 2057Bash uses the value of the variable formed from the rest of 2058<VAR>parameter</VAR> as the name of the variable; this variable is then 2059expanded and that value is used in the rest of the substitution, rather 2060than the value of <VAR>parameter</VAR> itself. 2061This is known as <CODE>indirect expansion</CODE>. 2062The exceptions to this are the expansions of ${!<VAR>prefix*</VAR>} 2063and ${!<VAR>name</VAR>[@]} 2064described below. 2065The exclamation point must immediately follow the left brace in order to 2066introduce indirection. 2067</P><P> 2068 2069In each of the cases below, <VAR>word</VAR> is subject to tilde expansion, 2070parameter expansion, command substitution, and arithmetic expansion. 2071</P><P> 2072 2073When not performing substring expansion, Bash tests for a parameter 2074that is unset or null; omitting the colon results in a test only for a 2075parameter that is unset. Put another way, if the colon is included, 2076the operator tests for both existence and that the value is not null; 2077if the colon is omitted, the operator tests only for existence. 2078</P><P> 2079 2080<DL COMPACT> 2081 2082<DT><CODE>${<VAR>parameter</VAR>:-<VAR>word</VAR>}</CODE> 2083<DD>If <VAR>parameter</VAR> is unset or null, the expansion of 2084<VAR>word</VAR> is substituted. Otherwise, the value of 2085<VAR>parameter</VAR> is substituted. 2086<P> 2087 2088<DT><CODE>${<VAR>parameter</VAR>:=<VAR>word</VAR>}</CODE> 2089<DD>If <VAR>parameter</VAR> 2090is unset or null, the expansion of <VAR>word</VAR> 2091is assigned to <VAR>parameter</VAR>. 2092The value of <VAR>parameter</VAR> is then substituted. 2093Positional parameters and special parameters may not be assigned to 2094in this way. 2095<P> 2096 2097<DT><CODE>${<VAR>parameter</VAR>:?<VAR>word</VAR>}</CODE> 2098<DD>If <VAR>parameter</VAR> 2099is null or unset, the expansion of <VAR>word</VAR> (or a message 2100to that effect if <VAR>word</VAR> 2101is not present) is written to the standard error and the shell, if it 2102is not interactive, exits. Otherwise, the value of <VAR>parameter</VAR> is 2103substituted. 2104<P> 2105 2106<DT><CODE>${<VAR>parameter</VAR>:+<VAR>word</VAR>}</CODE> 2107<DD>If <VAR>parameter</VAR> 2108is null or unset, nothing is substituted, otherwise the expansion of 2109<VAR>word</VAR> is substituted. 2110<P> 2111 2112<DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>}</CODE> 2113<DD><DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>:<VAR>length</VAR>}</CODE> 2114<DD>Expands to up to <VAR>length</VAR> characters of <VAR>parameter</VAR> 2115starting at the character specified by <VAR>offset</VAR>. 2116If <VAR>length</VAR> is omitted, expands to the substring of 2117<VAR>parameter</VAR> starting at the character specified by <VAR>offset</VAR>. 2118<VAR>length</VAR> and <VAR>offset</VAR> are arithmetic expressions 2119(see section <A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A>). 2120This is referred to as Substring Expansion. 2121<P> 2122 2123<VAR>length</VAR> must evaluate to a number greater than or equal to zero. 2124If <VAR>offset</VAR> evaluates to a number less than zero, the value 2125is used as an offset from the end of the value of <VAR>parameter</VAR>. 2126If <VAR>parameter</VAR> is <SAMP>`@'</SAMP>, the result is <VAR>length</VAR> positional 2127parameters beginning at <VAR>offset</VAR>. 2128If <VAR>parameter</VAR> is an array name indexed by <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, 2129the result is the <VAR>length</VAR> 2130members of the array beginning with <CODE>${<VAR>parameter</VAR>[<VAR>offset</VAR>]}</CODE>. 2131A negative <VAR>offset</VAR> is taken relative to one greater than the maximum 2132index of the specified array. 2133Note that a negative offset must be separated from the colon by at least 2134one space to avoid being confused with the <SAMP>`:-'</SAMP> expansion. 2135Substring indexing is zero-based unless the positional parameters 2136are used, in which case the indexing starts at 1. 2137</P><P> 2138 2139<DT><CODE>${!<VAR>prefix</VAR>*}</CODE> 2140<DD><DT><CODE>${!<VAR>prefix</VAR>@}</CODE> 2141<DD>Expands to the names of variables whose names begin with <VAR>prefix</VAR>, 2142separated by the first character of the <CODE>IFS</CODE> special variable. 2143<P> 2144 2145<DT><CODE>${!<VAR>name</VAR>[@]}</CODE> 2146<DD><DT><CODE>${!<VAR>name</VAR>[*]}</CODE> 2147<DD>If <VAR>name</VAR> is an array variable, expands to the list of array indices 2148(keys) assigned in <VAR>name</VAR>. 2149If <VAR>name</VAR> is not an array, expands to 0 if <VAR>name</VAR> is set and null 2150otherwise. 2151When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each 2152key expands to a separate word. 2153<P> 2154 2155<DT><CODE>${#<VAR>parameter</VAR>}</CODE> 2156<DD>The length in characters of the expanded value of <VAR>parameter</VAR> is 2157substituted. 2158If <VAR>parameter</VAR> is <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, the value substituted 2159is the number of positional parameters. 2160If <VAR>parameter</VAR> is an array name subscripted by <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, 2161the value substituted is the number of elements in the array. 2162<P> 2163 2164<DT><CODE>${<VAR>parameter</VAR>#<VAR>word</VAR>}</CODE> 2165<DD><DT><CODE>${<VAR>parameter</VAR>##<VAR>word</VAR>}</CODE> 2166<DD>The <VAR>word</VAR> 2167is expanded to produce a pattern just as in filename 2168expansion (see section <A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A>). If the pattern matches 2169the beginning of the expanded value of <VAR>parameter</VAR>, 2170then the result of the expansion is the expanded value of <VAR>parameter</VAR> 2171with the shortest matching pattern (the <SAMP>`#'</SAMP> case) or the 2172longest matching pattern (the <SAMP>`##'</SAMP> case) deleted. 2173If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, 2174the pattern removal operation is applied to each positional 2175parameter in turn, and the expansion is the resultant list. 2176If <VAR>parameter</VAR> is an array variable subscripted with 2177<SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, 2178the pattern removal operation is applied to each member of the 2179array in turn, and the expansion is the resultant list. 2180<P> 2181 2182<DT><CODE>${<VAR>parameter</VAR>%<VAR>word</VAR>}</CODE> 2183<DD><DT><CODE>${<VAR>parameter</VAR>%%<VAR>word</VAR>}</CODE> 2184<DD>The <VAR>word</VAR> is expanded to produce a pattern just as in 2185filename expansion. 2186If the pattern matches a trailing portion of the expanded value of 2187<VAR>parameter</VAR>, then the result of the expansion is the value of 2188<VAR>parameter</VAR> with the shortest matching pattern (the <SAMP>`%'</SAMP> case) 2189or the longest matching pattern (the <SAMP>`%%'</SAMP> case) deleted. 2190If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, 2191the pattern removal operation is applied to each positional 2192parameter in turn, and the expansion is the resultant list. 2193If <VAR>parameter</VAR> 2194is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, 2195the pattern removal operation is applied to each member of the 2196array in turn, and the expansion is the resultant list. 2197<P> 2198 2199<DT><CODE>${<VAR>parameter</VAR>/<VAR>pattern</VAR>/<VAR>string</VAR>}</CODE> 2200<DD><DT><CODE>${<VAR>parameter</VAR>//<VAR>pattern</VAR>/<VAR>string</VAR>}</CODE> 2201<DD><P> 2202 2203The <VAR>pattern</VAR> is expanded to produce a pattern just as in 2204filename expansion. 2205<VAR>Parameter</VAR> is expanded and the longest match of <VAR>pattern</VAR> 2206against its value is replaced with <VAR>string</VAR>. 2207In the first form, only the first match is replaced. 2208The second form causes all matches of <VAR>pattern</VAR> to be 2209replaced with <VAR>string</VAR>. 2210If <VAR>pattern</VAR> begins with <SAMP>`#'</SAMP>, it must match at the beginning 2211of the expanded value of <VAR>parameter</VAR>. 2212If <VAR>pattern</VAR> begins with <SAMP>`%'</SAMP>, it must match at the end 2213of the expanded value of <VAR>parameter</VAR>. 2214If <VAR>string</VAR> is null, matches of <VAR>pattern</VAR> are deleted 2215and the <CODE>/</CODE> following <VAR>pattern</VAR> may be omitted. 2216If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, 2217the substitution operation is applied to each positional 2218parameter in turn, and the expansion is the resultant list. 2219If <VAR>parameter</VAR> 2220is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, 2221the substitution operation is applied to each member of the 2222array in turn, and the expansion is the resultant list. 2223</P><P> 2224 2225</DL> 2226<P> 2227 2228<A NAME="Command Substitution"></A> 2229<HR SIZE="6"> 2230<A NAME="SEC31"></A> 2231<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2232<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> < </A>]</TD> 2233<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> > </A>]</TD> 2234<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> << </A>]</TD> 2235<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> Up </A>]</TD> 2236<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> 2237<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2238<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2239<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2240<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2241</TR></TABLE> 2242<H3> 3.5.4 Command Substitution </H3> 2243<!--docid::SEC31::--> 2244<P> 2245 2246Command substitution allows the output of a command to replace 2247the command itself. 2248Command substitution occurs when a command is enclosed as follows: 2249<TABLE><tr><td> </td><td class=example><pre>$(<VAR>command</VAR>) 2250</pre></td></tr></table>or 2251<TABLE><tr><td> </td><td class=example><pre>`<VAR>command</VAR>` 2252</pre></td></tr></table></P><P> 2253 2254Bash performs the expansion by executing <VAR>command</VAR> and 2255replacing the command substitution with the standard output of the 2256command, with any trailing newlines deleted. 2257Embedded newlines are not deleted, but they may be removed during 2258word splitting. 2259The command substitution <CODE>$(cat <VAR>file</VAR>)</CODE> can be 2260replaced by the equivalent but faster <CODE>$(< <VAR>file</VAR>)</CODE>. 2261</P><P> 2262 2263When the old-style backquote form of substitution is used, 2264backslash retains its literal meaning except when followed by 2265<SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, or <SAMP>`\'</SAMP>. 2266The first backquote not preceded by a backslash terminates the 2267command substitution. 2268When using the <CODE>$(<VAR>command</VAR>)</CODE> form, all characters between 2269the parentheses make up the command; none are treated specially. 2270</P><P> 2271 2272Command substitutions may be nested. To nest when using the backquoted 2273form, escape the inner backquotes with backslashes. 2274</P><P> 2275 2276If the substitution appears within double quotes, word splitting and 2277filename expansion are not performed on the results. 2278</P><P> 2279 2280<A NAME="Arithmetic Expansion"></A> 2281<HR SIZE="6"> 2282<A NAME="SEC32"></A> 2283<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2284<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> < </A>]</TD> 2285<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> > </A>]</TD> 2286<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> << </A>]</TD> 2287<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> Up </A>]</TD> 2288<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> 2289<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2290<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2291<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2292<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2293</TR></TABLE> 2294<H3> 3.5.5 Arithmetic Expansion </H3> 2295<!--docid::SEC32::--> 2296<P> 2297 2298Arithmetic expansion allows the evaluation of an arithmetic expression 2299and the substitution of the result. The format for arithmetic expansion is: 2300</P><P> 2301 2302<TABLE><tr><td> </td><td class=example><pre>$(( <VAR>expression</VAR> )) 2303</pre></td></tr></table></P><P> 2304 2305The expression is treated as if it were within double quotes, but 2306a double quote inside the parentheses is not treated specially. 2307All tokens in the expression undergo parameter expansion, command 2308substitution, and quote removal. 2309Arithmetic expansions may be nested. 2310</P><P> 2311 2312The evaluation is performed according to the rules listed below 2313(see section <A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A>). 2314If the expression is invalid, Bash prints a message indicating 2315failure to the standard error and no substitution occurs. 2316</P><P> 2317 2318<A NAME="Process Substitution"></A> 2319<HR SIZE="6"> 2320<A NAME="SEC33"></A> 2321<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2322<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> < </A>]</TD> 2323<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> > </A>]</TD> 2324<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> << </A>]</TD> 2325<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> Up </A>]</TD> 2326<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> 2327<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2328<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2329<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2330<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2331</TR></TABLE> 2332<H3> 3.5.6 Process Substitution </H3> 2333<!--docid::SEC33::--> 2334<P> 2335 2336Process substitution is supported on systems that support named 2337pipes (FIFOs) or the <TT>`/dev/fd'</TT> method of naming open files. 2338It takes the form of 2339<TABLE><tr><td> </td><td class=example><pre><(<VAR>list</VAR>) 2340</pre></td></tr></table>or 2341<TABLE><tr><td> </td><td class=example><pre>>(<VAR>list</VAR>) 2342</pre></td></tr></table>The process <VAR>list</VAR> is run with its input or output connected to a 2343FIFO or some file in <TT>`/dev/fd'</TT>. The name of this file is 2344passed as an argument to the current command as the result of the 2345expansion. If the <CODE>>(<VAR>list</VAR>)</CODE> form is used, writing to 2346the file will provide input for <VAR>list</VAR>. If the 2347<CODE><(<VAR>list</VAR>)</CODE> form is used, the file passed as an 2348argument should be read to obtain the output of <VAR>list</VAR>. 2349Note that no space may appear between the <CODE><</CODE> or <CODE>></CODE> 2350and the left parenthesis, otherwise the construct would be interpreted 2351as a redirection. 2352</P><P> 2353 2354When available, process substitution is performed simultaneously with 2355parameter and variable expansion, command substitution, and arithmetic 2356expansion. 2357</P><P> 2358 2359<A NAME="Word Splitting"></A> 2360<HR SIZE="6"> 2361<A NAME="SEC34"></A> 2362<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2363<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> < </A>]</TD> 2364<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> > </A>]</TD> 2365<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> << </A>]</TD> 2366<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> Up </A>]</TD> 2367<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> 2368<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2369<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2370<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2371<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2372</TR></TABLE> 2373<H3> 3.5.7 Word Splitting </H3> 2374<!--docid::SEC34::--> 2375<P> 2376 2377The shell scans the results of parameter expansion, command substitution, 2378and arithmetic expansion that did not occur within double quotes for 2379word splitting. 2380</P><P> 2381 2382The shell treats each character of <CODE>$IFS</CODE> 2383as a delimiter, and splits the results of the other 2384expansions into words on these characters. If 2385<CODE>IFS</CODE> is unset, or its value is exactly <CODE><space><tab><newline></CODE>, 2386the default, then any sequence of <CODE>IFS</CODE> 2387characters serves to delimit words. If <CODE>IFS</CODE> 2388has a value other than the default, then sequences of 2389the whitespace characters <CODE>space</CODE> and <CODE>tab</CODE> 2390are ignored at the beginning and end of the 2391word, as long as the whitespace character is in the 2392value of <CODE>IFS</CODE> (an <CODE>IFS</CODE> whitespace character). 2393Any character in <CODE>IFS</CODE> that is not <CODE>IFS</CODE> 2394whitespace, along with any adjacent <CODE>IFS</CODE> 2395whitespace characters, delimits a field. A sequence of <CODE>IFS</CODE> 2396whitespace characters is also treated as a delimiter. 2397If the value of <CODE>IFS</CODE> is null, no word splitting occurs. 2398</P><P> 2399 2400Explicit null arguments (<CODE>""</CODE> or <CODE>"</CODE>) are retained. 2401Unquoted implicit null arguments, resulting from the expansion of 2402parameters that have no values, are removed. 2403If a parameter with no value is expanded within double quotes, a 2404null argument results and is retained. 2405</P><P> 2406 2407Note that if no expansion occurs, no splitting 2408is performed. 2409</P><P> 2410 2411<A NAME="Filename Expansion"></A> 2412<HR SIZE="6"> 2413<A NAME="SEC35"></A> 2414<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2415<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> < </A>]</TD> 2416<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> > </A>]</TD> 2417<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> << </A>]</TD> 2418<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> Up </A>]</TD> 2419<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> >> </A>]</TD> 2420<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2421<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2422<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2423<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2424</TR></TABLE> 2425<H3> 3.5.8 Filename Expansion </H3> 2426<!--docid::SEC35::--> 2427<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 2428<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC36">3.5.8.1 Pattern Matching</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the shell matches patterns.</TD></TR> 2429</TABLE></BLOCKQUOTE> 2430<A NAME="IDX64"></A> 2431<A NAME="IDX65"></A> 2432<A NAME="IDX66"></A> 2433<A NAME="IDX67"></A> 2434<P> 2435 2436After word splitting, unless the <SAMP>`-f'</SAMP> option has been set 2437(see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>), Bash scans each word for the characters 2438<SAMP>`*'</SAMP>, <SAMP>`?'</SAMP>, and <SAMP>`['</SAMP>. 2439If one of these characters appears, then the word is 2440regarded as a <VAR>pattern</VAR>, 2441and replaced with an alphabetically sorted list of 2442file names matching the pattern. If no matching file names are found, 2443and the shell option <CODE>nullglob</CODE> is disabled, the word is left 2444unchanged. 2445If the <CODE>nullglob</CODE> option is set, and no matches are found, the word 2446is removed. 2447If the <CODE>failglob</CODE> shell option is set, and no matches are found, 2448an error message is printed and the command is not executed. 2449If the shell option <CODE>nocaseglob</CODE> is enabled, the match is performed 2450without regard to the case of alphabetic characters. 2451</P><P> 2452 2453When a pattern is used for filename generation, the character <SAMP>`.'</SAMP> 2454at the start of a filename or immediately following a slash 2455must be matched explicitly, unless the shell option <CODE>dotglob</CODE> is set. 2456When matching a file name, the slash character must always be 2457matched explicitly. 2458In other cases, the <SAMP>`.'</SAMP> character is not treated specially. 2459</P><P> 2460 2461See the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>, 2462for a description of the <CODE>nocaseglob</CODE>, <CODE>nullglob</CODE>, 2463<CODE>failglob</CODE>, and <CODE>dotglob</CODE> options. 2464</P><P> 2465 2466The <CODE>GLOBIGNORE</CODE> 2467shell variable may be used to restrict the set of filenames matching a 2468pattern. If <CODE>GLOBIGNORE</CODE> 2469is set, each matching filename that also matches one of the patterns in 2470<CODE>GLOBIGNORE</CODE> is removed from the list of matches. The filenames 2471<TT>`.'</TT> and <TT>`..'</TT> 2472are always ignored when <CODE>GLOBIGNORE</CODE> 2473is set and not null. 2474However, setting <CODE>GLOBIGNORE</CODE> to a non-null value has the effect of 2475enabling the <CODE>dotglob</CODE> 2476shell option, so all other filenames beginning with a 2477<SAMP>`.'</SAMP> will match. 2478To get the old behavior of ignoring filenames beginning with a 2479<SAMP>`.'</SAMP>, make <SAMP>`.*'</SAMP> one of the patterns in <CODE>GLOBIGNORE</CODE>. 2480The <CODE>dotglob</CODE> option is disabled when <CODE>GLOBIGNORE</CODE> 2481is unset. 2482</P><P> 2483 2484<A NAME="Pattern Matching"></A> 2485<HR SIZE="6"> 2486<A NAME="SEC36"></A> 2487<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2488<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> < </A>]</TD> 2489<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> > </A>]</TD> 2490<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> << </A>]</TD> 2491<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> Up </A>]</TD> 2492<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> >> </A>]</TD> 2493<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2494<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2495<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2496<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2497</TR></TABLE> 2498<H4> 3.5.8.1 Pattern Matching </H4> 2499<!--docid::SEC36::--> 2500<P> 2501 2502Any character that appears in a pattern, other than the special pattern 2503characters described below, matches itself. 2504The NUL character may not occur in a pattern. 2505A backslash escapes the following character; the 2506escaping backslash is discarded when matching. 2507The special pattern characters must be quoted if they are to be matched 2508literally. 2509</P><P> 2510 2511The special pattern characters have the following meanings: 2512<DL COMPACT> 2513<DT><CODE>*</CODE> 2514<DD>Matches any string, including the null string. 2515<DT><CODE>?</CODE> 2516<DD>Matches any single character. 2517<DT><CODE>[<small>...</small>]</CODE> 2518<DD>Matches any one of the enclosed characters. A pair of characters 2519separated by a hyphen denotes a <VAR>range expression</VAR>; 2520any character that sorts between those two characters, inclusive, 2521using the current locale's collating sequence and character set, 2522is matched. If the first character following the 2523<SAMP>`['</SAMP> is a <SAMP>`!'</SAMP> or a <SAMP>`^'</SAMP> 2524then any character not enclosed is matched. A <SAMP>`-'</SAMP> 2525may be matched by including it as the first or last character 2526in the set. A <SAMP>`]'</SAMP> may be matched by including it as the first 2527character in the set. 2528The sorting order of characters in range expressions is determined by 2529the current locale and the value of the <CODE>LC_COLLATE</CODE> shell variable, 2530if set. 2531<P> 2532 2533For example, in the default C locale, <SAMP>`[a-dx-z]'</SAMP> is equivalent to 2534<SAMP>`[abcdxyz]'</SAMP>. Many locales sort characters in dictionary order, and in 2535these locales <SAMP>`[a-dx-z]'</SAMP> is typically not equivalent to <SAMP>`[abcdxyz]'</SAMP>; 2536it might be equivalent to <SAMP>`[aBbCcDdxXyYz]'</SAMP>, for example. To obtain 2537the traditional interpretation of ranges in bracket expressions, you can 2538force the use of the C locale by setting the <CODE>LC_COLLATE</CODE> or 2539<CODE>LC_ALL</CODE> environment variable to the value <SAMP>`C'</SAMP>. 2540</P><P> 2541 2542Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, <VAR>character classes</VAR> can be specified 2543using the syntax 2544<CODE>[:</CODE><VAR>class</VAR><CODE>:]</CODE>, where <VAR>class</VAR> is one of the 2545following classes defined in the POSIX 1003.2 standard: 2546<TABLE><tr><td> </td><td class=example><pre>alnum alpha ascii blank cntrl digit graph lower 2547print punct space upper word xdigit 2548</pre></td></tr></table>A character class matches any character belonging to that class. 2549The <CODE>word</CODE> character class matches letters, digits, and the character 2550<SAMP>`_'</SAMP>. 2551</P><P> 2552 2553Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, an <VAR>equivalence class</VAR> can be 2554specified using the syntax <CODE>[=</CODE><VAR>c</VAR><CODE>=]</CODE>, which 2555matches all characters with the same collation weight (as defined 2556by the current locale) as the character <VAR>c</VAR>. 2557</P><P> 2558 2559Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, the syntax <CODE>[.</CODE><VAR>symbol</VAR><CODE>.]</CODE> 2560matches the collating symbol <VAR>symbol</VAR>. 2561</DL> 2562<P> 2563 2564If the <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> 2565builtin, several extended pattern matching operators are recognized. 2566In the following description, a <VAR>pattern-list</VAR> is a list of one 2567or more patterns separated by a <SAMP>`|'</SAMP>. 2568Composite patterns may be formed using one or more of the following 2569sub-patterns: 2570</P><P> 2571 2572<DL COMPACT> 2573<DT><CODE>?(<VAR>pattern-list</VAR>)</CODE> 2574<DD>Matches zero or one occurrence of the given patterns. 2575<P> 2576 2577<DT><CODE>*(<VAR>pattern-list</VAR>)</CODE> 2578<DD>Matches zero or more occurrences of the given patterns. 2579<P> 2580 2581<DT><CODE>+(<VAR>pattern-list</VAR>)</CODE> 2582<DD>Matches one or more occurrences of the given patterns. 2583<P> 2584 2585<DT><CODE>@(<VAR>pattern-list</VAR>)</CODE> 2586<DD>Matches one of the given patterns. 2587<P> 2588 2589<DT><CODE>!(<VAR>pattern-list</VAR>)</CODE> 2590<DD>Matches anything except one of the given patterns. 2591</DL> 2592<P> 2593 2594<A NAME="Quote Removal"></A> 2595<HR SIZE="6"> 2596<A NAME="SEC37"></A> 2597<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2598<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> < </A>]</TD> 2599<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> > </A>]</TD> 2600<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> << </A>]</TD> 2601<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> Up </A>]</TD> 2602<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD> 2603<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2604<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2605<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2606<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2607</TR></TABLE> 2608<H3> 3.5.9 Quote Removal </H3> 2609<!--docid::SEC37::--> 2610<P> 2611 2612After the preceding expansions, all unquoted occurrences of the 2613characters <SAMP>`\'</SAMP>, <SAMP>`''</SAMP>, and <SAMP>`"'</SAMP> that did not 2614result from one of the above expansions are removed. 2615</P><P> 2616 2617<A NAME="Redirections"></A> 2618<HR SIZE="6"> 2619<A NAME="SEC38"></A> 2620<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2621<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> < </A>]</TD> 2622<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> > </A>]</TD> 2623<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> << </A>]</TD> 2624<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> 2625<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2626<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2627<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2628<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2629<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2630</TR></TABLE> 2631<H2> 3.6 Redirections </H2> 2632<!--docid::SEC38::--> 2633<P> 2634 2635Before a command is executed, its input and output 2636may be <VAR>redirected</VAR> 2637using a special notation interpreted by the shell. 2638Redirection may also be used to open and close files for the 2639current shell execution environment. The following redirection 2640operators may precede or appear anywhere within a 2641simple command or may follow a command. 2642Redirections are processed in the order they appear, from 2643left to right. 2644</P><P> 2645 2646In the following descriptions, if the file descriptor number is 2647omitted, and the first character of the redirection operator is 2648<SAMP>`<'</SAMP>, the redirection refers to the standard input (file 2649descriptor 0). If the first character of the redirection operator 2650is <SAMP>`>'</SAMP>, the redirection refers to the standard output (file 2651descriptor 1). 2652</P><P> 2653 2654The word following the redirection operator in the following 2655descriptions, unless otherwise noted, is subjected to brace expansion, 2656tilde expansion, parameter expansion, command substitution, arithmetic 2657expansion, quote removal, filename expansion, and word splitting. 2658If it expands to more than one word, Bash reports an error. 2659</P><P> 2660 2661Note that the order of redirections is significant. For example, 2662the command 2663<TABLE><tr><td> </td><td class=example><pre>ls > <VAR>dirlist</VAR> 2>&1 2664</pre></td></tr></table>directs both standard output (file descriptor 1) and standard error 2665(file descriptor 2) to the file <VAR>dirlist</VAR>, while the command 2666<TABLE><tr><td> </td><td class=example><pre>ls 2>&1 > <VAR>dirlist</VAR> 2667</pre></td></tr></table>directs only the standard output to file <VAR>dirlist</VAR>, 2668because the standard error was duplicated as standard output 2669before the standard output was redirected to <VAR>dirlist</VAR>. 2670</P><P> 2671 2672Bash handles several filenames specially when they are used in 2673redirections, as described in the following table: 2674</P><P> 2675 2676<DL COMPACT> 2677<DT><CODE>/dev/fd/<VAR>fd</VAR></CODE> 2678<DD>If <VAR>fd</VAR> is a valid integer, file descriptor <VAR>fd</VAR> is duplicated. 2679<P> 2680 2681<DT><CODE>/dev/stdin</CODE> 2682<DD>File descriptor 0 is duplicated. 2683<P> 2684 2685<DT><CODE>/dev/stdout</CODE> 2686<DD>File descriptor 1 is duplicated. 2687<P> 2688 2689<DT><CODE>/dev/stderr</CODE> 2690<DD>File descriptor 2 is duplicated. 2691<P> 2692 2693<DT><CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE> 2694<DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR> 2695is an integer port number or service name, Bash attempts to open a TCP 2696connection to the corresponding socket. 2697<P> 2698 2699<DT><CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE> 2700<DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR> 2701is an integer port number or service name, Bash attempts to open a UDP 2702connection to the corresponding socket. 2703<P> 2704 2705</DL> 2706<P> 2707 2708A failure to open or create a file causes the redirection to fail. 2709</P><P> 2710 2711Redirections using file descriptors greater than 9 should be used with 2712care, as they may conflict with file descriptors the shell uses 2713internally. 2714</P><P> 2715 2716<HR SIZE="6"> 2717<A NAME="SEC39"></A> 2718<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2719<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> < </A>]</TD> 2720<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> > </A>]</TD> 2721<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> << </A>]</TD> 2722<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> Up </A>]</TD> 2723<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2724<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2725<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2726<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2727<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2728</TR></TABLE> 2729<H3> 3.6.1 Redirecting Input </H3> 2730<!--docid::SEC39::--> 2731Redirection of input causes the file whose name results from 2732the expansion of <VAR>word</VAR> 2733to be opened for reading on file descriptor <CODE>n</CODE>, 2734or the standard input (file descriptor 0) if <CODE>n</CODE> 2735is not specified. 2736<P> 2737 2738The general format for redirecting input is: 2739<TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<<VAR>word</VAR> 2740</pre></td></tr></table></P><P> 2741 2742<HR SIZE="6"> 2743<A NAME="SEC40"></A> 2744<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2745<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> < </A>]</TD> 2746<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> > </A>]</TD> 2747<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> << </A>]</TD> 2748<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> Up </A>]</TD> 2749<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2750<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2751<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2752<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2753<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2754</TR></TABLE> 2755<H3> 3.6.2 Redirecting Output </H3> 2756<!--docid::SEC40::--> 2757Redirection of output causes the file whose name results from 2758the expansion of <VAR>word</VAR> 2759to be opened for writing on file descriptor <VAR>n</VAR>, 2760or the standard output (file descriptor 1) if <VAR>n</VAR> 2761is not specified. If the file does not exist it is created; 2762if it does exist it is truncated to zero size. 2763<P> 2764 2765The general format for redirecting output is: 2766<TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>[|]<VAR>word</VAR> 2767</pre></td></tr></table></P><P> 2768 2769If the redirection operator is <SAMP>`>'</SAMP>, and the <CODE>noclobber</CODE> 2770option to the <CODE>set</CODE> builtin has been enabled, the redirection 2771will fail if the file whose name results from the expansion of 2772<VAR>word</VAR> exists and is a regular file. 2773If the redirection operator is <SAMP>`>|'</SAMP>, or the redirection operator is 2774<SAMP>`>'</SAMP> and the <CODE>noclobber</CODE> option is not enabled, the redirection 2775is attempted even if the file named by <VAR>word</VAR> exists. 2776</P><P> 2777 2778<HR SIZE="6"> 2779<A NAME="SEC41"></A> 2780<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2781<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> < </A>]</TD> 2782<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> > </A>]</TD> 2783<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> << </A>]</TD> 2784<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> Up </A>]</TD> 2785<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2786<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2787<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2788<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2789<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2790</TR></TABLE> 2791<H3> 3.6.3 Appending Redirected Output </H3> 2792<!--docid::SEC41::--> 2793Redirection of output in this fashion 2794causes the file whose name results from 2795the expansion of <VAR>word</VAR> 2796to be opened for appending on file descriptor <VAR>n</VAR>, 2797or the standard output (file descriptor 1) if <VAR>n</VAR> 2798is not specified. If the file does not exist it is created. 2799<P> 2800 2801The general format for appending output is: 2802<TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>><VAR>word</VAR> 2803</pre></td></tr></table></P><P> 2804 2805<HR SIZE="6"> 2806<A NAME="SEC42"></A> 2807<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2808<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> < </A>]</TD> 2809<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> > </A>]</TD> 2810<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> << </A>]</TD> 2811<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> Up </A>]</TD> 2812<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2813<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2814<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2815<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2816<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2817</TR></TABLE> 2818<H3> 3.6.4 Redirecting Standard Output and Standard Error </H3> 2819<!--docid::SEC42::--> 2820Bash allows both the 2821standard output (file descriptor 1) and 2822the standard error output (file descriptor 2) 2823to be redirected to the file whose name is the 2824expansion of <VAR>word</VAR> with this construct. 2825<P> 2826 2827There are two formats for redirecting standard output and 2828standard error: 2829<TABLE><tr><td> </td><td class=example><pre>&><VAR>word</VAR> 2830</pre></td></tr></table>and 2831<TABLE><tr><td> </td><td class=example><pre>>&<VAR>word</VAR> 2832</pre></td></tr></table>Of the two forms, the first is preferred. 2833This is semantically equivalent to 2834<TABLE><tr><td> </td><td class=example><pre>><VAR>word</VAR> 2>&1 2835</pre></td></tr></table></P><P> 2836 2837<HR SIZE="6"> 2838<A NAME="SEC43"></A> 2839<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2840<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> < </A>]</TD> 2841<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> > </A>]</TD> 2842<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> << </A>]</TD> 2843<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> Up </A>]</TD> 2844<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2845<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2846<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2847<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2848<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2849</TR></TABLE> 2850<H3> 3.6.5 Here Documents </H3> 2851<!--docid::SEC43::--> 2852This type of redirection instructs the shell to read input from the 2853current source until a line containing only <VAR>word</VAR> 2854(with no trailing blanks) is seen. All of 2855the lines read up to that point are then used as the standard 2856input for a command. 2857<P> 2858 2859The format of here-documents is: 2860<TABLE><tr><td> </td><td class=example><pre><<[-]<VAR>word</VAR> 2861 <VAR>here-document</VAR> 2862<VAR>delimiter</VAR> 2863</pre></td></tr></table></P><P> 2864 2865No parameter expansion, command substitution, arithmetic expansion, 2866or filename expansion is performed on 2867<VAR>word</VAR>. If any characters in <VAR>word</VAR> are quoted, the 2868<VAR>delimiter</VAR> is the result of quote removal on <VAR>word</VAR>, 2869and the lines in the here-document are not expanded. 2870If <VAR>word</VAR> is unquoted, 2871all lines of the here-document are subjected to parameter expansion, 2872command substitution, and arithmetic expansion. In the latter 2873case, the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP> 2874must be used to quote the characters 2875<SAMP>`\'</SAMP>, <SAMP>`$'</SAMP>, and <SAMP>``'</SAMP>. 2876</P><P> 2877 2878If the redirection operator is <SAMP>`<<-'</SAMP>, 2879then all leading tab characters are stripped from input lines and the 2880line containing <VAR>delimiter</VAR>. 2881This allows here-documents within shell scripts to be indented in a 2882natural fashion. 2883</P><P> 2884 2885<HR SIZE="6"> 2886<A NAME="SEC44"></A> 2887<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2888<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> < </A>]</TD> 2889<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> > </A>]</TD> 2890<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> << </A>]</TD> 2891<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> Up </A>]</TD> 2892<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2893<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2894<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2895<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2896<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2897</TR></TABLE> 2898<H3> 3.6.6 Here Strings </H3> 2899<!--docid::SEC44::--> 2900A variant of here documents, the format is: 2901<TABLE><tr><td> </td><td class=example><pre><<< <VAR>word</VAR> 2902</pre></td></tr></table><P> 2903 2904The <VAR>word</VAR> is expanded and supplied to the command on its standard 2905input. 2906</P><P> 2907 2908<HR SIZE="6"> 2909<A NAME="SEC45"></A> 2910<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2911<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> < </A>]</TD> 2912<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> > </A>]</TD> 2913<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> << </A>]</TD> 2914<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> Up </A>]</TD> 2915<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2916<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2917<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2918<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2919<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2920</TR></TABLE> 2921<H3> 3.6.7 Duplicating File Descriptors </H3> 2922<!--docid::SEC45::--> 2923The redirection operator 2924<TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>word</VAR> 2925</pre></td></tr></table>is used to duplicate input file descriptors. 2926If <VAR>word</VAR> 2927expands to one or more digits, the file descriptor denoted by <VAR>n</VAR> 2928is made to be a copy of that file descriptor. 2929If the digits in <VAR>word</VAR> do not specify a file descriptor open for 2930input, a redirection error occurs. 2931If <VAR>word</VAR> 2932evaluates to <SAMP>`-'</SAMP>, file descriptor <VAR>n</VAR> is closed. If 2933<VAR>n</VAR> is not specified, the standard input (file descriptor 0) is used. 2934<P> 2935 2936The operator 2937<TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>word</VAR> 2938</pre></td></tr></table>is used similarly to duplicate output file descriptors. If 2939<VAR>n</VAR> is not specified, the standard output (file descriptor 1) is used. 2940If the digits in <VAR>word</VAR> do not specify a file descriptor open for 2941output, a redirection error occurs. 2942As a special case, if <VAR>n</VAR> is omitted, and <VAR>word</VAR> does not 2943expand to one or more digits, the standard output and standard 2944error are redirected as described previously. 2945</P><P> 2946 2947<HR SIZE="6"> 2948<A NAME="SEC46"></A> 2949<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2950<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> < </A>]</TD> 2951<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> > </A>]</TD> 2952<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> << </A>]</TD> 2953<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> Up </A>]</TD> 2954<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2955<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2956<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2957<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2958<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2959</TR></TABLE> 2960<H3> 3.6.8 Moving File Descriptors </H3> 2961<!--docid::SEC46::--> 2962The redirection operator 2963<TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>digit</VAR>- 2964</pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>, 2965or the standard input (file descriptor 0) if <VAR>n</VAR> is not specified. 2966<VAR>digit</VAR> is closed after being duplicated to <VAR>n</VAR>. 2967<P> 2968 2969Similarly, the redirection operator 2970<TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>digit</VAR>- 2971</pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>, 2972or the standard output (file descriptor 1) if <VAR>n</VAR> is not specified. 2973</P><P> 2974 2975<HR SIZE="6"> 2976<A NAME="SEC47"></A> 2977<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 2978<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> < </A>]</TD> 2979<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> > </A>]</TD> 2980<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> << </A>]</TD> 2981<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> Up </A>]</TD> 2982<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> >> </A>]</TD> 2983<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 2984<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 2985<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 2986<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 2987</TR></TABLE> 2988<H3> 3.6.9 Opening File Descriptors for Reading and Writing </H3> 2989<!--docid::SEC47::--> 2990The redirection operator 2991<TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<><VAR>word</VAR> 2992</pre></td></tr></table>causes the file whose name is the expansion of <VAR>word</VAR> 2993to be opened for both reading and writing on file descriptor 2994<VAR>n</VAR>, or on file descriptor 0 if <VAR>n</VAR> 2995is not specified. If the file does not exist, it is created. 2996<P> 2997 2998<A NAME="Executing Commands"></A> 2999<HR SIZE="6"> 3000<A NAME="SEC48"></A> 3001<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3002<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> < </A>]</TD> 3003<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> > </A>]</TD> 3004<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> << </A>]</TD> 3005<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> 3006<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> >> </A>]</TD> 3007<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3008<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3009<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3010<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3011</TR></TABLE> 3012<H2> 3.7 Executing Commands </H2> 3013<!--docid::SEC48::--> 3014<P> 3015 3016<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 3017<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC49">3.7.1 Simple Command Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands simple commands before 3018 executing them.</TD></TR> 3019<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC50">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> 3020<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC51">3.7.3 Command Execution Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment in which Bash 3021 executes commands that are not 3022 shell builtins.</TD></TR> 3023<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC52">3.7.4 Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment given to a command.</TD></TR> 3024<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC53">3.7.5 Exit Status</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The status returned by commands and how Bash 3025 interprets it.</TD></TR> 3026<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC54">3.7.6 Signals</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What happens when Bash or a command it runs 3027 receives a signal.</TD></TR> 3028</TABLE></BLOCKQUOTE> 3029<P> 3030 3031<A NAME="Simple Command Expansion"></A> 3032<HR SIZE="6"> 3033<A NAME="SEC49"></A> 3034<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3035<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> < </A>]</TD> 3036<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> > </A>]</TD> 3037<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> << </A>]</TD> 3038<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> Up </A>]</TD> 3039<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> >> </A>]</TD> 3040<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3041<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3042<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3043<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3044</TR></TABLE> 3045<H3> 3.7.1 Simple Command Expansion </H3> 3046<!--docid::SEC49::--> 3047<P> 3048 3049When a simple command is executed, the shell performs the following 3050expansions, assignments, and redirections, from left to right. 3051</P><P> 3052 3053<OL> 3054<LI> 3055The words that the parser has marked as variable assignments (those 3056preceding the command name) and redirections are saved for later 3057processing. 3058<P> 3059 3060<LI> 3061The words that are not variable assignments or redirections are 3062expanded (see section <A HREF="bashref.html#SEC27">3.5 Shell Expansions</A>). 3063If any words remain after expansion, the first word 3064is taken to be the name of the command and the remaining words are 3065the arguments. 3066<P> 3067 3068<LI> 3069Redirections are performed as described above (see section <A HREF="bashref.html#SEC38">3.6 Redirections</A>). 3070<P> 3071 3072<LI> 3073The text after the <SAMP>`='</SAMP> in each variable assignment undergoes tilde 3074expansion, parameter expansion, command substitution, arithmetic expansion, 3075and quote removal before being assigned to the variable. 3076</OL> 3077<P> 3078 3079If no command name results, the variable assignments affect the current 3080shell environment. Otherwise, the variables are added to the environment 3081of the executed command and do not affect the current shell environment. 3082If any of the assignments attempts to assign a value to a readonly variable, 3083an error occurs, and the command exits with a non-zero status. 3084</P><P> 3085 3086If no command name results, redirections are performed, but do not 3087affect the current shell environment. A redirection error causes the 3088command to exit with a non-zero status. 3089</P><P> 3090 3091If there is a command name left after expansion, execution proceeds as 3092described below. Otherwise, the command exits. If one of the expansions 3093contained a command substitution, the exit status of the command is 3094the exit status of the last command substitution performed. If there 3095were no command substitutions, the command exits with a status of zero. 3096</P><P> 3097 3098<A NAME="Command Search and Execution"></A> 3099<HR SIZE="6"> 3100<A NAME="SEC50"></A> 3101<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3102<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> < </A>]</TD> 3103<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> > </A>]</TD> 3104<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> << </A>]</TD> 3105<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> Up </A>]</TD> 3106<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> >> </A>]</TD> 3107<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3108<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3109<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3110<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3111</TR></TABLE> 3112<H3> 3.7.2 Command Search and Execution </H3> 3113<!--docid::SEC50::--> 3114<P> 3115 3116After a command has been split into words, if it results in a 3117simple command and an optional list of arguments, the following 3118actions are taken. 3119</P><P> 3120 3121<OL> 3122<LI> 3123If the command name contains no slashes, the shell attempts to 3124locate it. If there exists a shell function by that name, that 3125function is invoked as described in <A HREF="bashref.html#SEC23">3.3 Shell Functions</A>. 3126<P> 3127 3128<LI> 3129If the name does not match a function, the shell searches for 3130it in the list of shell builtins. If a match is found, that 3131builtin is invoked. 3132<P> 3133 3134<LI> 3135If the name is neither a shell function nor a builtin, 3136and contains no slashes, Bash searches each element of 3137<CODE>$PATH</CODE> for a directory containing an executable file 3138by that name. Bash uses a hash table to remember the full 3139pathnames of executable files to avoid multiple <CODE>PATH</CODE> searches 3140(see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>). 3141A full search of the directories in <CODE>$PATH</CODE> 3142is performed only if the command is not found in the hash table. 3143If the search is unsuccessful, the shell prints an error 3144message and returns an exit status of 127. 3145<P> 3146 3147<LI> 3148If the search is successful, or if the command name contains 3149one or more slashes, the shell executes the named program in 3150a separate execution environment. 3151Argument 0 is set to the name given, and the remaining arguments 3152to the command are set to the arguments supplied, if any. 3153<P> 3154 3155<LI> 3156If this execution fails because the file is not in executable 3157format, and the file is not a directory, it is assumed to be a 3158<VAR>shell script</VAR> and the shell executes it as described in 3159<A HREF="bashref.html#SEC55">3.8 Shell Scripts</A>. 3160<P> 3161 3162<LI> 3163If the command was not begun asynchronously, the shell waits for 3164the command to complete and collects its exit status. 3165<P> 3166 3167</OL> 3168<P> 3169 3170<A NAME="Command Execution Environment"></A> 3171<HR SIZE="6"> 3172<A NAME="SEC51"></A> 3173<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3174<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> < </A>]</TD> 3175<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> > </A>]</TD> 3176<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> << </A>]</TD> 3177<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> Up </A>]</TD> 3178<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> >> </A>]</TD> 3179<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3180<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3181<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3182<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3183</TR></TABLE> 3184<H3> 3.7.3 Command Execution Environment </H3> 3185<!--docid::SEC51::--> 3186<P> 3187 3188The shell has an <VAR>execution environment</VAR>, which consists of the 3189following: 3190</P><P> 3191 3192<UL> 3193<LI> 3194open files inherited by the shell at invocation, as modified by 3195redirections supplied to the <CODE>exec</CODE> builtin 3196<P> 3197 3198<LI> 3199the current working directory as set by <CODE>cd</CODE>, <CODE>pushd</CODE>, or 3200<CODE>popd</CODE>, or inherited by the shell at invocation 3201<P> 3202 3203<LI> 3204the file creation mode mask as set by <CODE>umask</CODE> or inherited from 3205the shell's parent 3206<P> 3207 3208<LI> 3209current traps set by <CODE>trap</CODE> 3210<P> 3211 3212<LI> 3213shell parameters that are set by variable assignment or with <CODE>set</CODE> 3214or inherited from the shell's parent in the environment 3215<P> 3216 3217<LI> 3218shell functions defined during execution or inherited from the shell's 3219parent in the environment 3220<P> 3221 3222<LI> 3223options enabled at invocation (either by default or with command-line 3224arguments) or by <CODE>set</CODE> 3225<P> 3226 3227<LI> 3228options enabled by <CODE>shopt</CODE> 3229<P> 3230 3231<LI> 3232shell aliases defined with <CODE>alias</CODE> (see section <A HREF="bashref.html#SEC80">6.6 Aliases</A>) 3233<P> 3234 3235<LI> 3236various process IDs, including those of background jobs 3237(see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the value of <CODE>$$</CODE>, and the value of 3238<CODE>$PPID</CODE> 3239<P> 3240 3241</UL> 3242<P> 3243 3244When a simple command other than a builtin or shell function 3245is to be executed, it 3246is invoked in a separate execution environment that consists of 3247the following. Unless otherwise noted, the values are inherited 3248from the shell. 3249</P><P> 3250 3251<UL> 3252<LI> 3253the shell's open files, plus any modifications and additions specified 3254by redirections to the command 3255<P> 3256 3257<LI> 3258the current working directory 3259<P> 3260 3261<LI> 3262the file creation mode mask 3263<P> 3264 3265<LI> 3266shell variables and functions marked for export, along with variables 3267exported for the command, passed in the environment (see section <A HREF="bashref.html#SEC52">3.7.4 Environment</A>) 3268<P> 3269 3270<LI> 3271traps caught by the shell are reset to the values inherited from the 3272shell's parent, and traps ignored by the shell are ignored 3273<P> 3274 3275</UL> 3276<P> 3277 3278A command invoked in this separate environment cannot affect the 3279shell's execution environment. 3280</P><P> 3281 3282Command substitution, commands grouped with parentheses, 3283and asynchronous commands are invoked in a 3284subshell environment that is a duplicate of the shell environment, 3285except that traps caught by the shell are reset to the values 3286that the shell inherited from its parent at invocation. Builtin 3287commands that are invoked as part of a pipeline are also executed 3288in a subshell environment. Changes made to the subshell environment 3289cannot affect the shell's execution environment. 3290</P><P> 3291 3292If a command is followed by a <SAMP>`&'</SAMP> and job control is not active, the 3293default standard input for the command is the empty file <TT>`/dev/null'</TT>. 3294Otherwise, the invoked command inherits the file descriptors of the calling 3295shell as modified by redirections. 3296</P><P> 3297 3298<A NAME="Environment"></A> 3299<HR SIZE="6"> 3300<A NAME="SEC52"></A> 3301<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3302<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> < </A>]</TD> 3303<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> > </A>]</TD> 3304<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> << </A>]</TD> 3305<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> Up </A>]</TD> 3306<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> >> </A>]</TD> 3307<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3308<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3309<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3310<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3311</TR></TABLE> 3312<H3> 3.7.4 Environment </H3> 3313<!--docid::SEC52::--> 3314<P> 3315 3316When a program is invoked it is given an array of strings 3317called the <VAR>environment</VAR>. 3318This is a list of name-value pairs, of the form <CODE>name=value</CODE>. 3319</P><P> 3320 3321Bash provides several ways to manipulate the environment. 3322On invocation, the shell scans its own environment and 3323creates a parameter for each name found, automatically marking 3324it for <VAR>export</VAR> 3325to child processes. Executed commands inherit the environment. 3326The <CODE>export</CODE> and <SAMP>`declare -x'</SAMP> 3327commands allow parameters and functions to be added to and 3328deleted from the environment. If the value of a parameter 3329in the environment is modified, the new value becomes part 3330of the environment, replacing the old. The environment 3331inherited by any executed command consists of the shell's 3332initial environment, whose values may be modified in the shell, 3333less any pairs removed by the <CODE>unset</CODE> and <SAMP>`export -n'</SAMP> 3334commands, plus any additions via the <CODE>export</CODE> and 3335<SAMP>`declare -x'</SAMP> commands. 3336</P><P> 3337 3338The environment for any simple command 3339or function may be augmented temporarily by prefixing it with 3340parameter assignments, as described in <A HREF="bashref.html#SEC24">3.4 Shell Parameters</A>. 3341These assignment statements affect only the environment seen 3342by that command. 3343</P><P> 3344 3345If the <SAMP>`-k'</SAMP> option is set (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>), then all 3346parameter assignments are placed in the environment for a command, 3347not just those that precede the command name. 3348</P><P> 3349 3350When Bash invokes an external command, the variable <SAMP>`$_'</SAMP> 3351is set to the full path name of the command and passed to that 3352command in its environment. 3353</P><P> 3354 3355<A NAME="Exit Status"></A> 3356<HR SIZE="6"> 3357<A NAME="SEC53"></A> 3358<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3359<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> < </A>]</TD> 3360<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> > </A>]</TD> 3361<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> << </A>]</TD> 3362<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> Up </A>]</TD> 3363<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> >> </A>]</TD> 3364<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3365<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3366<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3367<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3368</TR></TABLE> 3369<H3> 3.7.5 Exit Status </H3> 3370<!--docid::SEC53::--> 3371<P> 3372 3373For the shell's purposes, a command which exits with a 3374zero exit status has succeeded. 3375A non-zero exit status indicates failure. 3376This seemingly counter-intuitive scheme is used so there 3377is one well-defined way to indicate success and a variety of 3378ways to indicate various failure modes. 3379When a command terminates on a fatal signal whose number is <VAR>N</VAR>, 3380Bash uses the value 128+<VAR>N</VAR> as the exit status. 3381</P><P> 3382 3383If a command is not found, the child process created to 3384execute it returns a status of 127. If a command is found 3385but is not executable, the return status is 126. 3386</P><P> 3387 3388If a command fails because of an error during expansion or redirection, 3389the exit status is greater than zero. 3390</P><P> 3391 3392The exit status is used by the Bash conditional commands 3393(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) and some of the list 3394constructs (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>). 3395</P><P> 3396 3397All of the Bash builtins return an exit status of zero if they succeed 3398and a non-zero status on failure, so they may be used by the 3399conditional and list constructs. 3400All builtins return an exit status of 2 to indicate incorrect usage. 3401</P><P> 3402 3403<A NAME="Signals"></A> 3404<HR SIZE="6"> 3405<A NAME="SEC54"></A> 3406<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3407<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> < </A>]</TD> 3408<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> > </A>]</TD> 3409<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> << </A>]</TD> 3410<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> Up </A>]</TD> 3411<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> >> </A>]</TD> 3412<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3413<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3414<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3415<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3416</TR></TABLE> 3417<H3> 3.7.6 Signals </H3> 3418<!--docid::SEC54::--> 3419<P> 3420 3421When Bash is interactive, in the absence of any traps, it ignores 3422<CODE>SIGTERM</CODE> (so that <SAMP>`kill 0'</SAMP> does not kill an interactive shell), 3423and <CODE>SIGINT</CODE> 3424is caught and handled (so that the <CODE>wait</CODE> builtin is interruptible). 3425When Bash receives a <CODE>SIGINT</CODE>, it breaks out of any executing loops. 3426In all cases, Bash ignores <CODE>SIGQUIT</CODE>. 3427If job control is in effect (see section <A HREF="bashref.html#SEC87">7. Job Control</A>), Bash 3428ignores <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>. 3429</P><P> 3430 3431Non-builtin commands started by Bash have signal handlers set to the 3432values inherited by the shell from its parent. 3433When job control is not in effect, asynchronous commands 3434ignore <CODE>SIGINT</CODE> and <CODE>SIGQUIT</CODE> in addition to these inherited 3435handlers. 3436Commands run as a result of 3437command substitution ignore the keyboard-generated job control signals 3438<CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>. 3439</P><P> 3440 3441The shell exits by default upon receipt of a <CODE>SIGHUP</CODE>. 3442Before exiting, an interactive shell resends the <CODE>SIGHUP</CODE> to 3443all jobs, running or stopped. 3444Stopped jobs are sent <CODE>SIGCONT</CODE> to ensure that they receive 3445the <CODE>SIGHUP</CODE>. 3446To prevent the shell from sending the <CODE>SIGHUP</CODE> signal to a 3447particular job, it should be removed 3448from the jobs table with the <CODE>disown</CODE> 3449builtin (see section <A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A>) or marked 3450to not receive <CODE>SIGHUP</CODE> using <CODE>disown -h</CODE>. 3451</P><P> 3452 3453If the <CODE>huponexit</CODE> shell option has been set with <CODE>shopt</CODE> 3454(see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>), Bash sends a <CODE>SIGHUP</CODE> to all jobs when 3455an interactive login shell exits. 3456</P><P> 3457 3458If Bash is waiting for a command to complete and receives a signal 3459for which a trap has been set, the trap will not be executed until 3460the command completes. 3461When Bash is waiting for an asynchronous 3462command via the <CODE>wait</CODE> builtin, the reception of a signal for 3463which a trap has been set will cause the <CODE>wait</CODE> builtin to return 3464immediately with an exit status greater than 128, immediately after 3465which the trap is executed. 3466</P><P> 3467 3468<A NAME="Shell Scripts"></A> 3469<HR SIZE="6"> 3470<A NAME="SEC55"></A> 3471<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3472<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> < </A>]</TD> 3473<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> > </A>]</TD> 3474<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD> 3475<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD> 3476<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> >> </A>]</TD> 3477<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3478<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3479<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3480<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3481</TR></TABLE> 3482<H2> 3.8 Shell Scripts </H2> 3483<!--docid::SEC55::--> 3484<P> 3485 3486A shell script is a text file containing shell commands. When such 3487a file is used as the first non-option argument when invoking Bash, 3488and neither the <SAMP>`-c'</SAMP> nor <SAMP>`-s'</SAMP> option is supplied 3489(see section <A HREF="bashref.html#SEC65">6.1 Invoking Bash</A>), 3490Bash reads and executes commands from the file, then exits. This 3491mode of operation creates a non-interactive shell. The shell first 3492searches for the file in the current directory, and looks in the 3493directories in <CODE>$PATH</CODE> if not found there. 3494</P><P> 3495 3496When Bash runs 3497a shell script, it sets the special parameter <CODE>0</CODE> to the name 3498of the file, rather than the name of the shell, and the positional 3499parameters are set to the remaining arguments, if any are given. 3500If no additional arguments are supplied, the positional parameters 3501are unset. 3502</P><P> 3503 3504A shell script may be made executable by using the <CODE>chmod</CODE> command 3505to turn on the execute bit. When Bash finds such a file while 3506searching the <CODE>$PATH</CODE> for a command, it spawns a subshell to 3507execute it. In other words, executing 3508<TABLE><tr><td> </td><td class=example><pre>filename <VAR>arguments</VAR> 3509</pre></td></tr></table>is equivalent to executing 3510<TABLE><tr><td> </td><td class=example><pre>bash filename <VAR>arguments</VAR> 3511</pre></td></tr></table></P><P> 3512 3513if <CODE>filename</CODE> is an executable shell script. 3514This subshell reinitializes itself, so that the effect is as if a 3515new shell had been invoked to interpret the script, with the 3516exception that the locations of commands remembered by the parent 3517(see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>) 3518are retained by the child. 3519</P><P> 3520 3521Most versions of Unix make this a part of the operating system's command 3522execution mechanism. If the first line of a script begins with 3523the two characters <SAMP>`#!'</SAMP>, the remainder of the line specifies 3524an interpreter for the program. 3525Thus, you can specify Bash, <CODE>awk</CODE>, Perl, or some other 3526interpreter and write the rest of the script file in that language. 3527</P><P> 3528 3529The arguments to the interpreter 3530consist of a single optional argument following the interpreter 3531name on the first line of the script file, followed by the name of 3532the script file, followed by the rest of the arguments. Bash 3533will perform this action on operating systems that do not handle it 3534themselves. Note that some older versions of Unix limit the interpreter 3535name and argument to a maximum of 32 characters. 3536</P><P> 3537 3538Bash scripts often begin with <CODE>#! /bin/bash</CODE> (assuming that 3539Bash has been installed in <TT>`/bin'</TT>), since this ensures that 3540Bash will be used to interpret the script, even if it is executed 3541under another shell. 3542</P><P> 3543 3544<A NAME="Shell Builtin Commands"></A> 3545<HR SIZE="6"> 3546<A NAME="SEC56"></A> 3547<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3548<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> < </A>]</TD> 3549<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> > </A>]</TD> 3550<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> << </A>]</TD> 3551<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 3552<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> >> </A>]</TD> 3553<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3554<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3555<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3556<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3557</TR></TABLE> 3558<H1> 4. Shell Builtin Commands </H1> 3559<!--docid::SEC56::--> 3560<P> 3561 3562<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 3563<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands inherited from the Bourne 3564 Shell.</TD></TR> 3565<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Table of builtins specific to Bash.</TD></TR> 3566<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC59">4.3 The Set Builtin</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">This builtin is so overloaded it 3567 deserves its own section.</TD></TR> 3568<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC60">4.4 Special Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands classified specially by 3569 POSIX.2.</TD></TR> 3570</TABLE></BLOCKQUOTE> 3571<P> 3572 3573Builtin commands are contained within the shell itself. 3574When the name of a builtin command is used as the first word of 3575a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>), the shell executes 3576the command directly, without invoking another program. 3577Builtin commands are necessary to implement functionality impossible 3578or inconvenient to obtain with separate utilities. 3579</P><P> 3580 3581This section briefly the builtins which Bash inherits from 3582the Bourne Shell, as well as the builtin commands which are unique 3583to or have been extended in Bash. 3584</P><P> 3585 3586Several builtin commands are described in other chapters: builtin 3587commands which provide the Bash interface to the job control 3588facilities (see section <A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A>), the directory stack 3589(see section <A HREF="bashref.html#SEC83">6.8.1 Directory Stack Builtins</A>), the command history 3590(see section <A HREF="bashref.html#SEC117">9.2 Bash History Builtins</A>), and the programmable completion 3591facilities (see section <A HREF="bashref.html#SEC114">8.7 Programmable Completion Builtins</A>). 3592</P><P> 3593 3594Many of the builtins have been extended by POSIX or Bash. 3595</P><P> 3596 3597Unless otherwise noted, each builtin command documented as accepting 3598options preceded by <SAMP>`-'</SAMP> accepts <SAMP>`--'</SAMP> 3599to signify the end of the options. 3600For example, the <CODE>:</CODE>, <CODE>true</CODE>, <CODE>false</CODE>, and <CODE>test</CODE> 3601builtins do not accept options. 3602</P><P> 3603 3604<A NAME="Bourne Shell Builtins"></A> 3605<HR SIZE="6"> 3606<A NAME="SEC57"></A> 3607<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 3608<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> < </A>]</TD> 3609<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> > </A>]</TD> 3610<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> << </A>]</TD> 3611<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> Up </A>]</TD> 3612<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> >> </A>]</TD> 3613<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 3614<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 3615<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 3616<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 3617</TR></TABLE> 3618<H2> 4.1 Bourne Shell Builtins </H2> 3619<!--docid::SEC57::--> 3620<P> 3621 3622The following shell builtin commands are inherited from the Bourne Shell. 3623These commands are implemented as specified by the POSIX 1003.2 standard. 3624</P><P> 3625 3626<DL COMPACT> 3627<DT><CODE>: (a colon)</CODE> 3628<DD><A NAME="IDX68"></A> 3629<TABLE><tr><td> </td><td class=example><pre>: [<VAR>arguments</VAR>] 3630</pre></td></tr></table>Do nothing beyond expanding <VAR>arguments</VAR> and performing redirections. 3631The return status is zero. 3632<P> 3633 3634<DT><CODE>. (a period)</CODE> 3635<DD><A NAME="IDX69"></A> 3636<TABLE><tr><td> </td><td class=example><pre>. <VAR>filename</VAR> [<VAR>arguments</VAR>] 3637</pre></td></tr></table>Read and execute commands from the <VAR>filename</VAR> argument in the 3638current shell context. If <VAR>filename</VAR> does not contain a slash, 3639the <CODE>PATH</CODE> variable is used to find <VAR>filename</VAR>. 3640When Bash is not in POSIX mode, the current directory is searched 3641if <VAR>filename</VAR> is not found in <CODE>$PATH</CODE>. 3642If any <VAR>arguments</VAR> are supplied, they become the positional 3643parameters when <VAR>filename</VAR> is executed. Otherwise the positional 3644parameters are unchanged. 3645The return status is the exit status of the last command executed, or 3646zero if no commands are executed. If <VAR>filename</VAR> is not found, or 3647cannot be read, the return status is non-zero. 3648This builtin is equivalent to <CODE>source</CODE>. 3649<P> 3650 3651<DT><CODE>break</CODE> 3652<DD><A NAME="IDX70"></A> 3653<TABLE><tr><td> </td><td class=example><pre>break [<VAR>n</VAR>] 3654</pre></td></tr></table>Exit from a <CODE>for</CODE>, <CODE>while</CODE>, <CODE>until</CODE>, or <CODE>select</CODE> loop. 3655If <VAR>n</VAR> is supplied, the <VAR>n</VAR>th enclosing loop is exited. 3656<VAR>n</VAR> must be greater than or equal to 1. 3657The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1. 3658<P> 3659 3660<DT><CODE>cd</CODE> 3661<DD><A NAME="IDX71"></A> 3662<TABLE><tr><td> </td><td class=example><pre>cd [-L|-P] [<VAR>directory</VAR>] 3663</pre></td></tr></table>Change the current working directory to <VAR>directory</VAR>. 3664If <VAR>directory</VAR> is not given, the value of the <CODE>HOME</CODE> shell 3665variable is used. 3666If the shell variable <CODE>CDPATH</CODE> exists, it is used as a search path. 3667If <VAR>directory</VAR> begins with a slash, <CODE>CDPATH</CODE> is not used. 3668<P> 3669 3670The <SAMP>`-P'</SAMP> option means to not follow symbolic links; symbolic 3671links are followed by default or with the <SAMP>`-L'</SAMP> option. 3672If <VAR>directory</VAR> is <SAMP>`-'</SAMP>, it is equivalent to <CODE>$OLDPWD</CODE>. 3673</P><P> 3674 3675If a non-empty directory name from <CODE>CDPATH</CODE> is used, or if 3676<SAMP>`-'</SAMP> is the first argument, and the directory change is 3677successful, the absolute pathname of the new working directory is 3678written to the standard output. 3679</P><P> 3680 3681The return status is zero if the directory is successfully changed, 3682non-zero otherwise. 3683</P><P> 3684 3685<DT><CODE>continue</CODE> 3686<DD><A NAME="IDX72"></A> 3687<TABLE><tr><td> </td><td class=example><pre>continue [<VAR>n</VAR>] 3688</pre></td></tr></table>Resume the next iteration of an enclosing <CODE>for</CODE>, <CODE>while</CODE>, 3689<CODE>until</CODE>, or <CODE>select</CODE> loop. 3690If <VAR>n</VAR> is supplied, the execution of the <VAR>n</VAR>th enclosing loop 3691is resumed. 3692<VAR>n</VAR> must be greater than or equal to 1. 3693The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1. 3694<P> 3695 3696<DT><CODE>eval</CODE> 3697<DD><A NAME="IDX73"></A> 3698<TABLE><tr><td> </td><td class=example><pre>eval [<VAR>arguments</VAR>] 3699</pre></td></tr></table>The arguments are concatenated together into a single command, which is 3700then read and executed, and its exit status returned as the exit status 3701of <CODE>eval</CODE>. 3702If there are no arguments or only empty arguments, the return status is 3703zero. 3704<P> 3705 3706<DT><CODE>exec</CODE> 3707<DD><A NAME="IDX74"></A> 3708<TABLE><tr><td> </td><td class=example><pre>exec [-cl] [-a <VAR>name</VAR>] [<VAR>command</VAR> [<VAR>arguments</VAR>]] 3709</pre></td></tr></table>If <VAR>command</VAR> 3710is supplied, it replaces the shell without creating a new process. 3711If the <SAMP>`-l'</SAMP> option is supplied, the shell places a dash at the 3712beginning of the zeroth arg passed to <VAR>command</VAR>. 3713This is what the <CODE>login</CODE> program does. 3714The <SAMP>`-c'</SAMP> option causes <VAR>command</VAR> to be executed with an empty 3715environment. 3716If <SAMP>`-a'</SAMP> is supplied, the shell passes <VAR>name</VAR> as the zeroth 3717argument to <VAR>command</VAR>. 3718If no <VAR>command</VAR> is specified, redirections may be used to affect 3719the current shell environment. If there are no redirection errors, the 3720return status is zero; otherwise the return status is non-zero. 3721<P> 3722 3723<DT><CODE>exit</CODE> 3724<DD><A NAME="IDX75"></A> 3725<TABLE><tr><td> </td><td class=example><pre>exit [<VAR>n</VAR>] 3726</pre></td></tr></table>Exit the shell, returning a status of <VAR>n</VAR> to the shell's parent. 3727If <VAR>n</VAR> is omitted, the exit status is that of the last command executed. 3728Any trap on <CODE>EXIT</CODE> is executed before the shell terminates. 3729<P> 3730 3731<DT><CODE>export</CODE> 3732<DD><A NAME="IDX76"></A> 3733<TABLE><tr><td> </td><td class=example><pre>export [-fn] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]] 3734</pre></td></tr></table>Mark each <VAR>name</VAR> to be passed to child processes 3735in the environment. If the <SAMP>`-f'</SAMP> option is supplied, the <VAR>name</VAR>s 3736refer to shell functions; otherwise the names refer to shell variables. 3737The <SAMP>`-n'</SAMP> option means to no longer mark each <VAR>name</VAR> for export. 3738If no <VAR>names</VAR> are supplied, or if the <SAMP>`-p'</SAMP> option is given, a 3739list of exported names is displayed. 3740The <SAMP>`-p'</SAMP> option displays output in a form that may be reused as input. 3741If a variable name is followed by =<VAR>value</VAR>, the value of 3742the variable is set to <VAR>value</VAR>. 3743<P> 3744 3745The return status is zero unless an invalid option is supplied, one of 3746the names is not a valid shell variable name, or <SAMP>`-f'</SAMP> is supplied 3747with a name that is not a shell function. 3748</P><P> 3749 3750<DT><CODE>getopts</CODE> 3751<DD><A NAME="IDX77"></A> 3752<TABLE><tr><td> </td><td class=example><pre>getopts <VAR>optstring</VAR> <VAR>name</VAR> [<VAR>args</VAR>] 3753</pre></td></tr></table><CODE>getopts</CODE> is used by shell scripts to parse positional parameters. 3754<VAR>optstring</VAR> contains the option characters to be recognized; if a 3755character is followed by a colon, the option is expected to have an 3756argument, which should be separated from it by white space. 3757The colon (<SAMP>`:'</SAMP>) and question mark (<SAMP>`?'</SAMP>) may not be 3758used as option characters. 3759Each time it is invoked, <CODE>getopts</CODE> 3760places the next option in the shell variable <VAR>name</VAR>, initializing 3761<VAR>name</VAR> if it does not exist, 3762and the index of the next argument to be processed into the 3763variable <CODE>OPTIND</CODE>. 3764<CODE>OPTIND</CODE> is initialized to 1 each time the shell or a shell script 3765is invoked. 3766When an option requires an argument, 3767<CODE>getopts</CODE> places that argument into the variable <CODE>OPTARG</CODE>. 3768The shell does not reset <CODE>OPTIND</CODE> automatically; it must be manually 3769reset between multiple calls to <CODE>getopts</CODE> within the same shell 3770invocation if a new set of parameters is to be used. 3771<P> 3772 3773When the end of options is encountered, <CODE>getopts</CODE> exits with a 3774return value greater than zero. 3775<CODE>OPTIND</CODE> is set to the index of the first non-option argument, 3776and <CODE>name</CODE> is set to <SAMP>`?'</SAMP>. 3777</P><P> 3778 3779<CODE>getopts</CODE> 3780normally parses the positional parameters, but if more arguments are 3781given in <VAR>args</VAR>, <CODE>getopts</CODE> parses those instead. 3782</P><P> 3783 3784<CODE>getopts</CODE> can report errors in two ways. If the first character of 3785<VAR>optstring</VAR> is a colon, <VAR>silent</VAR> 3786error reporting is used. In normal operation diagnostic messages 3787are printed when invalid options or missing option arguments are 3788encountered. 3789If the variable <CODE>OPTERR</CODE> 3790is set to 0, no error messages will be displayed, even if the first 3791character of <CODE>optstring</CODE> is not a colon. 3792</P><P> 3793 3794If an invalid option is seen, 3795<CODE>getopts</CODE> places <SAMP>`?'</SAMP> into <VAR>name</VAR> and, if not silent, 3796prints an error message and unsets <CODE>OPTARG</CODE>. 3797If <CODE>getopts</CODE> is silent, the option character found is placed in 3798<CODE>OPTARG</CODE> and no diagnostic message is printed. 3799</P><P> 3800 3801If a required argument is not found, and <CODE>getopts</CODE> 3802is not silent, a question mark (<SAMP>`?'</SAMP>) is placed in <VAR>name</VAR>, 3803<CODE>OPTARG</CODE> is unset, and a diagnostic message is printed. 3804If <CODE>getopts</CODE> is silent, then a colon (<SAMP>`:'</SAMP>) is placed in 3805<VAR>name</VAR> and <CODE>OPTARG</CODE> is set to the option character found. 3806</P><P> 3807 3808<DT><CODE>hash</CODE> 3809<DD><A NAME="IDX78"></A> 3810<TABLE><tr><td> </td><td class=example><pre>hash [-'r] [-p <VAR>filename</VAR>] [-dt] [<VAR>name</VAR>] 3811</pre></td></tr></table>Remember the full pathnames of commands specified as <VAR>name</VAR> arguments, 3812so they need not be searched for on subsequent invocations. 3813The commands are found by searching through the directories listed in 3814<CODE>$PATH</CODE>. 3815The <SAMP>`-p'</SAMP> option inhibits the path search, and <VAR>filename</VAR> is 3816used as the location of <VAR>name</VAR>. 3817The <SAMP>`-r'</SAMP> option causes the shell to forget all remembered locations. 3818The <SAMP>`-d'</SAMP> option causes the shell to forget the remembered location 3819of each <VAR>name</VAR>. 3820If the <SAMP>`-t'</SAMP> option is supplied, the full pathname to which each 3821<VAR>name</VAR> corresponds is printed. If multiple <VAR>name</VAR> arguments are 3822supplied with <SAMP>`-t'</SAMP> the <VAR>name</VAR> is printed before the hashed 3823full pathname. 3824The <SAMP>`-l'</SAMP> option causes output to be displayed in a format 3825that may be reused as input. 3826If no arguments are given, or if only <SAMP>`-l'</SAMP> is supplied, 3827information about remembered commands is printed. 3828The return status is zero unless a <VAR>name</VAR> is not found or an invalid 3829option is supplied. 3830<P> 3831 3832<DT><CODE>pwd</CODE> 3833<DD><A NAME="IDX79"></A> 3834<TABLE><tr><td> </td><td class=example><pre>pwd [-LP] 3835</pre></td></tr></table>Print the absolute pathname of the current working directory. 3836If the <SAMP>`-P'</SAMP> option is supplied, the pathname printed will not 3837contain symbolic links. 3838If the <SAMP>`-L'</SAMP> option is supplied, the pathname printed may contain 3839symbolic links. 3840The return status is zero unless an error is encountered while 3841determining the name of the current directory or an invalid option 3842is supplied. 3843<P> 3844 3845<DT><CODE>readonly</CODE> 3846<DD><A NAME="IDX80"></A> 3847<TABLE><tr><td> </td><td class=example><pre>readonly [-apf] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small> 3848</pre></td></tr></table>Mark each <VAR>name</VAR> as readonly. 3849The values of these names may not be changed by subsequent assignment. 3850If the <SAMP>`-f'</SAMP> option is supplied, each <VAR>name</VAR> refers to a shell 3851function. 3852The <SAMP>`-a'</SAMP> option means each <VAR>name</VAR> refers to an array variable. 3853If no <VAR>name</VAR> arguments are given, or if the <SAMP>`-p'</SAMP> 3854option is supplied, a list of all readonly names is printed. 3855The <SAMP>`-p'</SAMP> option causes output to be displayed in a format that 3856may be reused as input. 3857If a variable name is followed by =<VAR>value</VAR>, the value of 3858the variable is set to <VAR>value</VAR>. 3859The return status is zero unless an invalid option is supplied, one of 3860the <VAR>name</VAR> arguments is not a valid shell variable or function name, 3861or the <SAMP>`-f'</SAMP> option is supplied with a name that is not a shell function. 3862<P> 3863 3864<DT><CODE>return</CODE> 3865<DD><A NAME="IDX81"></A> 3866<TABLE><tr><td> </td><td class=example><pre>return [<VAR>n</VAR>] 3867</pre></td></tr></table>Cause a shell function to exit with the return value <VAR>n</VAR>. 3868If <VAR>n</VAR> is not supplied, the return value is the exit status of the 3869last command executed in the function. 3870This may also be used to terminate execution of a script being executed 3871with the <CODE>.</CODE> (or <CODE>source</CODE>) builtin, returning either <VAR>n</VAR> or 3872the exit status of the last command executed within the script as the exit 3873status of the script. 3874Any command associated with the <CODE>RETURN</CODE> trap is executed 3875before execution resumes after the function or script. 3876The return status is non-zero if <CODE>return</CODE> is used outside a function 3877and not during the execution of a script by <CODE>.</CODE> or <CODE>source</CODE>. 3878<P> 3879 3880<DT><CODE>shift</CODE> 3881<DD><A NAME="IDX82"></A> 3882<TABLE><tr><td> </td><td class=example><pre>shift [<VAR>n</VAR>] 3883</pre></td></tr></table>Shift the positional parameters to the left by <VAR>n</VAR>. 3884The positional parameters from <VAR>n</VAR>+1 <small>...</small> <CODE>$#</CODE> are 3885renamed to <CODE>$1</CODE> <small>...</small> <CODE>$#</CODE>-<VAR>n</VAR>+1. 3886Parameters represented by the numbers <CODE>$#</CODE> to <VAR>n</VAR>+1 are unset. 3887<VAR>n</VAR> must be a non-negative number less than or equal to <CODE>$#</CODE>. 3888If <VAR>n</VAR> is zero or greater than <CODE>$#</CODE>, the positional parameters 3889are not changed. 3890If <VAR>n</VAR> is not supplied, it is assumed to be 1. 3891The return status is zero unless <VAR>n</VAR> is greater than <CODE>$#</CODE> or 3892less than zero, non-zero otherwise. 3893<P> 3894 3895<DT><CODE>test</CODE> 3896<DD><DT><CODE>[</CODE> 3897<DD><A NAME="IDX83"></A> 3898<A NAME="IDX84"></A> 3899Evaluate a conditional expression <VAR>expr</VAR>. 3900Each operator and operand must be a separate argument. 3901Expressions are composed of the primaries described below in 3902<A HREF="bashref.html#SEC78">6.4 Bash Conditional Expressions</A>. 3903<CODE>test</CODE> does not accept any options, nor does it accept and ignore 3904an argument of <SAMP>`--'</SAMP> as signifying the end of options. 3905<P> 3906 3907When the <CODE>[</CODE> form is used, the last argument to the command must 3908be a <CODE>]</CODE>. 3909</P><P> 3910 3911Expressions may be combined using the following operators, listed in 3912decreasing order of precedence. 3913</P><P> 3914 3915<DL COMPACT> 3916<DT><CODE>! <VAR>expr</VAR></CODE> 3917<DD>True if <VAR>expr</VAR> is false. 3918<P> 3919 3920<DT><CODE>( <VAR>expr</VAR> )</CODE> 3921<DD>Returns the value of <VAR>expr</VAR>. 3922This may be used to override the normal precedence of operators. 3923<P> 3924 3925<DT><CODE><VAR>expr1</VAR> -a <VAR>expr2</VAR></CODE> 3926<DD>True if both <VAR>expr1</VAR> and <VAR>expr2</VAR> are true. 3927<P> 3928 3929<DT><CODE><VAR>expr1</VAR> -o <VAR>expr2</VAR></CODE> 3930<DD>True if either <VAR>expr1</VAR> or <VAR>expr2</VAR> is true. 3931</DL> 3932<P> 3933 3934The <CODE>test</CODE> and <CODE>[</CODE> builtins evaluate conditional 3935expressions using a set of rules based on the number of arguments. 3936</P><P> 3937 3938<DL COMPACT> 3939<DT>0 arguments 3940<DD>The expression is false. 3941<P> 3942 3943<DT>1 argument 3944<DD>The expression is true if and only if the argument is not null. 3945<P> 3946 3947<DT>2 arguments 3948<DD>If the first argument is <SAMP>`!'</SAMP>, the expression is true if and 3949only if the second argument is null. 3950If the first argument is one of the unary conditional operators 3951(see section <A HREF="bashref.html#SEC78">6.4 Bash Conditional Expressions</A>), the expression 3952is true if the unary test is true. 3953If the first argument is not a valid unary operator, the expression is 3954false. 3955<P> 3956 3957<DT>3 arguments 3958<DD>If the second argument is one of the binary conditional 3959operators (see section <A HREF="bashref.html#SEC78">6.4 Bash Conditional Expressions</A>), the 3960result of the expression is the result of the binary test using the 3961first and third arguments as operands. 3962If the first argument is <SAMP>`!'</SAMP>, the value is the negation of 3963the two-argument test using the second and third arguments. 3964If the first argument is exactly <SAMP>`('</SAMP> and the third argument is 3965exactly <SAMP>`)'</SAMP>, the result is the one-argument test of the second 3966argument. 3967Otherwise, the expression is false. 3968The <SAMP>`-a'</SAMP> and <SAMP>`-o'</SAMP> operators are considered binary operators 3969in this case. 3970<P> 3971 3972<DT>4 arguments 3973<DD>If the first argument is <SAMP>`!'</SAMP>, the result is the negation of 3974the three-argument expression composed of the remaining arguments. 3975Otherwise, the expression is parsed and evaluated according to 3976precedence using the rules listed above. 3977<P> 3978 3979<DT>5 or more arguments 3980<DD>The expression is parsed and evaluated according to precedence 3981using the rules listed above. 3982</DL> 3983<P> 3984 3985<DT><CODE>times</CODE> 3986<DD><A NAME="IDX85"></A> 3987<TABLE><tr><td> </td><td class=example><pre>times 3988</pre></td></tr></table>Print out the user and system times used by the shell and its children. 3989The return status is zero. 3990<P> 3991 3992<DT><CODE>trap</CODE> 3993<DD><A NAME="IDX86"></A> 3994<TABLE><tr><td> </td><td class=example><pre>trap [-lp] [<VAR>arg</VAR>] [<VAR>sigspec</VAR> <small>...</small>] 3995</pre></td></tr></table>The commands in <VAR>arg</VAR> are to be read and executed when the 3996shell receives signal <VAR>sigspec</VAR>. If <VAR>arg</VAR> is absent (and 3997there is a single <VAR>sigspec</VAR>) or 3998equal to <SAMP>`-'</SAMP>, each specified signal's disposition is reset 3999to the value it had when the shell was started. 4000If <VAR>arg</VAR> is the null string, then the signal specified by 4001each <VAR>sigspec</VAR> is ignored by the shell and commands it invokes. 4002If <VAR>arg</VAR> is not present and <SAMP>`-p'</SAMP> has been supplied, 4003the shell displays the trap commands associated with each <VAR>sigspec</VAR>. 4004If no arguments are supplied, or 4005only <SAMP>`-p'</SAMP> is given, <CODE>trap</CODE> prints the list of commands 4006associated with each signal number in a form that may be reused as 4007shell input. 4008The <SAMP>`-l'</SAMP> option causes the shell to print a list of signal names 4009and their corresponding numbers. 4010Each <VAR>sigspec</VAR> is either a signal name or a signal number. 4011Signal names are case insensitive and the <CODE>SIG</CODE> prefix is optional. 4012If a <VAR>sigspec</VAR> 4013is <CODE>0</CODE> or <CODE>EXIT</CODE>, <VAR>arg</VAR> is executed when the shell exits. 4014If a <VAR>sigspec</VAR> is <CODE>DEBUG</CODE>, the command <VAR>arg</VAR> is executed 4015before every simple command, <CODE>for</CODE> command, <CODE>case</CODE> command, 4016<CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before 4017the first command executes in a shell function. 4018Refer to the description of the <CODE>extglob</CODE> option to the 4019<CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>) for details of its 4020effect on the <CODE>DEBUG</CODE> trap. 4021If a <VAR>sigspec</VAR> is <CODE>ERR</CODE>, the command <VAR>arg</VAR> 4022is executed whenever a simple command has a non-zero exit status, 4023subject to the following conditions. 4024The <CODE>ERR</CODE> trap is not executed if the failed command is part of the 4025command list immediately following an <CODE>until</CODE> or <CODE>while</CODE> keyword, 4026part of the test in an <CODE>if</CODE> statement, 4027part of a <CODE>&&</CODE> or <CODE>||</CODE> list, or if the command's return 4028status is being inverted using <CODE>!</CODE>. 4029These are the same conditions obeyed by the <CODE>errexit</CODE> option. 4030If a <VAR>sigspec</VAR> is <CODE>RETURN</CODE>, the command <VAR>arg</VAR> is executed 4031each time a shell function or a script executed with the <CODE>.</CODE> or 4032<CODE>source</CODE> builtins finishes executing. 4033<P> 4034 4035Signals ignored upon entry to the shell cannot be trapped or reset. 4036Trapped signals are reset to their original values in a child 4037process when it is created. 4038</P><P> 4039 4040The return status is zero unless a <VAR>sigspec</VAR> does not specify a 4041valid signal. 4042</P><P> 4043 4044<DT><CODE>umask</CODE> 4045<DD><A NAME="IDX87"></A> 4046<TABLE><tr><td> </td><td class=example><pre>umask [-p] [-S] [<VAR>mode</VAR>] 4047</pre></td></tr></table>Set the shell process's file creation mask to <VAR>mode</VAR>. If 4048<VAR>mode</VAR> begins with a digit, it is interpreted as an octal number; 4049if not, it is interpreted as a symbolic mode mask similar 4050to that accepted by the <CODE>chmod</CODE> command. If <VAR>mode</VAR> is 4051omitted, the current value of the mask is printed. If the <SAMP>`-S'</SAMP> 4052option is supplied without a <VAR>mode</VAR> argument, the mask is printed 4053in a symbolic format. 4054If the <SAMP>`-p'</SAMP> option is supplied, and <VAR>mode</VAR> 4055is omitted, the output is in a form that may be reused as input. 4056The return status is zero if the mode is successfully changed or if 4057no <VAR>mode</VAR> argument is supplied, and non-zero otherwise. 4058<P> 4059 4060Note that when the mode is interpreted as an octal number, each number 4061of the umask is subtracted from <CODE>7</CODE>. Thus, a umask of <CODE>022</CODE> 4062results in permissions of <CODE>755</CODE>. 4063</P><P> 4064 4065<DT><CODE>unset</CODE> 4066<DD><A NAME="IDX88"></A> 4067<TABLE><tr><td> </td><td class=example><pre>unset [-fv] [<VAR>name</VAR>] 4068</pre></td></tr></table>Each variable or function <VAR>name</VAR> is removed. 4069If no options are supplied, or the <SAMP>`-v'</SAMP> option is given, each 4070<VAR>name</VAR> refers to a shell variable. 4071If the <SAMP>`-f'</SAMP> option is given, the <VAR>name</VAR>s refer to shell 4072functions, and the function definition is removed. 4073Readonly variables and functions may not be unset. 4074The return status is zero unless a <VAR>name</VAR> is readonly. 4075</DL> 4076<P> 4077 4078<A NAME="Bash Builtins"></A> 4079<HR SIZE="6"> 4080<A NAME="SEC58"></A> 4081<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 4082<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> < </A>]</TD> 4083<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> > </A>]</TD> 4084<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> << </A>]</TD> 4085<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> Up </A>]</TD> 4086<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> >> </A>]</TD> 4087<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 4088<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 4089<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 4090<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 4091</TR></TABLE> 4092<H2> 4.2 Bash Builtin Commands </H2> 4093<!--docid::SEC58::--> 4094<P> 4095 4096This section describes builtin commands which are unique to 4097or have been extended in Bash. 4098Some of these commands are specified in the POSIX 1003.2 standard. 4099</P><P> 4100 4101<DL COMPACT> 4102 4103<DT><CODE>alias</CODE> 4104<DD><A NAME="IDX89"></A> 4105<TABLE><tr><td> </td><td class=example><pre>alias [<CODE>-p</CODE>] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>] 4106</pre></td></tr></table><P> 4107 4108Without arguments or with the <SAMP>`-p'</SAMP> option, <CODE>alias</CODE> prints 4109the list of aliases on the standard output in a form that allows 4110them to be reused as input. 4111If arguments are supplied, an alias is defined for each <VAR>name</VAR> 4112whose <VAR>value</VAR> is given. If no <VAR>value</VAR> is given, the name 4113and value of the alias is printed. 4114Aliases are described in <A HREF="bashref.html#SEC80">6.6 Aliases</A>. 4115</P><P> 4116 4117<DT><CODE>bind</CODE> 4118<DD><A NAME="IDX90"></A> 4119<TABLE><tr><td> </td><td class=example><pre>bind [-m <VAR>keymap</VAR>] [-lpsvPSV] 4120bind [-m <VAR>keymap</VAR>] [-q <VAR>function</VAR>] [-u <VAR>function</VAR>] [-r <VAR>keyseq</VAR>] 4121bind [-m <VAR>keymap</VAR>] -f <VAR>filename</VAR> 4122bind [-m <VAR>keymap</VAR>] -x <VAR>keyseq:shell-command</VAR> 4123bind [-m <VAR>keymap</VAR>] <VAR>keyseq:function-name</VAR> 4124bind <VAR>readline-command</VAR> 4125</pre></td></tr></table><P> 4126 4127Display current Readline (see section <A HREF="bashref.html#SEC91">8. Command Line Editing</A>) 4128key and function bindings, 4129bind a key sequence to a Readline function or macro, 4130or set a Readline variable. 4131Each non-option argument is a command as it would appear in a 4132a Readline initialization file (see section <A HREF="bashref.html#SEC99">8.3 Readline Init File</A>), 4133but each binding or command must be passed as a separate argument; e.g., 4134<SAMP>`"\C-x\C-r":re-read-init-file'</SAMP>. 4135Options, if supplied, have the following meanings: 4136</P><P> 4137 4138<DL COMPACT> 4139<DT><CODE>-m <VAR>keymap</VAR></CODE> 4140<DD>Use <VAR>keymap</VAR> as the keymap to be affected by 4141the subsequent bindings. Acceptable <VAR>keymap</VAR> 4142names are 4143<CODE>emacs</CODE>, 4144<CODE>emacs-standard</CODE>, 4145<CODE>emacs-meta</CODE>, 4146<CODE>emacs-ctlx</CODE>, 4147<CODE>vi</CODE>, 4148<CODE>vi-move</CODE>, 4149<CODE>vi-command</CODE>, and 4150<CODE>vi-insert</CODE>. 4151<CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>; 4152<CODE>emacs</CODE> is equivalent to <CODE>emacs-standard</CODE>. 4153<P> 4154 4155<DT><CODE>-l</CODE> 4156<DD>List the names of all Readline functions. 4157<P> 4158 4159<DT><CODE>-p</CODE> 4160<DD>Display Readline function names and bindings in such a way that they 4161can be used as input or in a Readline initialization file. 4162<P> 4163 4164<DT><CODE>-P</CODE> 4165<DD>List current Readline function names and bindings. 4166<P> 4167 4168<DT><CODE>-v</CODE> 4169<DD>Display Readline variable names and values in such a way that they 4170can be used as input or in a Readline initialization file. 4171<P> 4172 4173<DT><CODE>-V</CODE> 4174<DD>List current Readline variable names and values. 4175<P> 4176 4177<DT><CODE>-s</CODE> 4178<DD>Display Readline key sequences bound to macros and the strings they output 4179in such a way that they can be used as input or in a Readline 4180initialization file. 4181<P> 4182 4183<DT><CODE>-S</CODE> 4184<DD>Display Readline key sequences bound to macros and the strings they output. 4185<P> 4186 4187<DT><CODE>-f <VAR>filename</VAR></CODE> 4188<DD>Read key bindings from <VAR>filename</VAR>. 4189<P> 4190 4191<DT><CODE>-q <VAR>function</VAR></CODE> 4192<DD>Query about which keys invoke the named <VAR>function</VAR>. 4193<P> 4194 4195<DT><CODE>-u <VAR>function</VAR></CODE> 4196<DD>Unbind all keys bound to the named <VAR>function</VAR>. 4197<P> 4198 4199<DT><CODE>-r <VAR>keyseq</VAR></CODE> 4200<DD>Remove any current binding for <VAR>keyseq</VAR>. 4201<P> 4202 4203<DT><CODE>-x <VAR>keyseq:shell-command</VAR></CODE> 4204<DD>Cause <VAR>shell-command</VAR> to be executed whenever <VAR>keyseq</VAR> is 4205entered. 4206<P> 4207 4208</DL> 4209<P> 4210 4211The return status is zero unless an invalid option is supplied or an 4212error occurs. 4213</P><P> 4214 4215<DT><CODE>builtin</CODE> 4216<DD><A NAME="IDX91"></A> 4217<TABLE><tr><td> </td><td class=example><pre>builtin [<VAR>shell-builtin</VAR> [<VAR>args</VAR>]] 4218</pre></td></tr></table>Run a shell builtin, passing it <VAR>args</VAR>, and return its exit status. 4219This is useful when defining a shell function with the same 4220name as a shell builtin, retaining the functionality of the builtin within 4221the function. 4222The return status is non-zero if <VAR>shell-builtin</VAR> is not a shell 4223builtin command. 4224<P> 4225 4226<DT><CODE>caller</CODE> 4227<DD><A NAME="IDX92"></A> 4228<TABLE><tr><td> </td><td class=example><pre>caller [<VAR>expr</VAR>] 4229</pre></td></tr></table>Returns the context of any active subroutine call (a shell function or 4230a script executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins). 4231<P> 4232 4233Without <VAR>expr</VAR>, <CODE>caller</CODE> displays the line number and source 4234filename of the current subroutine call. 4235If a non-negative integer is supplied as <VAR>expr</VAR>, <CODE>caller</CODE> 4236displays the line number, subroutine name, and source file corresponding 4237to that position in the current execution call stack. This extra 4238information may be used, for example, to print a stack trace. The 4239current frame is frame 0. 4240</P><P> 4241 4242The return value is 0 unless the shell is not executing a subroutine 4243call or <VAR>expr</VAR> does not correspond to a valid position in the 4244call stack. 4245</P><P> 4246 4247<DT><CODE>command</CODE> 4248<DD><A NAME="IDX93"></A> 4249<TABLE><tr><td> </td><td class=example><pre>command [-pVv] <VAR>command</VAR> [<VAR>arguments</VAR> <small>...</small>] 4250</pre></td></tr></table>Runs <VAR>command</VAR> with <VAR>arguments</VAR> ignoring any shell function 4251named <VAR>command</VAR>. 4252Only shell builtin commands or commands found by searching the 4253<CODE>PATH</CODE> are executed. 4254If there is a shell function named <CODE>ls</CODE>, running <SAMP>`command ls'</SAMP> 4255within the function will execute the external command <CODE>ls</CODE> 4256instead of calling the function recursively. 4257The <SAMP>`-p'</SAMP> option means to use a default value for <CODE>PATH</CODE> 4258that is guaranteed to find all of the standard utilities. 4259The return status in this case is 127 if <VAR>command</VAR> cannot be 4260found or an error occurred, and the exit status of <VAR>command</VAR> 4261otherwise. 4262<P> 4263 4264If either the <SAMP>`-V'</SAMP> or <SAMP>`-v'</SAMP> option is supplied, a 4265description of <VAR>command</VAR> is printed. The <SAMP>`-v'</SAMP> option 4266causes a single word indicating the command or file name used to 4267invoke <VAR>command</VAR> to be displayed; the <SAMP>`-V'</SAMP> option produces 4268a more verbose description. In this case, the return status is 4269zero if <VAR>command</VAR> is found, and non-zero if not. 4270</P><P> 4271 4272<DT><CODE>declare</CODE> 4273<DD><A NAME="IDX94"></A> 4274<TABLE><tr><td> </td><td class=example><pre>declare [-afFirtx] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>] 4275</pre></td></tr></table><P> 4276 4277Declare variables and give them attributes. If no <VAR>name</VAR>s 4278are given, then display the values of variables instead. 4279</P><P> 4280 4281The <SAMP>`-p'</SAMP> option will display the attributes and values of each 4282<VAR>name</VAR>. 4283When <SAMP>`-p'</SAMP> is used, additional options are ignored. 4284The <SAMP>`-F'</SAMP> option inhibits the display of function definitions; 4285only the function name and attributes are printed. 4286If the <CODE>extdebug</CODE> shell option is enabled using <CODE>shopt</CODE> 4287(see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>), the source file name and line number where 4288the function is defined are displayed as well. 4289<SAMP>`-F'</SAMP> implies <SAMP>`-f'</SAMP>. 4290The following options can be used to restrict output to variables with 4291the specified attributes or to give variables attributes: 4292</P><P> 4293 4294<DL COMPACT> 4295<DT><CODE>-a</CODE> 4296<DD>Each <VAR>name</VAR> is an array variable (see section <A HREF="bashref.html#SEC81">6.7 Arrays</A>). 4297<P> 4298 4299<DT><CODE>-f</CODE> 4300<DD>Use function names only. 4301<P> 4302 4303<DT><CODE>-i</CODE> 4304<DD>The variable is to be treated as 4305an integer; arithmetic evaluation (see section <A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A>) is 4306performed when the variable is assigned a value. 4307<P> 4308 4309<DT><CODE>-r</CODE> 4310<DD>Make <VAR>name</VAR>s readonly. These names cannot then be assigned values 4311by subsequent assignment statements or unset. 4312<P> 4313 4314<DT><CODE>-t</CODE> 4315<DD>Give each <VAR>name</VAR> the <CODE>trace</CODE> attribute. 4316Traced functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps from 4317the calling shell. 4318The trace attribute has no special meaning for variables. 4319<P> 4320 4321<DT><CODE>-x</CODE> 4322<DD>Mark each <VAR>name</VAR> for export to subsequent commands via 4323the environment. 4324</DL> 4325<P> 4326 4327Using <SAMP>`+'</SAMP> instead of <SAMP>`-'</SAMP> turns off the attribute instead. 4328When used in a function, <CODE>declare</CODE> makes each <VAR>name</VAR> local, 4329as with the <CODE>local</CODE> command. If a variable name is followed by 4330=<VAR>value</VAR>, the value of the variable is set to <VAR>value</VAR>. 4331</P><P> 4332 4333The return status is zero unless an invalid option is encountered, 4334an attempt is made to define a function using <SAMP>`-f foo=bar'</SAMP>, 4335an attempt is made to assign a value to a readonly variable, 4336an attempt is made to assign a value to an array variable without 4337using the compound assignment syntax (see section <A HREF="bashref.html#SEC81">6.7 Arrays</A>), 4338one of the <VAR>names</VAR> is not a valid shell variable name, 4339an attempt is made to turn off readonly status for a readonly variable, 4340an attempt is made to turn off array status for an array variable, 4341or an attempt is made to display a non-existent function with <SAMP>`-f'</SAMP>. 4342</P><P> 4343 4344<DT><CODE>echo</CODE> 4345<DD><A NAME="IDX95"></A> 4346<TABLE><tr><td> </td><td class=example><pre>echo [-neE] [<VAR>arg</VAR> <small>...</small>] 4347</pre></td></tr></table>Output the <VAR>arg</VAR>s, separated by spaces, terminated with a 4348newline. 4349The return status is always 0. 4350If <SAMP>`-n'</SAMP> is specified, the trailing newline is suppressed. 4351If the <SAMP>`-e'</SAMP> option is given, interpretation of the following 4352backslash-escaped characters is enabled. 4353The <SAMP>`-E'</SAMP> option disables the interpretation of these escape characters, 4354even on systems where they are interpreted by default. 4355The <CODE>xpg_echo</CODE> shell option may be used to 4356dynamically determine whether or not <CODE>echo</CODE> expands these 4357escape characters by default. 4358<CODE>echo</CODE> does not interpret <SAMP>`--'</SAMP> to mean the end of options. 4359<P> 4360 4361<CODE>echo</CODE> interprets the following escape sequences: 4362<DL COMPACT> 4363<DT><CODE>\a</CODE> 4364<DD>alert (bell) 4365<DT><CODE>\b</CODE> 4366<DD>backspace 4367<DT><CODE>\c</CODE> 4368<DD>suppress trailing newline 4369<DT><CODE>\e</CODE> 4370<DD>escape 4371<DT><CODE>\f</CODE> 4372<DD>form feed 4373<DT><CODE>\n</CODE> 4374<DD>new line 4375<DT><CODE>\r</CODE> 4376<DD>carriage return 4377<DT><CODE>\t</CODE> 4378<DD>horizontal tab 4379<DT><CODE>\v</CODE> 4380<DD>vertical tab 4381<DT><CODE>\\</CODE> 4382<DD>backslash 4383<DT><CODE>\0<VAR>nnn</VAR></CODE> 4384<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR> 4385(zero to three octal digits) 4386<DT><CODE>\<VAR>nnn</VAR></CODE> 4387<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR> 4388(one to three octal digits) 4389<DT><CODE>\x<VAR>HH</VAR></CODE> 4390<DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR> 4391(one or two hex digits) 4392</DL> 4393<P> 4394 4395<DT><CODE>enable</CODE> 4396<DD><A NAME="IDX96"></A> 4397<TABLE><tr><td> </td><td class=example><pre>enable [-n] [-p] [-f <VAR>filename</VAR>] [-ads] [<VAR>name</VAR> <small>...</small>] 4398</pre></td></tr></table>Enable and disable builtin shell commands. 4399Disabling a builtin allows a disk command which has the same name 4400as a shell builtin to be executed without specifying a full pathname, 4401even though the shell normally searches for builtins before disk commands. 4402If <SAMP>`-n'</SAMP> is used, the <VAR>name</VAR>s become disabled. Otherwise 4403<VAR>name</VAR>s are enabled. For example, to use the <CODE>test</CODE> binary 4404found via <CODE>$PATH</CODE> instead of the shell builtin version, type 4405<SAMP>`enable -n test'</SAMP>. 4406<P> 4407 4408If the <SAMP>`-p'</SAMP> option is supplied, or no <VAR>name</VAR> arguments appear, 4409a list of shell builtins is printed. With no other arguments, the list 4410consists of all enabled shell builtins. 4411The <SAMP>`-a'</SAMP> option means to list 4412each builtin with an indication of whether or not it is enabled. 4413</P><P> 4414 4415The <SAMP>`-f'</SAMP> option means to load the new builtin command <VAR>name</VAR> 4416from shared object <VAR>filename</VAR>, on systems that support dynamic loading. 4417The <SAMP>`-d'</SAMP> option will delete a builtin loaded with <SAMP>`-f'</SAMP>. 4418</P><P> 4419 4420If there are no options, a list of the shell builtins is displayed. 4421The <SAMP>`-s'</SAMP> option restricts <CODE>enable</CODE> to the POSIX special 4422builtins. If <SAMP>`-s'</SAMP> is used with <SAMP>`-f'</SAMP>, the new builtin becomes 4423a special builtin (see section <A HREF="bashref.html#SEC60">4.4 Special Builtins</A>). 4424</P><P> 4425 4426The return status is zero unless a <VAR>name</VAR> is not a shell builtin 4427or there is an error loading a new builtin from a shared object. 4428</P><P> 4429 4430<DT><CODE>help</CODE> 4431<DD><A NAME="IDX97"></A> 4432<TABLE><tr><td> </td><td class=example><pre>help [-s] [<VAR>pattern</VAR>] 4433</pre></td></tr></table>Display helpful information about builtin commands. 4434If <VAR>pattern</VAR> is specified, <CODE>help</CODE> gives detailed help 4435on all commands matching <VAR>pattern</VAR>, otherwise a list of 4436the builtins is printed. 4437The <SAMP>`-s'</SAMP> option restricts the information displayed to a short 4438usage synopsis. 4439The return status is zero unless no command matches <VAR>pattern</VAR>. 4440<P> 4441 4442<DT><CODE>let</CODE> 4443<DD><A NAME="IDX98"></A> 4444<TABLE><tr><td> </td><td class=example><pre>let <VAR>expression</VAR> [<VAR>expression</VAR>] 4445</pre></td></tr></table>The <CODE>let</CODE> builtin allows arithmetic to be performed on shell 4446variables. Each <VAR>expression</VAR> is evaluated according to the 4447rules given below in <A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A>. If the 4448last <VAR>expression</VAR> evaluates to 0, <CODE>let</CODE> returns 1; 4449otherwise 0 is returned. 4450<P> 4451 4452<DT><CODE>local</CODE> 4453<DD><A NAME="IDX99"></A> 4454<TABLE><tr><td> </td><td class=example><pre>local [<VAR>option</VAR>] <VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small> 4455</pre></td></tr></table>For each argument, a local variable named <VAR>name</VAR> is created, 4456and assigned <VAR>value</VAR>. 4457The <VAR>option</VAR> can be any of the options accepted by <CODE>declare</CODE>. 4458<CODE>local</CODE> can only be used within a function; it makes the variable 4459<VAR>name</VAR> have a visible scope restricted to that function and its 4460children. The return status is zero unless <CODE>local</CODE> is used outside 4461a function, an invalid <VAR>name</VAR> is supplied, or <VAR>name</VAR> is a 4462readonly variable. 4463<P> 4464 4465<DT><CODE>logout</CODE> 4466<DD><A NAME="IDX100"></A> 4467<TABLE><tr><td> </td><td class=example><pre>logout [<VAR>n</VAR>] 4468</pre></td></tr></table>Exit a login shell, returning a status of <VAR>n</VAR> to the shell's 4469parent. 4470<P> 4471 4472<DT><CODE>printf</CODE> 4473<DD><A NAME="IDX101"></A> 4474<TABLE><tr><td> </td><td class=example><pre><CODE>printf</CODE> [-v <VAR>var</VAR>] <VAR>format</VAR> [<VAR>arguments</VAR>] 4475</pre></td></tr></table>Write the formatted <VAR>arguments</VAR> to the standard output under the 4476control of the <VAR>format</VAR>. 4477The <VAR>format</VAR> is a character string which contains three types of objects: 4478plain characters, which are simply copied to standard output, character 4479escape sequences, which are converted and copied to the standard output, and 4480format specifications, each of which causes printing of the next successive 4481<VAR>argument</VAR>. 4482In addition to the standard <CODE>printf(1)</CODE> formats, <SAMP>`%b'</SAMP> causes 4483<CODE>printf</CODE> to expand backslash escape sequences in the corresponding 4484<VAR>argument</VAR>, 4485(except that <SAMP>`\c'</SAMP> terminates output, backslashes in 4486<SAMP>`\''</SAMP>, <SAMP>`\"'</SAMP>, and <SAMP>`\?'</SAMP> are not removed, and octal escapes 4487beginning with <SAMP>`\0'</SAMP> may contain up to four digits), 4488and <SAMP>`%q'</SAMP> causes <CODE>printf</CODE> to output the 4489corresponding <VAR>argument</VAR> in a format that can be reused as shell input. 4490<P> 4491 4492The <SAMP>`-v'</SAMP> option causes the output to be assigned to the variable 4493<VAR>var</VAR> rather than being printed to the standard output. 4494</P><P> 4495 4496The <VAR>format</VAR> is reused as necessary to consume all of the <VAR>arguments</VAR>. 4497If the <VAR>format</VAR> requires more <VAR>arguments</VAR> than are supplied, the 4498extra format specifications behave as if a zero value or null string, as 4499appropriate, had been supplied. The return value is zero on success, 4500non-zero on failure. 4501</P><P> 4502 4503<DT><CODE>read</CODE> 4504<DD><A NAME="IDX102"></A> 4505<TABLE><tr><td> </td><td class=example><pre>read [-ers] [-a <VAR>aname</VAR>] [-d <VAR>delim</VAR>] [-n <VAR>nchars</VAR>] [-p <VAR>prompt</VAR>] [-t <VAR>timeout</VAR>] [-u <VAR>fd</VAR>] [<VAR>name</VAR> <small>...</small>] 4506</pre></td></tr></table>One line is read from the standard input, or from the file descriptor 4507<VAR>fd</VAR> supplied as an argument to the <SAMP>`-u'</SAMP> option, and the first word 4508is assigned to the first <VAR>name</VAR>, the second word to the second <VAR>name</VAR>, 4509and so on, with leftover words and their intervening separators assigned 4510to the last <VAR>name</VAR>. 4511If there are fewer words read from the input stream than names, 4512the remaining names are assigned empty values. 4513The characters in the value of the <CODE>IFS</CODE> variable 4514are used to split the line into words. 4515The backslash character <SAMP>`\'</SAMP> may be used to remove any special 4516meaning for the next character read and for line continuation. 4517If no names are supplied, the line read is assigned to the 4518variable <CODE>REPLY</CODE>. 4519The return code is zero, unless end-of-file is encountered, <CODE>read</CODE> 4520times out, or an invalid file descriptor is supplied as the argument to 4521<SAMP>`-u'</SAMP>. 4522Options, if supplied, have the following meanings: 4523<P> 4524 4525<DL COMPACT> 4526<DT><CODE>-a <VAR>aname</VAR></CODE> 4527<DD>The words are assigned to sequential indices of the array variable 4528<VAR>aname</VAR>, starting at 0. 4529All elements are removed from <VAR>aname</VAR> before the assignment. 4530Other <VAR>name</VAR> arguments are ignored. 4531<P> 4532 4533<DT><CODE>-d <VAR>delim</VAR></CODE> 4534<DD>The first character of <VAR>delim</VAR> is used to terminate the input line, 4535rather than newline. 4536<P> 4537 4538<DT><CODE>-e</CODE> 4539<DD>Readline (see section <A HREF="bashref.html#SEC91">8. Command Line Editing</A>) is used to obtain the line. 4540<P> 4541 4542<DT><CODE>-n <VAR>nchars</VAR></CODE> 4543<DD><CODE>read</CODE> returns after reading <VAR>nchars</VAR> characters rather than 4544waiting for a complete line of input. 4545<P> 4546 4547<DT><CODE>-p <VAR>prompt</VAR></CODE> 4548<DD>Display <VAR>prompt</VAR>, without a trailing newline, before attempting 4549to read any input. 4550The prompt is displayed only if input is coming from a terminal. 4551<P> 4552 4553<DT><CODE>-r</CODE> 4554<DD>If this option is given, backslash does not act as an escape character. 4555The backslash is considered to be part of the line. 4556In particular, a backslash-newline pair may not be used as a line 4557continuation. 4558<P> 4559 4560<DT><CODE>-s</CODE> 4561<DD>Silent mode. If input is coming from a terminal, characters are 4562not echoed. 4563<P> 4564 4565<DT><CODE>-t <VAR>timeout</VAR></CODE> 4566<DD>Cause <CODE>read</CODE> to time out and return failure if a complete line of 4567input is not read within <VAR>timeout</VAR> seconds. 4568This option has no effect if <CODE>read</CODE> is not reading input from the 4569terminal or a pipe. 4570<P> 4571 4572<DT><CODE>-u <VAR>fd</VAR></CODE> 4573<DD>Read input from file descriptor <VAR>fd</VAR>. 4574<P> 4575 4576</DL> 4577<P> 4578 4579<DT><CODE>shopt</CODE> 4580<DD><A NAME="IDX103"></A> 4581<TABLE><tr><td> </td><td class=example><pre>shopt [-pqsu] [-o] [<VAR>optname</VAR> <small>...</small>] 4582</pre></td></tr></table>Toggle the values of variables controlling optional shell behavior. 4583With no options, or with the <SAMP>`-p'</SAMP> option, a list of all settable 4584options is displayed, with an indication of whether or not each is set. 4585The <SAMP>`-p'</SAMP> option causes output to be displayed in a form that 4586may be reused as input. 4587Other options have the following meanings: 4588<P> 4589 4590<DL COMPACT> 4591<DT><CODE>-s</CODE> 4592<DD>Enable (set) each <VAR>optname</VAR>. 4593<P> 4594 4595<DT><CODE>-u</CODE> 4596<DD>Disable (unset) each <VAR>optname</VAR>. 4597<P> 4598 4599<DT><CODE>-q</CODE> 4600<DD>Suppresses normal output; the return status 4601indicates whether the <VAR>optname</VAR> is set or unset. 4602If multiple <VAR>optname</VAR> arguments are given with <SAMP>`-q'</SAMP>, 4603the return status is zero if all <VAR>optnames</VAR> are enabled; 4604non-zero otherwise. 4605<P> 4606 4607<DT><CODE>-o</CODE> 4608<DD>Restricts the values of 4609<VAR>optname</VAR> to be those defined for the <SAMP>`-o'</SAMP> option to the 4610<CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 4611</DL> 4612<P> 4613 4614If either <SAMP>`-s'</SAMP> or <SAMP>`-u'</SAMP> 4615is used with no <VAR>optname</VAR> arguments, the display is limited to 4616those options which are set or unset, respectively. 4617</P><P> 4618 4619Unless otherwise noted, the <CODE>shopt</CODE> options are disabled (off) 4620by default. 4621</P><P> 4622 4623The return status when listing options is zero if all <VAR>optnames</VAR> 4624are enabled, non-zero otherwise. When setting or unsetting options, 4625the return status is zero unless an <VAR>optname</VAR> is not a valid shell 4626option. 4627</P><P> 4628 4629The list of <CODE>shopt</CODE> options is: 4630<DL COMPACT> 4631<DT><CODE>cdable_vars</CODE> 4632<DD>If this is set, an argument to the <CODE>cd</CODE> 4633builtin command that 4634is not a directory is assumed to be the name of a variable whose 4635value is the directory to change to. 4636<P> 4637 4638<DT><CODE>cdspell</CODE> 4639<DD>If set, minor errors in the spelling of a directory component in a 4640<CODE>cd</CODE> command will be corrected. 4641The errors checked for are transposed characters, 4642a missing character, and a character too many. 4643If a correction is found, the corrected path is printed, 4644and the command proceeds. 4645This option is only used by interactive shells. 4646<P> 4647 4648<DT><CODE>checkhash</CODE> 4649<DD>If this is set, Bash checks that a command found in the hash 4650table exists before trying to execute it. If a hashed command no 4651longer exists, a normal path search is performed. 4652<P> 4653 4654<DT><CODE>checkwinsize</CODE> 4655<DD>If set, Bash checks the window size after each command 4656and, if necessary, updates the values of 4657<CODE>LINES</CODE> and <CODE>COLUMNS</CODE>. 4658<P> 4659 4660<DT><CODE>cmdhist</CODE> 4661<DD>If set, Bash 4662attempts to save all lines of a multiple-line 4663command in the same history entry. This allows 4664easy re-editing of multi-line commands. 4665<P> 4666 4667<DT><CODE>dotglob</CODE> 4668<DD>If set, Bash includes filenames beginning with a `.' in 4669the results of filename expansion. 4670<P> 4671 4672<DT><CODE>execfail</CODE> 4673<DD>If this is set, a non-interactive shell will not exit if 4674it cannot execute the file specified as an argument to the <CODE>exec</CODE> 4675builtin command. An interactive shell does not exit if <CODE>exec</CODE> 4676fails. 4677<P> 4678 4679<DT><CODE>expand_aliases</CODE> 4680<DD>If set, aliases are expanded as described below under Aliases, 4681<A HREF="bashref.html#SEC80">6.6 Aliases</A>. 4682This option is enabled by default for interactive shells. 4683<P> 4684 4685<DT><CODE>extdebug</CODE> 4686<DD>If set, behavior intended for use by debuggers is enabled: 4687<P> 4688 4689<OL> 4690<LI> 4691The <SAMP>`-F'</SAMP> option to the <CODE>declare</CODE> builtin (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>) 4692displays the source file name and line number corresponding to each function 4693name supplied as an argument. 4694<P> 4695 4696<LI> 4697If the command run by the <CODE>DEBUG</CODE> trap returns a non-zero value, the 4698next command is skipped and not executed. 4699<P> 4700 4701<LI> 4702If the command run by the <CODE>DEBUG</CODE> trap returns a value of 2, and the 4703shell is executing in a subroutine (a shell function or a shell script 4704executed by the <CODE>.</CODE> or <CODE>source</CODE> builtins), a call to 4705<CODE>return</CODE> is simulated. 4706<P> 4707 4708<LI> 4709<CODE>BASH_ARGC</CODE> and <CODE>BASH_ARGV</CODE> are updated as described in their 4710descriptions (see section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>). 4711<P> 4712 4713<LI> 4714Function tracing is enabled: command substitution, shell functions, and 4715subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the 4716<CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps. 4717<P> 4718 4719<LI> 4720Error tracing is enabled: command substitution, shell functions, and 4721subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the 4722<CODE>ERROR</CODE> trap. 4723</OL> 4724<P> 4725 4726<DT><CODE>extglob</CODE> 4727<DD>If set, the extended pattern matching features described above 4728(see section <A HREF="bashref.html#SEC36">3.5.8.1 Pattern Matching</A>) are enabled. 4729<P> 4730 4731<DT><CODE>extquote</CODE> 4732<DD>If set, <CODE>$'<VAR>string</VAR>'</CODE> and <CODE>$"<VAR>string</VAR>"</CODE> quoting is 4733performed within <CODE>${<VAR>parameter</VAR>}</CODE> expansions 4734enclosed in double quotes. This option is enabled by default. 4735<P> 4736 4737<DT><CODE>failglob</CODE> 4738<DD>If set, patterns which fail to match filenames during pathname expansion 4739result in an expansion error. 4740<P> 4741 4742<DT><CODE>force_fignore</CODE> 4743<DD>If set, the suffixes specified by the <CODE>FIGNORE</CODE> shell variable 4744cause words to be ignored when performing word completion even if 4745the ignored words are the only possible completions. 4746See section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>. 4747This option is enabled by default. 4748<P> 4749 4750<DT><CODE>gnu_errfmt</CODE> 4751<DD>If set, shell error messages are written in the standard GNU error 4752message format. 4753<P> 4754 4755<DT><CODE>histappend</CODE> 4756<DD>If set, the history list is appended to the file named by the value 4757of the <CODE>HISTFILE</CODE> 4758variable when the shell exits, rather than overwriting the file. 4759<P> 4760 4761<DT><CODE>histreedit</CODE> 4762<DD>If set, and Readline 4763is being used, a user is given the opportunity to re-edit a 4764failed history substitution. 4765<P> 4766 4767<DT><CODE>histverify</CODE> 4768<DD>If set, and Readline 4769is being used, the results of history substitution are not immediately 4770passed to the shell parser. Instead, the resulting line is loaded into 4771the Readline editing buffer, allowing further modification. 4772<P> 4773 4774<DT><CODE>hostcomplete</CODE> 4775<DD>If set, and Readline is being used, Bash will attempt to perform 4776hostname completion when a word containing a <SAMP>`@'</SAMP> is being 4777completed (see section <A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A>). This option is enabled 4778by default. 4779<P> 4780 4781<DT><CODE>huponexit</CODE> 4782<DD>If set, Bash will send <CODE>SIGHUP</CODE> to all jobs when an interactive 4783login shell exits (see section <A HREF="bashref.html#SEC54">3.7.6 Signals</A>). 4784<P> 4785 4786<DT><CODE>interactive_comments</CODE> 4787<DD>Allow a word beginning with <SAMP>`#'</SAMP> 4788to cause that word and all remaining characters on that 4789line to be ignored in an interactive shell. 4790This option is enabled by default. 4791<P> 4792 4793<DT><CODE>lithist</CODE> 4794<DD>If enabled, and the <CODE>cmdhist</CODE> 4795option is enabled, multi-line commands are saved to the history with 4796embedded newlines rather than using semicolon separators where possible. 4797<P> 4798 4799<DT><CODE>login_shell</CODE> 4800<DD>The shell sets this option if it is started as a login shell 4801(see section <A HREF="bashref.html#SEC65">6.1 Invoking Bash</A>). 4802The value may not be changed. 4803<P> 4804 4805<DT><CODE>mailwarn</CODE> 4806<DD>If set, and a file that Bash is checking for mail has been 4807accessed since the last time it was checked, the message 4808<CODE>"The mail in <VAR>mailfile</VAR> has been read"</CODE> is displayed. 4809<P> 4810 4811<DT><CODE>no_empty_cmd_completion</CODE> 4812<DD>If set, and Readline is being used, Bash will not attempt to search 4813the <CODE>PATH</CODE> for possible completions when completion is attempted 4814on an empty line. 4815<P> 4816 4817<DT><CODE>nocaseglob</CODE> 4818<DD>If set, Bash matches filenames in a case-insensitive fashion when 4819performing filename expansion. 4820<P> 4821 4822<DT><CODE>nocasematch</CODE> 4823<DD>If set, Bash matches patterns in a case-insensitive fashion when 4824performing matching while executing <CODE>case</CODE> or <CODE>[[</CODE> 4825conditional commands. 4826<P> 4827 4828<DT><CODE>nullglob</CODE> 4829<DD>If set, Bash allows filename patterns which match no 4830files to expand to a null string, rather than themselves. 4831<P> 4832 4833<DT><CODE>progcomp</CODE> 4834<DD>If set, the programmable completion facilities 4835(see section <A HREF="bashref.html#SEC113">8.6 Programmable Completion</A>) are enabled. 4836This option is enabled by default. 4837<P> 4838 4839<DT><CODE>promptvars</CODE> 4840<DD>If set, prompt strings undergo 4841parameter expansion, command substitution, arithmetic 4842expansion, and quote removal after being expanded 4843as described below (see section <A HREF="bashref.html#SEC84">6.9 Controlling the Prompt</A>). 4844This option is enabled by default. 4845<P> 4846 4847<DT><CODE>restricted_shell</CODE> 4848<DD>The shell sets this option if it is started in restricted mode 4849(see section <A HREF="bashref.html#SEC85">6.10 The Restricted Shell</A>). 4850The value may not be changed. 4851This is not reset when the startup files are executed, allowing 4852the startup files to discover whether or not a shell is restricted. 4853<P> 4854 4855<DT><CODE>shift_verbose</CODE> 4856<DD>If this is set, the <CODE>shift</CODE> 4857builtin prints an error message when the shift count exceeds the 4858number of positional parameters. 4859<P> 4860 4861<DT><CODE>sourcepath</CODE> 4862<DD>If set, the <CODE>source</CODE> builtin uses the value of <CODE>PATH</CODE> 4863to find the directory containing the file supplied as an argument. 4864This option is enabled by default. 4865<P> 4866 4867<DT><CODE>xpg_echo</CODE> 4868<DD>If set, the <CODE>echo</CODE> builtin expands backslash-escape sequences 4869by default. 4870<P> 4871 4872</DL> 4873<P> 4874 4875The return status when listing options is zero if all <VAR>optnames</VAR> 4876are enabled, non-zero otherwise. 4877When setting or unsetting options, the return status is zero unless an 4878<VAR>optname</VAR> is not a valid shell option. 4879</P><P> 4880 4881<DT><CODE>source</CODE> 4882<DD><A NAME="IDX104"></A> 4883<TABLE><tr><td> </td><td class=example><pre>source <VAR>filename</VAR> 4884</pre></td></tr></table>A synonym for <CODE>.</CODE> (see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>). 4885<P> 4886 4887<DT><CODE>type</CODE> 4888<DD><A NAME="IDX105"></A> 4889<TABLE><tr><td> </td><td class=example><pre>type [-afptP] [<VAR>name</VAR> <small>...</small>] 4890</pre></td></tr></table>For each <VAR>name</VAR>, indicate how it would be interpreted if used as a 4891command name. 4892<P> 4893 4894If the <SAMP>`-t'</SAMP> option is used, <CODE>type</CODE> prints a single word 4895which is one of <SAMP>`alias'</SAMP>, <SAMP>`function'</SAMP>, <SAMP>`builtin'</SAMP>, 4896<SAMP>`file'</SAMP> or <SAMP>`keyword'</SAMP>, 4897if <VAR>name</VAR> is an alias, shell function, shell builtin, 4898disk file, or shell reserved word, respectively. 4899If the <VAR>name</VAR> is not found, then nothing is printed, and 4900<CODE>type</CODE> returns a failure status. 4901</P><P> 4902 4903If the <SAMP>`-p'</SAMP> option is used, <CODE>type</CODE> either returns the name 4904of the disk file that would be executed, or nothing if <SAMP>`-t'</SAMP> 4905would not return <SAMP>`file'</SAMP>. 4906</P><P> 4907 4908The <SAMP>`-P'</SAMP> option forces a path search for each <VAR>name</VAR>, even if 4909<SAMP>`-t'</SAMP> would not return <SAMP>`file'</SAMP>. 4910</P><P> 4911 4912If a command is hashed, <SAMP>`-p'</SAMP> and <SAMP>`-P'</SAMP> print the hashed value, 4913not necessarily the file that appears first in <CODE>$PATH</CODE>. 4914</P><P> 4915 4916If the <SAMP>`-a'</SAMP> option is used, <CODE>type</CODE> returns all of the places 4917that contain an executable named <VAR>file</VAR>. 4918This includes aliases and functions, if and only if the <SAMP>`-p'</SAMP> option 4919is not also used. 4920</P><P> 4921 4922If the <SAMP>`-f'</SAMP> option is used, <CODE>type</CODE> does not attempt to find 4923shell functions, as with the <CODE>command</CODE> builtin. 4924</P><P> 4925 4926The return status is zero if any of the <VAR>names</VAR> are found, non-zero 4927if none are found. 4928</P><P> 4929 4930<DT><CODE>typeset</CODE> 4931<DD><A NAME="IDX106"></A> 4932<TABLE><tr><td> </td><td class=example><pre>typeset [-afFrxi] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>] 4933</pre></td></tr></table>The <CODE>typeset</CODE> command is supplied for compatibility with the Korn 4934shell; however, it has been deprecated in favor of the <CODE>declare</CODE> 4935builtin command. 4936<P> 4937 4938<DT><CODE>ulimit</CODE> 4939<DD><A NAME="IDX107"></A> 4940<TABLE><tr><td> </td><td class=example><pre>ulimit [-acdflmnpstuvSH] [<VAR>limit</VAR>] 4941</pre></td></tr></table><CODE>ulimit</CODE> provides control over the resources available to processes 4942started by the shell, on systems that allow such control. If an 4943option is given, it is interpreted as follows: 4944<DL COMPACT> 4945<DT><CODE>-S</CODE> 4946<DD>Change and report the soft limit associated with a resource. 4947<P> 4948 4949<DT><CODE>-H</CODE> 4950<DD>Change and report the hard limit associated with a resource. 4951<P> 4952 4953<DT><CODE>-a</CODE> 4954<DD>All current limits are reported. 4955<P> 4956 4957<DT><CODE>-c</CODE> 4958<DD>The maximum size of core files created. 4959<P> 4960 4961<DT><CODE>-d</CODE> 4962<DD>The maximum size of a process's data segment. 4963<P> 4964 4965<DT><CODE>-f</CODE> 4966<DD>The maximum size of files created by the shell. 4967<P> 4968 4969<DT><CODE>-l</CODE> 4970<DD>The maximum size that may be locked into memory. 4971<P> 4972 4973<DT><CODE>-m</CODE> 4974<DD>The maximum resident set size. 4975<P> 4976 4977<DT><CODE>-n</CODE> 4978<DD>The maximum number of open file descriptors. 4979<P> 4980 4981<DT><CODE>-p</CODE> 4982<DD>The pipe buffer size. 4983<P> 4984 4985<DT><CODE>-s</CODE> 4986<DD>The maximum stack size. 4987<P> 4988 4989<DT><CODE>-t</CODE> 4990<DD>The maximum amount of cpu time in seconds. 4991<P> 4992 4993<DT><CODE>-u</CODE> 4994<DD>The maximum number of processes available to a single user. 4995<P> 4996 4997<DT><CODE>-v</CODE> 4998<DD>The maximum amount of virtual memory available to the process. 4999<P> 5000 5001</DL> 5002<P> 5003 5004If <VAR>limit</VAR> is given, it is the new value of the specified resource; 5005the special <VAR>limit</VAR> values <CODE>hard</CODE>, <CODE>soft</CODE>, and 5006<CODE>unlimited</CODE> stand for the current hard limit, the current soft limit, 5007and no limit, respectively. 5008Otherwise, the current value of the soft limit for the specified resource 5009is printed, unless the <SAMP>`-H'</SAMP> option is supplied. 5010When setting new limits, if neither <SAMP>`-H'</SAMP> nor <SAMP>`-S'</SAMP> is supplied, 5011both the hard and soft limits are set. 5012If no option is given, then <SAMP>`-f'</SAMP> is assumed. Values are in 1024-byte 5013increments, except for <SAMP>`-t'</SAMP>, which is in seconds, <SAMP>`-p'</SAMP>, 5014which is in units of 512-byte blocks, and <SAMP>`-n'</SAMP> and <SAMP>`-u'</SAMP>, which 5015are unscaled values. 5016</P><P> 5017 5018The return status is zero unless an invalid option or argument is supplied, 5019or an error occurs while setting a new limit. 5020</P><P> 5021 5022<DT><CODE>unalias</CODE> 5023<DD><A NAME="IDX108"></A> 5024<TABLE><tr><td> </td><td class=example><pre>unalias [-a] [<VAR>name</VAR> <small>...</small> ] 5025</pre></td></tr></table><P> 5026 5027Remove each <VAR>name</VAR> from the list of aliases. If <SAMP>`-a'</SAMP> is 5028supplied, all aliases are removed. 5029Aliases are described in <A HREF="bashref.html#SEC80">6.6 Aliases</A>. 5030</P><P> 5031 5032</DL> 5033<P> 5034 5035<A NAME="The Set Builtin"></A> 5036<HR SIZE="6"> 5037<A NAME="SEC59"></A> 5038<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 5039<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> < </A>]</TD> 5040<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> > </A>]</TD> 5041<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> << </A>]</TD> 5042<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> Up </A>]</TD> 5043<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> >> </A>]</TD> 5044<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 5045<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 5046<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 5047<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 5048</TR></TABLE> 5049<H2> 4.3 The Set Builtin </H2> 5050<!--docid::SEC59::--> 5051<P> 5052 5053This builtin is so complicated that it deserves its own section. 5054</P><P> 5055 5056<DL COMPACT> 5057<DT><CODE>set</CODE> 5058<DD><A NAME="IDX109"></A> 5059<TABLE><tr><td> </td><td class=example><pre>set [--abefhkmnptuvxBCHP] [-o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>] 5060</pre></td></tr></table><P> 5061 5062If no options or arguments are supplied, <CODE>set</CODE> displays the names 5063and values of all shell variables and functions, sorted according to the 5064current locale, in a format that may be reused as input 5065for setting or resetting the currently-set variables. 5066Read-only variables cannot be reset. 5067In POSIX mode, only shell variables are listed. 5068</P><P> 5069 5070When options are supplied, they set or unset shell attributes. 5071Options, if specified, have the following meanings: 5072</P><P> 5073 5074<DL COMPACT> 5075<DT><CODE>-a</CODE> 5076<DD>Mark variables and function which are modified or created for export 5077to the environment of subsequent commands. 5078<P> 5079 5080<DT><CODE>-b</CODE> 5081<DD>Cause the status of terminated background jobs to be reported 5082immediately, rather than before printing the next primary prompt. 5083<P> 5084 5085<DT><CODE>-e</CODE> 5086<DD>Exit immediately if a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>) exits 5087with a non-zero status, unless the command that fails is part of the 5088command list immediately following a <CODE>while</CODE> or <CODE>until</CODE> 5089keyword, part of the test in an <CODE>if</CODE> statement, 5090part of a <CODE>&&</CODE> or <CODE>||</CODE> list, or if the command's return 5091status is being inverted using <CODE>!</CODE>. 5092A trap on <CODE>ERR</CODE>, if set, is executed before the shell exits. 5093<P> 5094 5095<DT><CODE>-f</CODE> 5096<DD>Disable file name generation (globbing). 5097<P> 5098 5099<DT><CODE>-h</CODE> 5100<DD>Locate and remember (hash) commands as they are looked up for execution. 5101This option is enabled by default. 5102<P> 5103 5104<DT><CODE>-k</CODE> 5105<DD>All arguments in the form of assignment statements are placed 5106in the environment for a command, not just those that precede 5107the command name. 5108<P> 5109 5110<DT><CODE>-m</CODE> 5111<DD>Job control is enabled (see section <A HREF="bashref.html#SEC87">7. Job Control</A>). 5112<P> 5113 5114<DT><CODE>-n</CODE> 5115<DD>Read commands but do not execute them; this may be used to check a 5116script for syntax errors. 5117This option is ignored by interactive shells. 5118<P> 5119 5120<DT><CODE>-o <VAR>option-name</VAR></CODE> 5121<DD><P> 5122 5123Set the option corresponding to <VAR>option-name</VAR>: 5124</P><P> 5125 5126<DL COMPACT> 5127<DT><CODE>allexport</CODE> 5128<DD>Same as <CODE>-a</CODE>. 5129<P> 5130 5131<DT><CODE>braceexpand</CODE> 5132<DD>Same as <CODE>-B</CODE>. 5133<P> 5134 5135<DT><CODE>emacs</CODE> 5136<DD>Use an <CODE>emacs</CODE>-style line editing interface (see section <A HREF="bashref.html#SEC91">8. Command Line Editing</A>). 5137<P> 5138 5139<DT><CODE>errexit</CODE> 5140<DD>Same as <CODE>-e</CODE>. 5141<P> 5142 5143<DT><CODE>errtrace</CODE> 5144<DD>Same as <CODE>-E</CODE>. 5145<P> 5146 5147<DT><CODE>functrace</CODE> 5148<DD>Same as <CODE>-T</CODE>. 5149<P> 5150 5151<DT><CODE>hashall</CODE> 5152<DD>Same as <CODE>-h</CODE>. 5153<P> 5154 5155<DT><CODE>histexpand</CODE> 5156<DD>Same as <CODE>-H</CODE>. 5157<P> 5158 5159<DT><CODE>history</CODE> 5160<DD>Enable command history, as described in <A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A>. 5161This option is on by default in interactive shells. 5162<P> 5163 5164<DT><CODE>ignoreeof</CODE> 5165<DD>An interactive shell will not exit upon reading EOF. 5166<P> 5167 5168<DT><CODE>keyword</CODE> 5169<DD>Same as <CODE>-k</CODE>. 5170<P> 5171 5172<DT><CODE>monitor</CODE> 5173<DD>Same as <CODE>-m</CODE>. 5174<P> 5175 5176<DT><CODE>noclobber</CODE> 5177<DD>Same as <CODE>-C</CODE>. 5178<P> 5179 5180<DT><CODE>noexec</CODE> 5181<DD>Same as <CODE>-n</CODE>. 5182<P> 5183 5184<DT><CODE>noglob</CODE> 5185<DD>Same as <CODE>-f</CODE>. 5186<P> 5187 5188<DT><CODE>nolog</CODE> 5189<DD>Currently ignored. 5190<P> 5191 5192<DT><CODE>notify</CODE> 5193<DD>Same as <CODE>-b</CODE>. 5194<P> 5195 5196<DT><CODE>nounset</CODE> 5197<DD>Same as <CODE>-u</CODE>. 5198<P> 5199 5200<DT><CODE>onecmd</CODE> 5201<DD>Same as <CODE>-t</CODE>. 5202<P> 5203 5204<DT><CODE>physical</CODE> 5205<DD>Same as <CODE>-P</CODE>. 5206<P> 5207 5208<DT><CODE>pipefail</CODE> 5209<DD>If set, the return value of a pipeline is the value of the last 5210(rightmost) command to exit with a non-zero status, or zero if all 5211commands in the pipeline exit successfully. 5212This option is disabled by default. 5213<P> 5214 5215<DT><CODE>posix</CODE> 5216<DD>Change the behavior of Bash where the default operation differs 5217from the POSIX 1003.2 standard to match the standard 5218(see section <A HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A>). 5219This is intended to make Bash behave as a strict superset of that 5220standard. 5221<P> 5222 5223<DT><CODE>privileged</CODE> 5224<DD>Same as <CODE>-p</CODE>. 5225<P> 5226 5227<DT><CODE>verbose</CODE> 5228<DD>Same as <CODE>-v</CODE>. 5229<P> 5230 5231<DT><CODE>vi</CODE> 5232<DD>Use a <CODE>vi</CODE>-style line editing interface. 5233<P> 5234 5235<DT><CODE>xtrace</CODE> 5236<DD>Same as <CODE>-x</CODE>. 5237</DL> 5238<P> 5239 5240<DT><CODE>-p</CODE> 5241<DD>Turn on privileged mode. 5242In this mode, the <CODE>$BASH_ENV</CODE> and <CODE>$ENV</CODE> files are not 5243processed, shell functions are not inherited from the environment, 5244and the <CODE>SHELLOPTS</CODE> variable, if it appears in the environment, 5245is ignored. 5246If the shell is started with the effective user (group) id not equal to the 5247real user (group) id, and the <CODE>-p</CODE> option is not supplied, these actions 5248are taken and the effective user id is set to the real user id. 5249If the <CODE>-p</CODE> option is supplied at startup, the effective user id is 5250not reset. 5251Turning this option off causes the effective user 5252and group ids to be set to the real user and group ids. 5253<P> 5254 5255<DT><CODE>-t</CODE> 5256<DD>Exit after reading and executing one command. 5257<P> 5258 5259<DT><CODE>-u</CODE> 5260<DD>Treat unset variables as an error when performing parameter expansion. 5261An error message will be written to the standard error, and a non-interactive 5262shell will exit. 5263<P> 5264 5265<DT><CODE>-v</CODE> 5266<DD>Print shell input lines as they are read. 5267<P> 5268 5269<DT><CODE>-x</CODE> 5270<DD>Print a trace of simple commands, \fBfor\fP commands, \fBcase\fP 5271commands, \fBselect\fP commands, and arithmetic \fBfor\fP commands 5272and their arguments or associated word lists after they are 5273expanded and before they are executed. The value of the <CODE>PS4</CODE> 5274variable is expanded and the resultant value is printed before 5275the command and its expanded arguments. 5276<P> 5277 5278<DT><CODE>-B</CODE> 5279<DD>The shell will perform brace expansion (see section <A HREF="bashref.html#SEC28">3.5.1 Brace Expansion</A>). 5280This option is on by default. 5281<P> 5282 5283<DT><CODE>-C</CODE> 5284<DD>Prevent output redirection using <SAMP>`>'</SAMP>, <SAMP>`>&'</SAMP>, and <SAMP>`<>'</SAMP> 5285from overwriting existing files. 5286<P> 5287 5288<DT><CODE>-E</CODE> 5289<DD>If set, any trap on <CODE>ERR</CODE> is inherited by shell functions, command 5290substitutions, and commands executed in a subshell environment. 5291The <CODE>ERR</CODE> trap is normally not inherited in such cases. 5292<P> 5293 5294<DT><CODE>-H</CODE> 5295<DD>Enable <SAMP>`!'</SAMP> style history substitution (see section <A HREF="bashref.html#SEC118">9.3 History Expansion</A>). 5296This option is on by default for interactive shells. 5297<P> 5298 5299<DT><CODE>-P</CODE> 5300<DD>If set, do not follow symbolic links when performing commands such as 5301<CODE>cd</CODE> which change the current directory. The physical directory 5302is used instead. By default, Bash follows 5303the logical chain of directories when performing commands 5304which change the current directory. 5305<P> 5306 5307For example, if <TT>`/usr/sys'</TT> is a symbolic link to <TT>`/usr/local/sys'</TT> 5308then: 5309<TABLE><tr><td> </td><td class=example><pre>$ cd /usr/sys; echo $PWD 5310/usr/sys 5311$ cd ..; pwd 5312/usr 5313</pre></td></tr></table></P><P> 5314 5315If <CODE>set -P</CODE> is on, then: 5316<TABLE><tr><td> </td><td class=example><pre>$ cd /usr/sys; echo $PWD 5317/usr/local/sys 5318$ cd ..; pwd 5319/usr/local 5320</pre></td></tr></table></P><P> 5321 5322<DT><CODE>-T</CODE> 5323<DD>If set, any trap on <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> are inherited by 5324shell functions, command substitutions, and commands executed 5325in a subshell environment. 5326The <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps are normally not inherited 5327in such cases. 5328<P> 5329 5330<DT><CODE>--</CODE> 5331<DD>If no arguments follow this option, then the positional parameters are 5332unset. Otherwise, the positional parameters are set to the 5333<VAR>arguments</VAR>, even if some of them begin with a <SAMP>`-'</SAMP>. 5334<P> 5335 5336<DT><CODE>-</CODE> 5337<DD>Signal the end of options, cause all remaining <VAR>arguments</VAR> 5338to be assigned to the positional parameters. The <SAMP>`-x'</SAMP> 5339and <SAMP>`-v'</SAMP> options are turned off. 5340If there are no arguments, the positional parameters remain unchanged. 5341</DL> 5342<P> 5343 5344Using <SAMP>`+'</SAMP> rather than <SAMP>`-'</SAMP> causes these options to be 5345turned off. The options can also be used upon invocation of the 5346shell. The current set of options may be found in <CODE>$-</CODE>. 5347</P><P> 5348 5349The remaining N <VAR>arguments</VAR> are positional parameters and are 5350assigned, in order, to <CODE>$1</CODE>, <CODE>$2</CODE>, <small>...</small> <CODE>$N</CODE>. 5351The special parameter <CODE>#</CODE> is set to N. 5352</P><P> 5353 5354The return status is always zero unless an invalid option is supplied. 5355</DL> 5356<P> 5357 5358<A NAME="Special Builtins"></A> 5359<HR SIZE="6"> 5360<A NAME="SEC60"></A> 5361<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 5362<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> < </A>]</TD> 5363<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> > </A>]</TD> 5364<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> << </A>]</TD> 5365<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> Up </A>]</TD> 5366<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> >> </A>]</TD> 5367<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 5368<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 5369<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 5370<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 5371</TR></TABLE> 5372<H2> 4.4 Special Builtins </H2> 5373<!--docid::SEC60::--> 5374<P> 5375 5376For historical reasons, the POSIX 1003.2 standard has classified 5377several builtin commands as <EM>special</EM>. 5378When Bash is executing in POSIX mode, the special builtins 5379differ from other builtin commands in three respects: 5380</P><P> 5381 5382<OL> 5383<LI> 5384Special builtins are found before shell functions during command lookup. 5385<P> 5386 5387<LI> 5388If a special builtin returns an error status, a non-interactive shell exits. 5389<P> 5390 5391<LI> 5392Assignment statements preceding the command stay in effect in the shell 5393environment after the command completes. 5394</OL> 5395<P> 5396 5397When Bash is not executing in POSIX mode, these builtins behave no 5398differently than the rest of the Bash builtin commands. 5399The Bash POSIX mode is described in <A HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A>. 5400</P><P> 5401 5402These are the POSIX special builtins: 5403<TABLE><tr><td> </td><td class=example><pre>break : . continue eval exec exit export readonly return set 5404shift trap unset 5405</pre></td></tr></table></P><P> 5406 5407<A NAME="Shell Variables"></A> 5408<HR SIZE="6"> 5409<A NAME="SEC61"></A> 5410<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 5411<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> < </A>]</TD> 5412<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> > </A>]</TD> 5413<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD> 5414<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 5415<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD> 5416<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 5417<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 5418<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 5419<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 5420</TR></TABLE> 5421<H1> 5. Shell Variables </H1> 5422<!--docid::SEC61::--> 5423<P> 5424 5425<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 5426<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables which Bash uses in the same way 5427 as the Bourne Shell.</TD></TR> 5428<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">List of variables that exist in Bash.</TD></TR> 5429</TABLE></BLOCKQUOTE> 5430<P> 5431 5432This chapter describes the shell variables that Bash uses. 5433Bash automatically assigns default values to a number of variables. 5434</P><P> 5435 5436<A NAME="Bourne Shell Variables"></A> 5437<HR SIZE="6"> 5438<A NAME="SEC62"></A> 5439<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 5440<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> < </A>]</TD> 5441<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> > </A>]</TD> 5442<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> << </A>]</TD> 5443<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD> 5444<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD> 5445<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 5446<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 5447<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 5448<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 5449</TR></TABLE> 5450<H2> 5.1 Bourne Shell Variables </H2> 5451<!--docid::SEC62::--> 5452<P> 5453 5454Bash uses certain shell variables in the same way as the Bourne shell. 5455In some cases, Bash assigns a default value to the variable. 5456</P><P> 5457 5458<DL COMPACT> 5459 5460<A NAME="IDX110"></A> 5461<DT><CODE>CDPATH</CODE> 5462<DD><A NAME="IDX111"></A> 5463A colon-separated list of directories used as a search path for 5464the <CODE>cd</CODE> builtin command. 5465<P> 5466 5467<A NAME="IDX112"></A> 5468<DT><CODE>HOME</CODE> 5469<DD><A NAME="IDX113"></A> 5470The current user's home directory; the default for the <CODE>cd</CODE> builtin 5471command. 5472The value of this variable is also used by tilde expansion 5473(see section <A HREF="bashref.html#SEC29">3.5.2 Tilde Expansion</A>). 5474<P> 5475 5476<A NAME="IDX114"></A> 5477<DT><CODE>IFS</CODE> 5478<DD><A NAME="IDX115"></A> 5479A list of characters that separate fields; used when the shell splits 5480words as part of expansion. 5481<P> 5482 5483<A NAME="IDX116"></A> 5484<DT><CODE>MAIL</CODE> 5485<DD><A NAME="IDX117"></A> 5486If this parameter is set to a filename and the <CODE>MAILPATH</CODE> variable 5487is not set, Bash informs the user of the arrival of mail in 5488the specified file. 5489<P> 5490 5491<A NAME="IDX118"></A> 5492<DT><CODE>MAILPATH</CODE> 5493<DD><A NAME="IDX119"></A> 5494A colon-separated list of filenames which the shell periodically checks 5495for new mail. 5496Each list entry can specify the message that is printed when new mail 5497arrives in the mail file by separating the file name from the message with 5498a <SAMP>`?'</SAMP>. 5499When used in the text of the message, <CODE>$_</CODE> expands to the name of 5500the current mail file. 5501<P> 5502 5503<A NAME="IDX120"></A> 5504<DT><CODE>OPTARG</CODE> 5505<DD><A NAME="IDX121"></A> 5506The value of the last option argument processed by the <CODE>getopts</CODE> builtin. 5507<P> 5508 5509<A NAME="IDX122"></A> 5510<DT><CODE>OPTIND</CODE> 5511<DD><A NAME="IDX123"></A> 5512The index of the last option argument processed by the <CODE>getopts</CODE> builtin. 5513<P> 5514 5515<A NAME="IDX124"></A> 5516<DT><CODE>PATH</CODE> 5517<DD><A NAME="IDX125"></A> 5518A colon-separated list of directories in which the shell looks for 5519commands. 5520A zero-length (null) directory name in the value of <CODE>PATH</CODE> indicates the 5521current directory. 5522A null directory name may appear as two adjacent colons, or as an initial 5523or trailing colon. 5524<P> 5525 5526<A NAME="IDX126"></A> 5527<DT><CODE>PS1</CODE> 5528<DD><A NAME="IDX127"></A> 5529The primary prompt string. The default value is <SAMP>`\s-\v\$ '</SAMP>. 5530See section <A HREF="bashref.html#SEC84">6.9 Controlling the Prompt</A>, for the complete list of escape 5531sequences that are expanded before <CODE>PS1</CODE> is displayed. 5532<P> 5533 5534<A NAME="IDX128"></A> 5535<DT><CODE>PS2</CODE> 5536<DD><A NAME="IDX129"></A> 5537The secondary prompt string. The default value is <SAMP>`> '</SAMP>. 5538<P> 5539 5540</DL> 5541<P> 5542 5543<A NAME="Bash Variables"></A> 5544<HR SIZE="6"> 5545<A NAME="SEC63"></A> 5546<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 5547<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> < </A>]</TD> 5548<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> > </A>]</TD> 5549<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> << </A>]</TD> 5550<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD> 5551<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD> 5552<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 5553<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 5554<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 5555<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 5556</TR></TABLE> 5557<H2> 5.2 Bash Variables </H2> 5558<!--docid::SEC63::--> 5559<P> 5560 5561These variables are set or used by Bash, but other shells 5562do not normally treat them specially. 5563</P><P> 5564 5565A few variables used by Bash are described in different chapters: 5566variables for controlling the job control facilities 5567(see section <A HREF="bashref.html#SEC90">7.3 Job Control Variables</A>). 5568</P><P> 5569 5570<DL COMPACT> 5571 5572<A NAME="IDX130"></A> 5573<DT><CODE>BASH</CODE> 5574<DD><A NAME="IDX131"></A> 5575The full pathname used to execute the current instance of Bash. 5576<P> 5577 5578<A NAME="IDX132"></A> 5579<DT><CODE>BASH_ARGC</CODE> 5580<DD><A NAME="IDX133"></A> 5581An array variable whose values are the number of parameters in each 5582frame of the current bash execution call stack. The number of 5583parameters to the current subroutine (shell function or script executed 5584with <CODE>.</CODE> or <CODE>source</CODE>) is at the top of the stack. When a 5585subroutine is executed, the number of parameters passed is pushed onto 5586<CODE>BASH_ARGC</CODE>. 5587The shell sets <CODE>BASH_ARGC</CODE> only when in extended debugging mode 5588(see <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A> 5589for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE> 5590builtin). 5591<P> 5592 5593<A NAME="IDX134"></A> 5594<DT><CODE>BASH_ARGV</CODE> 5595<DD><A NAME="IDX135"></A> 5596An array variable containing all of the parameters in the current bash 5597execution call stack. The final parameter of the last subroutine call 5598is at the top of the stack; the first parameter of the initial call is 5599at the bottom. When a subroutine is executed, the parameters supplied 5600are pushed onto <CODE>BASH_ARGV</CODE>. 5601The shell sets <CODE>BASH_ARGV</CODE> only when in extended debugging mode 5602(see <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A> 5603for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE> 5604builtin). 5605<P> 5606 5607<A NAME="IDX136"></A> 5608<DT><CODE>BASH_COMMAND</CODE> 5609<DD><A NAME="IDX137"></A> 5610The command currently being executed or about to be executed, unless the 5611shell is executing a command as the result of a trap, 5612in which case it is the command executing at the time of the trap. 5613<P> 5614 5615<A NAME="IDX138"></A> 5616<DT><CODE>BASH_ENV</CODE> 5617<DD><A NAME="IDX139"></A> 5618If this variable is set when Bash is invoked to execute a shell 5619script, its value is expanded and used as the name of a startup file 5620to read before executing the script. See section <A HREF="bashref.html#SEC66">6.2 Bash Startup Files</A>. 5621<P> 5622 5623<A NAME="IDX140"></A> 5624<DT><CODE>BASH_EXECUTION_STRING</CODE> 5625<DD><A NAME="IDX141"></A> 5626The command argument to the <SAMP>`-c'</SAMP> invocation option. 5627<P> 5628 5629<A NAME="IDX142"></A> 5630<DT><CODE>BASH_LINENO</CODE> 5631<DD><A NAME="IDX143"></A> 5632An array variable whose members are the line numbers in source files 5633corresponding to each member of <VAR>FUNCNAME</VAR>. 5634<CODE>${BASH_LINENO[$i]}</CODE> is the line number in the source file where 5635<CODE>${FUNCNAME[$i]}</CODE> was called. 5636The corresponding source file name is <CODE>${BASH_SOURCE[$i]}</CODE>. 5637Use <CODE>LINENO</CODE> to obtain the current line number. 5638<P> 5639 5640<A NAME="IDX144"></A> 5641<DT><CODE>BASH_REMATCH</CODE> 5642<DD><A NAME="IDX145"></A> 5643An array variable whose members are assigned by the <SAMP>`=~'</SAMP> binary 5644operator to the <CODE>[[</CODE> conditional command 5645(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). 5646The element with index 0 is the portion of the string 5647matching the entire regular expression. 5648The element with index <VAR>n</VAR> is the portion of the 5649string matching the <VAR>n</VAR>th parenthesized subexpression. 5650This variable is read-only. 5651<P> 5652 5653<A NAME="IDX146"></A> 5654<DT><CODE>BASH_SOURCE</CODE> 5655<DD><A NAME="IDX147"></A> 5656An array variable whose members are the source filenames corresponding 5657to the elements in the <CODE>FUNCNAME</CODE> array variable. 5658<P> 5659 5660<A NAME="IDX148"></A> 5661<DT><CODE>BASH_SUBSHELL</CODE> 5662<DD><A NAME="IDX149"></A> 5663Incremented by one each time a subshell or subshell environment is spawned. 5664The initial value is 0. 5665<P> 5666 5667<A NAME="IDX150"></A> 5668<DT><CODE>BASH_VERSINFO</CODE> 5669<DD><A NAME="IDX151"></A> 5670A readonly array variable (see section <A HREF="bashref.html#SEC81">6.7 Arrays</A>) 5671whose members hold version information for this instance of Bash. 5672The values assigned to the array members are as follows: 5673<P> 5674 5675<DL COMPACT> 5676 5677<DT><CODE>BASH_VERSINFO[0]</CODE> 5678<DD>The major version number (the <VAR>release</VAR>). 5679<P> 5680 5681<DT><CODE>BASH_VERSINFO[1]</CODE> 5682<DD>The minor version number (the <VAR>version</VAR>). 5683<P> 5684 5685<DT><CODE>BASH_VERSINFO[2]</CODE> 5686<DD>The patch level. 5687<P> 5688 5689<DT><CODE>BASH_VERSINFO[3]</CODE> 5690<DD>The build version. 5691<P> 5692 5693<DT><CODE>BASH_VERSINFO[4]</CODE> 5694<DD>The release status (e.g., <VAR>beta1</VAR>). 5695<P> 5696 5697<DT><CODE>BASH_VERSINFO[5]</CODE> 5698<DD>The value of <CODE>MACHTYPE</CODE>. 5699<P> 5700 5701</DL> 5702<P> 5703 5704<A NAME="IDX152"></A> 5705<DT><CODE>BASH_VERSION</CODE> 5706<DD><A NAME="IDX153"></A> 5707The version number of the current instance of Bash. 5708<P> 5709 5710<A NAME="IDX154"></A> 5711<DT><CODE>COLUMNS</CODE> 5712<DD><A NAME="IDX155"></A> 5713Used by the <CODE>select</CODE> builtin command to determine the terminal width 5714when printing selection lists. Automatically set upon receipt of a 5715<CODE>SIGWINCH</CODE>. 5716<P> 5717 5718<A NAME="IDX156"></A> 5719<DT><CODE>COMP_CWORD</CODE> 5720<DD><A NAME="IDX157"></A> 5721An index into <CODE>${COMP_WORDS}</CODE> of the word containing the current 5722cursor position. 5723This variable is available only in shell functions invoked by the 5724programmable completion facilities (see section <A HREF="bashref.html#SEC113">8.6 Programmable Completion</A>). 5725<P> 5726 5727<A NAME="IDX158"></A> 5728<DT><CODE>COMP_LINE</CODE> 5729<DD><A NAME="IDX159"></A> 5730The current command line. 5731This variable is available only in shell functions and external 5732commands invoked by the 5733programmable completion facilities (see section <A HREF="bashref.html#SEC113">8.6 Programmable Completion</A>). 5734<P> 5735 5736<A NAME="IDX160"></A> 5737<DT><CODE>COMP_POINT</CODE> 5738<DD><A NAME="IDX161"></A> 5739The index of the current cursor position relative to the beginning of 5740the current command. 5741If the current cursor position is at the end of the current command, 5742the value of this variable is equal to <CODE>${#COMP_LINE}</CODE>. 5743This variable is available only in shell functions and external 5744commands invoked by the 5745programmable completion facilities (see section <A HREF="bashref.html#SEC113">8.6 Programmable Completion</A>). 5746<P> 5747 5748<A NAME="IDX162"></A> 5749<DT><CODE>COMP_WORDBREAKS</CODE> 5750<DD><A NAME="IDX163"></A> 5751The set of characters that the Readline library treats as word 5752separators when performing word completion. 5753If <CODE>COMP_WORDBREAKS</CODE> is unset, it loses its special properties, 5754even if it is subsequently reset. 5755<P> 5756 5757<A NAME="IDX164"></A> 5758<DT><CODE>COMP_WORDS</CODE> 5759<DD><A NAME="IDX165"></A> 5760An array variable consisting of the individual 5761words in the current command line. 5762This variable is available only in shell functions invoked by the 5763programmable completion facilities (see section <A HREF="bashref.html#SEC113">8.6 Programmable Completion</A>). 5764<P> 5765 5766<A NAME="IDX166"></A> 5767<DT><CODE>COMPREPLY</CODE> 5768<DD><A NAME="IDX167"></A> 5769An array variable from which Bash reads the possible completions 5770generated by a shell function invoked by the programmable completion 5771facility (see section <A HREF="bashref.html#SEC113">8.6 Programmable Completion</A>). 5772<P> 5773 5774<A NAME="IDX168"></A> 5775<DT><CODE>DIRSTACK</CODE> 5776<DD><A NAME="IDX169"></A> 5777An array variable containing the current contents of the directory stack. 5778Directories appear in the stack in the order they are displayed by the 5779<CODE>dirs</CODE> builtin. 5780Assigning to members of this array variable may be used to modify 5781directories already in the stack, but the <CODE>pushd</CODE> and <CODE>popd</CODE> 5782builtins must be used to add and remove directories. 5783Assignment to this variable will not change the current directory. 5784If <CODE>DIRSTACK</CODE> is unset, it loses its special properties, even if 5785it is subsequently reset. 5786<P> 5787 5788<A NAME="IDX170"></A> 5789<DT><CODE>EMACS</CODE> 5790<DD><A NAME="IDX171"></A> 5791If Bash finds this variable in the environment when the shell 5792starts with value <SAMP>`t'</SAMP>, it assumes that the shell is running in an 5793emacs shell buffer and disables line editing. 5794<P> 5795 5796<A NAME="IDX172"></A> 5797<DT><CODE>EUID</CODE> 5798<DD><A NAME="IDX173"></A> 5799The numeric effective user id of the current user. This variable 5800is readonly. 5801<P> 5802 5803<A NAME="IDX174"></A> 5804<DT><CODE>FCEDIT</CODE> 5805<DD><A NAME="IDX175"></A> 5806The editor used as a default by the <SAMP>`-e'</SAMP> option to the <CODE>fc</CODE> 5807builtin command. 5808<P> 5809 5810<A NAME="IDX176"></A> 5811<DT><CODE>FIGNORE</CODE> 5812<DD><A NAME="IDX177"></A> 5813A colon-separated list of suffixes to ignore when performing 5814filename completion. 5815A file name whose suffix matches one of the entries in 5816<CODE>FIGNORE</CODE> 5817is excluded from the list of matched file names. A sample 5818value is <SAMP>`.o:~'</SAMP> 5819<P> 5820 5821<A NAME="IDX178"></A> 5822<DT><CODE>FUNCNAME</CODE> 5823<DD><A NAME="IDX179"></A> 5824An array variable containing the names of all shell functions 5825currently in the execution call stack. 5826The element with index 0 is the name of any currently-executing 5827shell function. 5828The bottom-most element is "main". 5829This variable exists only when a shell function is executing. 5830Assignments to <CODE>FUNCNAME</CODE> have no effect and return an error status. 5831If <CODE>FUNCNAME</CODE> is unset, it loses its special properties, even if 5832it is subsequently reset. 5833<P> 5834 5835<A NAME="IDX180"></A> 5836<DT><CODE>GLOBIGNORE</CODE> 5837<DD><A NAME="IDX181"></A> 5838A colon-separated list of patterns defining the set of filenames to 5839be ignored by filename expansion. 5840If a filename matched by a filename expansion pattern also matches one 5841of the patterns in <CODE>GLOBIGNORE</CODE>, it is removed from the list 5842of matches. 5843<P> 5844 5845<A NAME="IDX182"></A> 5846<DT><CODE>GROUPS</CODE> 5847<DD><A NAME="IDX183"></A> 5848An array variable containing the list of groups of which the current 5849user is a member. 5850Assignments to <CODE>GROUPS</CODE> have no effect and return an error status. 5851If <CODE>GROUPS</CODE> is unset, it loses its special properties, even if it is 5852subsequently reset. 5853<P> 5854 5855<A NAME="IDX184"></A> 5856<DT><CODE>histchars</CODE> 5857<DD><A NAME="IDX185"></A> 5858Up to three characters which control history expansion, quick 5859substitution, and tokenization (see section <A HREF="bashref.html#SEC118">9.3 History Expansion</A>). 5860The first character is the 5861<VAR>history expansion</VAR> character, that is, the character which signifies the 5862start of a history expansion, normally <SAMP>`!'</SAMP>. The second character is the 5863character which signifies `quick substitution' when seen as the first 5864character on a line, normally <SAMP>`^'</SAMP>. The optional third character is the 5865character which indicates that the remainder of the line is a comment when 5866found as the first character of a word, usually <SAMP>`#'</SAMP>. The history 5867comment character causes history substitution to be skipped for the 5868remaining words on the line. It does not necessarily cause the shell 5869parser to treat the rest of the line as a comment. 5870<P> 5871 5872<A NAME="IDX186"></A> 5873<DT><CODE>HISTCMD</CODE> 5874<DD><A NAME="IDX187"></A> 5875The history number, or index in the history list, of the current 5876command. If <CODE>HISTCMD</CODE> is unset, it loses its special properties, 5877even if it is subsequently reset. 5878<P> 5879 5880<A NAME="IDX188"></A> 5881<DT><CODE>HISTCONTROL</CODE> 5882<DD><A NAME="IDX189"></A> 5883A colon-separated list of values controlling how commands are saved on 5884the history list. 5885If the list of values includes <SAMP>`ignorespace'</SAMP>, lines which begin 5886with a space character are not saved in the history list. 5887A value of <SAMP>`ignoredups'</SAMP> causes lines which match the previous 5888history entry to not be saved. 5889A value of <SAMP>`ignoreboth'</SAMP> is shorthand for 5890<SAMP>`ignorespace'</SAMP> and <SAMP>`ignoredups'</SAMP>. 5891A value of <SAMP>`erasedups'</SAMP> causes all previous lines matching the 5892current line to be removed from the history list before that line 5893is saved. 5894Any value not in the above list is ignored. 5895If <CODE>HISTCONTROL</CODE> is unset, or does not include a valid value, 5896all lines read by the shell parser are saved on the history list, 5897subject to the value of <CODE>HISTIGNORE</CODE>. 5898The second and subsequent lines of a multi-line compound command are 5899not tested, and are added to the history regardless of the value of 5900<CODE>HISTCONTROL</CODE>. 5901<P> 5902 5903<A NAME="IDX190"></A> 5904<DT><CODE>HISTFILE</CODE> 5905<DD><A NAME="IDX191"></A> 5906The name of the file to which the command history is saved. The 5907default value is <TT>`~/.bash_history'</TT>. 5908<P> 5909 5910<A NAME="IDX192"></A> 5911<DT><CODE>HISTFILESIZE</CODE> 5912<DD><A NAME="IDX193"></A> 5913The maximum number of lines contained in the history file. When this 5914variable is assigned a value, the history file is truncated, if 5915necessary, to contain no more than that number of lines. 5916The history file is also truncated to this size after 5917writing it when an interactive shell exits. 5918The default value is 500. 5919<P> 5920 5921<A NAME="IDX194"></A> 5922<DT><CODE>HISTIGNORE</CODE> 5923<DD><A NAME="IDX195"></A> 5924A colon-separated list of patterns used to decide which command 5925lines should be saved on the history list. Each pattern is 5926anchored at the beginning of the line and must match the complete 5927line (no implicit <SAMP>`*'</SAMP> is appended). Each pattern is tested 5928against the line after the checks specified by <CODE>HISTCONTROL</CODE> 5929are applied. In addition to the normal shell pattern matching 5930characters, <SAMP>`&'</SAMP> matches the previous history line. <SAMP>`&'</SAMP> 5931may be escaped using a backslash; the backslash is removed 5932before attempting a match. 5933The second and subsequent lines of a multi-line compound command are 5934not tested, and are added to the history regardless of the value of 5935<CODE>HISTIGNORE</CODE>. 5936<P> 5937 5938<CODE>HISTIGNORE</CODE> subsumes the function of <CODE>HISTCONTROL</CODE>. A 5939pattern of <SAMP>`&'</SAMP> is identical to <CODE>ignoredups</CODE>, and a 5940pattern of <SAMP>`[ ]*'</SAMP> is identical to <CODE>ignorespace</CODE>. 5941Combining these two patterns, separating them with a colon, 5942provides the functionality of <CODE>ignoreboth</CODE>. 5943</P><P> 5944 5945<A NAME="IDX196"></A> 5946<DT><CODE>HISTSIZE</CODE> 5947<DD><A NAME="IDX197"></A> 5948The maximum number of commands to remember on the history list. 5949The default value is 500. 5950<P> 5951 5952<A NAME="IDX198"></A> 5953<DT><CODE>HISTTIMEFORMAT</CODE> 5954<DD><A NAME="IDX199"></A> 5955If this variable is set and not null, its value is used as a format string 5956for <VAR>strftime</VAR> to print the time stamp associated with each history 5957entry displayed by the <CODE>history</CODE> builtin. 5958If this variable is set, time stamps are written to the history file so 5959they may be preserved across shell sessions. 5960<P> 5961 5962<A NAME="IDX200"></A> 5963<DT><CODE>HOSTFILE</CODE> 5964<DD><A NAME="IDX201"></A> 5965Contains the name of a file in the same format as <TT>`/etc/hosts'</TT> that 5966should be read when the shell needs to complete a hostname. 5967The list of possible hostname completions may be changed while the shell 5968is running; 5969the next time hostname completion is attempted after the 5970value is changed, Bash adds the contents of the new file to the 5971existing list. 5972If <CODE>HOSTFILE</CODE> is set, but has no value, Bash attempts to read 5973<TT>`/etc/hosts'</TT> to obtain the list of possible hostname completions. 5974When <CODE>HOSTFILE</CODE> is unset, the hostname list is cleared. 5975<P> 5976 5977<A NAME="IDX202"></A> 5978<DT><CODE>HOSTNAME</CODE> 5979<DD><A NAME="IDX203"></A> 5980The name of the current host. 5981<P> 5982 5983<A NAME="IDX204"></A> 5984<DT><CODE>HOSTTYPE</CODE> 5985<DD><A NAME="IDX205"></A> 5986A string describing the machine Bash is running on. 5987<P> 5988 5989<A NAME="IDX206"></A> 5990<DT><CODE>IGNOREEOF</CODE> 5991<DD><A NAME="IDX207"></A> 5992Controls the action of the shell on receipt of an <CODE>EOF</CODE> character 5993as the sole input. If set, the value denotes the number 5994of consecutive <CODE>EOF</CODE> characters that can be read as the 5995first character on an input line 5996before the shell will exit. If the variable exists but does not 5997have a numeric value (or has no value) then the default is 10. 5998If the variable does not exist, then <CODE>EOF</CODE> signifies the end of 5999input to the shell. This is only in effect for interactive shells. 6000<P> 6001 6002<A NAME="IDX208"></A> 6003<DT><CODE>INPUTRC</CODE> 6004<DD><A NAME="IDX209"></A> 6005The name of the Readline initialization file, overriding the default 6006of <TT>`~/.inputrc'</TT>. 6007<P> 6008 6009<A NAME="IDX210"></A> 6010<DT><CODE>LANG</CODE> 6011<DD><A NAME="IDX211"></A> 6012Used to determine the locale category for any category not specifically 6013selected with a variable starting with <CODE>LC_</CODE>. 6014<P> 6015 6016<A NAME="IDX212"></A> 6017<DT><CODE>LC_ALL</CODE> 6018<DD><A NAME="IDX213"></A> 6019This variable overrides the value of <CODE>LANG</CODE> and any other 6020<CODE>LC_</CODE> variable specifying a locale category. 6021<P> 6022 6023<A NAME="IDX214"></A> 6024<DT><CODE>LC_COLLATE</CODE> 6025<DD><A NAME="IDX215"></A> 6026This variable determines the collation order used when sorting the 6027results of filename expansion, and 6028determines the behavior of range expressions, equivalence classes, 6029and collating sequences within filename expansion and pattern matching 6030(see section <A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A>). 6031<P> 6032 6033<A NAME="IDX216"></A> 6034<DT><CODE>LC_CTYPE</CODE> 6035<DD><A NAME="IDX217"></A> 6036This variable determines the interpretation of characters and the 6037behavior of character classes within filename expansion and pattern 6038matching (see section <A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A>). 6039<P> 6040 6041<A NAME="IDX218"></A> 6042<DT><CODE>LC_MESSAGES</CODE> 6043<DD><A NAME="IDX219"></A> 6044This variable determines the locale used to translate double-quoted 6045strings preceded by a <SAMP>`$'</SAMP> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>). 6046<P> 6047 6048<A NAME="IDX220"></A> 6049<DT><CODE>LC_NUMERIC</CODE> 6050<DD><A NAME="IDX221"></A> 6051This variable determines the locale category used for number formatting. 6052<P> 6053 6054<A NAME="IDX222"></A> 6055<DT><CODE>LINENO</CODE> 6056<DD><A NAME="IDX223"></A> 6057The line number in the script or shell function currently executing. 6058<P> 6059 6060<A NAME="IDX224"></A> 6061<DT><CODE>LINES</CODE> 6062<DD><A NAME="IDX225"></A> 6063Used by the <CODE>select</CODE> builtin command to determine the column length 6064for printing selection lists. Automatically set upon receipt of a 6065<CODE>SIGWINCH</CODE>. 6066<P> 6067 6068<A NAME="IDX226"></A> 6069<DT><CODE>MACHTYPE</CODE> 6070<DD><A NAME="IDX227"></A> 6071A string that fully describes the system type on which Bash 6072is executing, in the standard GNU <VAR>cpu-company-system</VAR> format. 6073<P> 6074 6075<A NAME="IDX228"></A> 6076<DT><CODE>MAILCHECK</CODE> 6077<DD><A NAME="IDX229"></A> 6078How often (in seconds) that the shell should check for mail in the 6079files specified in the <CODE>MAILPATH</CODE> or <CODE>MAIL</CODE> variables. 6080The default is 60 seconds. When it is time to check 6081for mail, the shell does so before displaying the primary prompt. 6082If this variable is unset, or set to a value that is not a number 6083greater than or equal to zero, the shell disables mail checking. 6084<P> 6085 6086<A NAME="IDX230"></A> 6087<DT><CODE>OLDPWD</CODE> 6088<DD><A NAME="IDX231"></A> 6089The previous working directory as set by the <CODE>cd</CODE> builtin. 6090<P> 6091 6092<A NAME="IDX232"></A> 6093<DT><CODE>OPTERR</CODE> 6094<DD><A NAME="IDX233"></A> 6095If set to the value 1, Bash displays error messages 6096generated by the <CODE>getopts</CODE> builtin command. 6097<P> 6098 6099<A NAME="IDX234"></A> 6100<DT><CODE>OSTYPE</CODE> 6101<DD><A NAME="IDX235"></A> 6102A string describing the operating system Bash is running on. 6103<P> 6104 6105<A NAME="IDX236"></A> 6106<DT><CODE>PIPESTATUS</CODE> 6107<DD><A NAME="IDX237"></A> 6108An array variable (see section <A HREF="bashref.html#SEC81">6.7 Arrays</A>) 6109containing a list of exit status values from the processes 6110in the most-recently-executed foreground pipeline (which may 6111contain only a single command). 6112<P> 6113 6114<A NAME="IDX238"></A> 6115<DT><CODE>POSIXLY_CORRECT</CODE> 6116<DD><A NAME="IDX239"></A> 6117If this variable is in the environment when <CODE>bash</CODE> starts, the shell 6118enters POSIX mode (see section <A HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A>) before reading the 6119startup files, as if the <SAMP>`--posix'</SAMP> invocation option had been supplied. 6120If it is set while the shell is running, <CODE>bash</CODE> enables POSIX mode, 6121as if the command 6122<TABLE><tr><td> </td><td class=example><pre><CODE>set -o posix</CODE> 6123</pre></td></tr></table>had been executed. 6124<P> 6125 6126<A NAME="IDX240"></A> 6127<DT><CODE>PPID</CODE> 6128<DD><A NAME="IDX241"></A> 6129The process ID of the shell's parent process. This variable 6130is readonly. 6131<P> 6132 6133<A NAME="IDX242"></A> 6134<DT><CODE>PROMPT_COMMAND</CODE> 6135<DD><A NAME="IDX243"></A> 6136If set, the value is interpreted as a command to execute 6137before the printing of each primary prompt (<CODE>$PS1</CODE>). 6138<P> 6139 6140<A NAME="IDX244"></A> 6141<DT><CODE>PS3</CODE> 6142<DD><A NAME="IDX245"></A> 6143The value of this variable is used as the prompt for the 6144<CODE>select</CODE> command. If this variable is not set, the 6145<CODE>select</CODE> command prompts with <SAMP>`#? '</SAMP> 6146<P> 6147 6148<A NAME="IDX246"></A> 6149<DT><CODE>PS4</CODE> 6150<DD><A NAME="IDX247"></A> 6151The value is the prompt printed before the command line is echoed 6152when the <SAMP>`-x'</SAMP> option is set (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 6153The first character of <CODE>PS4</CODE> is replicated multiple times, as 6154necessary, to indicate multiple levels of indirection. 6155The default is <SAMP>`+ '</SAMP>. 6156<P> 6157 6158<A NAME="IDX248"></A> 6159<DT><CODE>PWD</CODE> 6160<DD><A NAME="IDX249"></A> 6161The current working directory as set by the <CODE>cd</CODE> builtin. 6162<P> 6163 6164<A NAME="IDX250"></A> 6165<DT><CODE>RANDOM</CODE> 6166<DD><A NAME="IDX251"></A> 6167Each time this parameter is referenced, a random integer 6168between 0 and 32767 is generated. Assigning a value to this 6169variable seeds the random number generator. 6170<P> 6171 6172<A NAME="IDX252"></A> 6173<DT><CODE>REPLY</CODE> 6174<DD><A NAME="IDX253"></A> 6175The default variable for the <CODE>read</CODE> builtin. 6176<P> 6177 6178<A NAME="IDX254"></A> 6179<DT><CODE>SECONDS</CODE> 6180<DD><A NAME="IDX255"></A> 6181This variable expands to the number of seconds since the 6182shell was started. Assignment to this variable resets 6183the count to the value assigned, and the expanded value 6184becomes the value assigned plus the number of seconds 6185since the assignment. 6186<P> 6187 6188<A NAME="IDX256"></A> 6189<DT><CODE>SHELL</CODE> 6190<DD><A NAME="IDX257"></A> 6191The full pathname to the shell is kept in this environment variable. 6192If it is not set when the shell starts, 6193Bash assigns to it the full pathname of the current user's login shell. 6194<P> 6195 6196<A NAME="IDX258"></A> 6197<DT><CODE>SHELLOPTS</CODE> 6198<DD><A NAME="IDX259"></A> 6199A colon-separated list of enabled shell options. Each word in 6200the list is a valid argument for the <SAMP>`-o'</SAMP> option to the 6201<CODE>set</CODE> builtin command (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 6202The options appearing in <CODE>SHELLOPTS</CODE> are those reported 6203as <SAMP>`on'</SAMP> by <SAMP>`set -o'</SAMP>. 6204If this variable is in the environment when Bash 6205starts up, each shell option in the list will be enabled before 6206reading any startup files. This variable is readonly. 6207<P> 6208 6209<A NAME="IDX260"></A> 6210<DT><CODE>SHLVL</CODE> 6211<DD><A NAME="IDX261"></A> 6212Incremented by one each time a new instance of Bash is started. This is 6213intended to be a count of how deeply your Bash shells are nested. 6214<P> 6215 6216<A NAME="IDX262"></A> 6217<DT><CODE>TIMEFORMAT</CODE> 6218<DD><A NAME="IDX263"></A> 6219The value of this parameter is used as a format string specifying 6220how the timing information for pipelines prefixed with the <CODE>time</CODE> 6221reserved word should be displayed. 6222The <SAMP>`%'</SAMP> character introduces an 6223escape sequence that is expanded to a time value or other 6224information. 6225The escape sequences and their meanings are as 6226follows; the braces denote optional portions. 6227<P> 6228 6229<DL COMPACT> 6230 6231<DT><CODE>%%</CODE> 6232<DD>A literal <SAMP>`%'</SAMP>. 6233<P> 6234 6235<DT><CODE>%[<VAR>p</VAR>][l]R</CODE> 6236<DD>The elapsed time in seconds. 6237<P> 6238 6239<DT><CODE>%[<VAR>p</VAR>][l]U</CODE> 6240<DD>The number of CPU seconds spent in user mode. 6241<P> 6242 6243<DT><CODE>%[<VAR>p</VAR>][l]S</CODE> 6244<DD>The number of CPU seconds spent in system mode. 6245<P> 6246 6247<DT><CODE>%P</CODE> 6248<DD>The CPU percentage, computed as (%U + %S) / %R. 6249</DL> 6250<P> 6251 6252The optional <VAR>p</VAR> is a digit specifying the precision, the number of 6253fractional digits after a decimal point. 6254A value of 0 causes no decimal point or fraction to be output. 6255At most three places after the decimal point may be specified; values 6256of <VAR>p</VAR> greater than 3 are changed to 3. 6257If <VAR>p</VAR> is not specified, the value 3 is used. 6258</P><P> 6259 6260The optional <CODE>l</CODE> specifies a longer format, including minutes, of 6261the form <VAR>MM</VAR>m<VAR>SS</VAR>.<VAR>FF</VAR>s. 6262The value of <VAR>p</VAR> determines whether or not the fraction is included. 6263</P><P> 6264 6265If this variable is not set, Bash acts as if it had the value 6266<TABLE><tr><td> </td><td class=example><pre><CODE>$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'</CODE> 6267</pre></td></tr></table>If the value is null, no timing information is displayed. 6268A trailing newline is added when the format string is displayed. 6269</P><P> 6270 6271<A NAME="IDX264"></A> 6272<DT><CODE>TMOUT</CODE> 6273<DD><A NAME="IDX265"></A> 6274If set to a value greater than zero, <CODE>TMOUT</CODE> is treated as the 6275default timeout for the <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 6276The <CODE>select</CODE> command (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) terminates 6277if input does not arrive after <CODE>TMOUT</CODE> seconds when input is coming 6278from a terminal. 6279<P> 6280 6281In an interative shell, the value is interpreted as 6282the number of seconds to wait for input after issuing the primary 6283prompt when the shell is interactive. 6284Bash terminates after that number of seconds if input does 6285not arrive. 6286</P><P> 6287 6288<A NAME="IDX266"></A> 6289<DT><CODE>TMPDIR</CODE> 6290<DD><A NAME="IDX267"></A> 6291If set, Bash uses its value as the name of a directory in which 6292Bash creates temporary files for the shell's use. 6293<P> 6294 6295<A NAME="IDX268"></A> 6296<DT><CODE>UID</CODE> 6297<DD><A NAME="IDX269"></A> 6298The numeric real user id of the current user. This variable is readonly. 6299<P> 6300 6301</DL> 6302<P> 6303 6304<A NAME="Bash Features"></A> 6305<HR SIZE="6"> 6306<A NAME="SEC64"></A> 6307<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 6308<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> < </A>]</TD> 6309<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> > </A>]</TD> 6310<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> << </A>]</TD> 6311<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 6312<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 6313<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 6314<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 6315<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 6316<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 6317</TR></TABLE> 6318<H1> 6. Bash Features </H1> 6319<!--docid::SEC64::--> 6320<P> 6321 6322This section describes features unique to Bash. 6323</P><P> 6324 6325<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 6326<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC65">6.1 Invoking Bash</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Command line options that you can give 6327 to Bash.</TD></TR> 6328<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC66">6.2 Bash Startup Files</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">When and how Bash executes scripts.</TD></TR> 6329<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC74">6.3 Interactive Shells</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What an interactive shell is.</TD></TR> 6330<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC78">6.4 Bash Conditional Expressions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Primitives used in composing expressions for 6331 the <CODE>test</CODE> builtin.</TD></TR> 6332<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Arithmetic on shell variables.</TD></TR> 6333<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC80">6.6 Aliases</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Substituting one command for another.</TD></TR> 6334<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC81">6.7 Arrays</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Array Variables.</TD></TR> 6335<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC82">6.8 The Directory Stack</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">History of visited directories.</TD></TR> 6336<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC84">6.9 Controlling the Prompt</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling the PS1 string.</TD></TR> 6337<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC85">6.10 The Restricted Shell</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A more controlled mode of shell execution.</TD></TR> 6338<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Making Bash behave more closely to what 6339 the POSIX standard specifies.</TD></TR> 6340</TABLE></BLOCKQUOTE> 6341<P> 6342 6343<A NAME="Invoking Bash"></A> 6344<HR SIZE="6"> 6345<A NAME="SEC65"></A> 6346<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 6347<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> < </A>]</TD> 6348<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> > </A>]</TD> 6349<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD> 6350<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 6351<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 6352<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 6353<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 6354<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 6355<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 6356</TR></TABLE> 6357<H2> 6.1 Invoking Bash </H2> 6358<!--docid::SEC65::--> 6359<P> 6360 6361<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>] 6362bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] -c <VAR>string</VAR> [<VAR>argument</VAR> <small>...</small>] 6363bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>] 6364</pre></td></tr></table></P><P> 6365 6366In addition to the single-character shell command-line options 6367(see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>), there are several multi-character 6368options that you can use. These options must appear on the command 6369line before the single-character options to be recognized. 6370</P><P> 6371 6372<DL COMPACT> 6373<DT><CODE>--debugger</CODE> 6374<DD>Arrange for the debugger profile to be executed before the shell 6375starts. Turns on extended debugging mode (see <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A> 6376for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE> 6377builtin) and shell function tracing 6378(see <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A> for a description of the <CODE>-o functrace</CODE> 6379option). 6380<P> 6381 6382<DT><CODE>--dump-po-strings</CODE> 6383<DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP> 6384is printed on the standard output 6385in the GNU <CODE>gettext</CODE> PO (portable object) file format. 6386Equivalent to <SAMP>`-D'</SAMP> except for the output format. 6387<P> 6388 6389<DT><CODE>--dump-strings</CODE> 6390<DD>Equivalent to <SAMP>`-D'</SAMP>. 6391<P> 6392 6393<DT><CODE>--help</CODE> 6394<DD>Display a usage message on standard output and exit sucessfully. 6395<P> 6396 6397<DT><CODE>--init-file <VAR>filename</VAR></CODE> 6398<DD><DT><CODE>--rcfile <VAR>filename</VAR></CODE> 6399<DD>Execute commands from <VAR>filename</VAR> (instead of <TT>`~/.bashrc'</TT>) 6400in an interactive shell. 6401<P> 6402 6403<DT><CODE>--login</CODE> 6404<DD>Equivalent to <SAMP>`-l'</SAMP>. 6405<P> 6406 6407<DT><CODE>--noediting</CODE> 6408<DD>Do not use the GNU Readline library (see section <A HREF="bashref.html#SEC91">8. Command Line Editing</A>) 6409to read command lines when the shell is interactive. 6410<P> 6411 6412<DT><CODE>--noprofile</CODE> 6413<DD>Don't load the system-wide startup file <TT>`/etc/profile'</TT> 6414or any of the personal initialization files 6415<TT>`~/.bash_profile'</TT>, <TT>`~/.bash_login'</TT>, or <TT>`~/.profile'</TT> 6416when Bash is invoked as a login shell. 6417<P> 6418 6419<DT><CODE>--norc</CODE> 6420<DD>Don't read the <TT>`~/.bashrc'</TT> initialization file in an 6421interactive shell. This is on by default if the shell is 6422invoked as <CODE>sh</CODE>. 6423<P> 6424 6425<DT><CODE>--posix</CODE> 6426<DD>Change the behavior of Bash where the default operation differs 6427from the POSIX 1003.2 standard to match the standard. This 6428is intended to make Bash behave as a strict superset of that 6429standard. See section <A HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A>, for a description of the Bash 6430POSIX mode. 6431<P> 6432 6433<DT><CODE>--restricted</CODE> 6434<DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC85">6.10 The Restricted Shell</A>). 6435<P> 6436 6437<DT><CODE>--verbose</CODE> 6438<DD>Equivalent to <SAMP>`-v'</SAMP>. Print shell input lines as they're read. 6439<P> 6440 6441<DT><CODE>--version</CODE> 6442<DD>Show version information for this instance of 6443Bash on the standard output and exit successfully. 6444<P> 6445 6446</DL> 6447<P> 6448 6449There are several single-character options that may be supplied at 6450invocation which are not available with the <CODE>set</CODE> builtin. 6451</P><P> 6452 6453<DL COMPACT> 6454<DT><CODE>-c <VAR>string</VAR></CODE> 6455<DD>Read and execute commands from <VAR>string</VAR> after processing the 6456options, then exit. Any remaining arguments are assigned to the 6457positional parameters, starting with <CODE>$0</CODE>. 6458<P> 6459 6460<DT><CODE>-i</CODE> 6461<DD>Force the shell to run interactively. Interactive shells are 6462described in <A HREF="bashref.html#SEC74">6.3 Interactive Shells</A>. 6463<P> 6464 6465<DT><CODE>-l</CODE> 6466<DD>Make this shell act as if it had been directly invoked by login. 6467When the shell is interactive, this is equivalent to starting a 6468login shell with <SAMP>`exec -l bash'</SAMP>. 6469When the shell is not interactive, the login shell startup files will 6470be executed. 6471<SAMP>`exec bash -l'</SAMP> or <SAMP>`exec bash --login'</SAMP> 6472will replace the current shell with a Bash login shell. 6473See section <A HREF="bashref.html#SEC66">6.2 Bash Startup Files</A>, for a description of the special behavior 6474of a login shell. 6475<P> 6476 6477<DT><CODE>-r</CODE> 6478<DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC85">6.10 The Restricted Shell</A>). 6479<P> 6480 6481<DT><CODE>-s</CODE> 6482<DD>If this option is present, or if no arguments remain after option 6483processing, then commands are read from the standard input. 6484This option allows the positional parameters to be set 6485when invoking an interactive shell. 6486<P> 6487 6488<DT><CODE>-D</CODE> 6489<DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP> 6490is printed on the standard output. 6491These are the strings that 6492are subject to language translation when the current locale 6493is not <CODE>C</CODE> or <CODE>POSIX</CODE> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>). 6494This implies the <SAMP>`-n'</SAMP> option; no commands will be executed. 6495<P> 6496 6497<DT><CODE>[-+]O [<VAR>shopt_option</VAR>]</CODE> 6498<DD><VAR>shopt_option</VAR> is one of the shell options accepted by the 6499<CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC56">4. Shell Builtin Commands</A>). 6500If <VAR>shopt_option</VAR> is present, <SAMP>`-O'</SAMP> sets the value of that option; 6501<SAMP>`+O'</SAMP> unsets it. 6502If <VAR>shopt_option</VAR> is not supplied, the names and values of the shell 6503options accepted by <CODE>shopt</CODE> are printed on the standard output. 6504If the invocation option is <SAMP>`+O'</SAMP>, the output is displayed in a format 6505that may be reused as input. 6506<P> 6507 6508<DT><CODE>--</CODE> 6509<DD>A <CODE>--</CODE> signals the end of options and disables further option 6510processing. 6511Any arguments after the <CODE>--</CODE> are treated as filenames and arguments. 6512<P> 6513 6514</DL> 6515<P> 6516 6517<A NAME="IDX270"></A> 6518A <EM>login</EM> shell is one whose first character of argument zero is 6519<SAMP>`-'</SAMP>, or one invoked with the <SAMP>`--login'</SAMP> option. 6520</P><P> 6521 6522<A NAME="IDX271"></A> 6523An <EM>interactive</EM> shell is one started without non-option arguments, 6524unless <SAMP>`-s'</SAMP> is specified, 6525without specifying the <SAMP>`-c'</SAMP> option, and whose input and output are both 6526connected to terminals (as determined by <CODE>isatty(3)</CODE>), or one 6527started with the <SAMP>`-i'</SAMP> option. See section <A HREF="bashref.html#SEC74">6.3 Interactive Shells</A>, for more 6528information. 6529</P><P> 6530 6531If arguments remain after option processing, and neither the 6532<SAMP>`-c'</SAMP> nor the <SAMP>`-s'</SAMP> 6533option has been supplied, the first argument is assumed to 6534be the name of a file containing shell commands (see section <A HREF="bashref.html#SEC55">3.8 Shell Scripts</A>). 6535When Bash is invoked in this fashion, <CODE>$0</CODE> 6536is set to the name of the file, and the positional parameters 6537are set to the remaining arguments. 6538Bash reads and executes commands from this file, then exits. 6539Bash's exit status is the exit status of the last command executed 6540in the script. If no commands are executed, the exit status is 0. 6541</P><P> 6542 6543<A NAME="Bash Startup Files"></A> 6544<HR SIZE="6"> 6545<A NAME="SEC66"></A> 6546<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 6547<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> < </A>]</TD> 6548<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC74"> > </A>]</TD> 6549<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC74"> << </A>]</TD> 6550<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 6551<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 6552<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 6553<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 6554<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 6555<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 6556</TR></TABLE> 6557<H2> 6.2 Bash Startup Files </H2> 6558<!--docid::SEC66::--> 6559<P> 6560 6561This section describs how Bash executes its startup files. 6562If any of the files exist but cannot be read, Bash reports an error. 6563Tildes are expanded in file names as described above under 6564Tilde Expansion (see section <A HREF="bashref.html#SEC29">3.5.2 Tilde Expansion</A>). 6565</P><P> 6566 6567Interactive shells are described in <A HREF="bashref.html#SEC74">6.3 Interactive Shells</A>. 6568</P><P> 6569 6570<A NAME="SEC67"></A> 6571<H4> Invoked as an interactive login shell, or with <SAMP>`--login'</SAMP> </H4> 6572<!--docid::SEC67::--> 6573<P> 6574 6575When Bash is invoked as an interactive login shell, or as a 6576non-interactive shell with the <SAMP>`--login'</SAMP> option, it first reads and 6577executes commands from the file <TT>`/etc/profile'</TT>, if that file exists. 6578After reading that file, it looks for <TT>`~/.bash_profile'</TT>, 6579<TT>`~/.bash_login'</TT>, and <TT>`~/.profile'</TT>, in that order, and reads 6580and executes commands from the first one that exists and is readable. 6581The <SAMP>`--noprofile'</SAMP> option may be used when the shell is started to 6582inhibit this behavior. 6583</P><P> 6584 6585When a login shell exits, Bash reads and executes commands from 6586the file <TT>`~/.bash_logout'</TT>, if it exists. 6587</P><P> 6588 6589<A NAME="SEC68"></A> 6590<H4> Invoked as an interactive non-login shell </H4> 6591<!--docid::SEC68::--> 6592<P> 6593 6594When an interactive shell that is not a login shell is started, Bash 6595reads and executes commands from <TT>`~/.bashrc'</TT>, if that file exists. 6596This may be inhibited by using the <SAMP>`--norc'</SAMP> option. 6597The <SAMP>`--rcfile <VAR>file</VAR>'</SAMP> option will force Bash to read and 6598execute commands from <VAR>file</VAR> instead of <TT>`~/.bashrc'</TT>. 6599</P><P> 6600 6601So, typically, your <TT>`~/.bash_profile'</TT> contains the line 6602<TABLE><tr><td> </td><td class=example><pre><CODE>if [ -f ~/.bashrc ]; then . ~/.bashrc; fi</CODE> 6603</pre></td></tr></table>after (or before) any login-specific initializations. 6604</P><P> 6605 6606<A NAME="SEC69"></A> 6607<H4> Invoked non-interactively </H4> 6608<!--docid::SEC69::--> 6609<P> 6610 6611When Bash is started non-interactively, to run a shell script, 6612for example, it looks for the variable <CODE>BASH_ENV</CODE> in the environment, 6613expands its value if it appears there, and uses the expanded value as 6614the name of a file to read and execute. Bash behaves as if the 6615following command were executed: 6616<TABLE><tr><td> </td><td class=example><pre><CODE>if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi</CODE> 6617</pre></td></tr></table>but the value of the <CODE>PATH</CODE> variable is not used to search for the 6618file name. 6619</P><P> 6620 6621As noted above, if a non-interactive shell is invoked with the 6622<SAMP>`--login'</SAMP> option, Bash attempts to read and execute commands from the 6623login shell startup files. 6624</P><P> 6625 6626<A NAME="SEC70"></A> 6627<H4> Invoked with name <CODE>sh</CODE> </H4> 6628<!--docid::SEC70::--> 6629<P> 6630 6631If Bash is invoked with the name <CODE>sh</CODE>, it tries to mimic the 6632startup behavior of historical versions of <CODE>sh</CODE> as closely as 6633possible, while conforming to the POSIX standard as well. 6634</P><P> 6635 6636When invoked as an interactive login shell, or as a non-interactive 6637shell with the <SAMP>`--login'</SAMP> option, it first attempts to read 6638and execute commands from <TT>`/etc/profile'</TT> and <TT>`~/.profile'</TT>, in 6639that order. 6640The <SAMP>`--noprofile'</SAMP> option may be used to inhibit this behavior. 6641When invoked as an interactive shell with the name <CODE>sh</CODE>, Bash 6642looks for the variable <CODE>ENV</CODE>, expands its value if it is defined, 6643and uses the expanded value as the name of a file to read and execute. 6644Since a shell invoked as <CODE>sh</CODE> does not attempt to read and execute 6645commands from any other startup files, the <SAMP>`--rcfile'</SAMP> option has 6646no effect. 6647A non-interactive shell invoked with the name <CODE>sh</CODE> does not attempt 6648to read any other startup files. 6649</P><P> 6650 6651When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after 6652the startup files are read. 6653</P><P> 6654 6655<A NAME="SEC71"></A> 6656<H4> Invoked in POSIX mode </H4> 6657<!--docid::SEC71::--> 6658<P> 6659 6660When Bash is started in POSIX mode, as with the 6661<SAMP>`--posix'</SAMP> command line option, it follows the POSIX standard 6662for startup files. 6663In this mode, interactive shells expand the <CODE>ENV</CODE> variable 6664and commands are read and executed from the file whose name is the 6665expanded value. 6666No other startup files are read. 6667</P><P> 6668 6669<A NAME="SEC72"></A> 6670<H4> Invoked by remote shell daemon </H4> 6671<!--docid::SEC72::--> 6672<P> 6673 6674Bash attempts to determine when it is being run by the remote shell 6675daemon, usually <CODE>rshd</CODE>. If Bash determines it is being run by 6676rshd, it reads and executes commands from <TT>`~/.bashrc'</TT>, if that 6677file exists and is readable. 6678It will not do this if invoked as <CODE>sh</CODE>. 6679The <SAMP>`--norc'</SAMP> option may be used to inhibit this behavior, and the 6680<SAMP>`--rcfile'</SAMP> option may be used to force another file to be read, but 6681<CODE>rshd</CODE> does not generally invoke the shell with those options or 6682allow them to be specified. 6683</P><P> 6684 6685<A NAME="SEC73"></A> 6686<H4> Invoked with unequal effective and real UID/GIDs </H4> 6687<!--docid::SEC73::--> 6688<P> 6689 6690If Bash is started with the effective user (group) id not equal to the 6691real user (group) id, and the <CODE>-p</CODE> option is not supplied, no startup 6692files are read, shell functions are not inherited from the environment, 6693the <CODE>SHELLOPTS</CODE> variable, if it appears in the environment, is ignored, 6694and the effective user id is set to the real user id. 6695If the <CODE>-p</CODE> option is supplied at invocation, the startup behavior is 6696the same, but the effective user id is not reset. 6697</P><P> 6698 6699<A NAME="Interactive Shells"></A> 6700<HR SIZE="6"> 6701<A NAME="SEC74"></A> 6702<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 6703<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> < </A>]</TD> 6704<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC75"> > </A>]</TD> 6705<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> << </A>]</TD> 6706<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 6707<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> >> </A>]</TD> 6708<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 6709<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 6710<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 6711<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 6712</TR></TABLE> 6713<H2> 6.3 Interactive Shells </H2> 6714<!--docid::SEC74::--> 6715<P> 6716 6717<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 6718<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC75">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> 6719<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC76">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> 6720<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC77">6.3.3 Interactive Shell Behavior</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What changes in a interactive shell?</TD></TR> 6721</TABLE></BLOCKQUOTE> 6722<P> 6723 6724<A NAME="What is an Interactive Shell?"></A> 6725<HR SIZE="6"> 6726<A NAME="SEC75"></A> 6727<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 6728<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC74"> < </A>]</TD> 6729<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC76"> > </A>]</TD> 6730<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> << </A>]</TD> 6731<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC74"> Up </A>]</TD> 6732<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> >> </A>]</TD> 6733<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 6734<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 6735<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 6736<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 6737</TR></TABLE> 6738<H3> 6.3.1 What is an Interactive Shell? </H3> 6739<!--docid::SEC75::--> 6740<P> 6741 6742An interactive shell 6743is one started without non-option arguments, unless <SAMP>`-s'</SAMP> is 6744specified, without specifiying the <SAMP>`-c'</SAMP> option, and 6745whose input and error output are both 6746connected to terminals (as determined by <CODE>isatty(3)</CODE>), 6747or one started with the <SAMP>`-i'</SAMP> option. 6748</P><P> 6749 6750An interactive shell generally reads from and writes to a user's 6751terminal. 6752</P><P> 6753 6754The <SAMP>`-s'</SAMP> invocation option may be used to set the positional parameters 6755when an interactive shell is started. 6756</P><P> 6757 6758<A NAME="Is this Shell Interactive?"></A> 6759<HR SIZE="6"> 6760<A NAME="SEC76"></A> 6761<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 6762<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC75"> < </A>]</TD> 6763<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC77"> > </A>]</TD> 6764<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC77"> << </A>]</TD> 6765<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC74"> Up </A>]</TD> 6766<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> >> </A>]</TD> 6767<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 6768<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 6769<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 6770<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 6771</TR></TABLE> 6772<H3> 6.3.2 Is this Shell Interactive? </H3> 6773<!--docid::SEC76::--> 6774<P> 6775 6776To determine within a startup script whether or not Bash is 6777running interactively, 6778test the value of the <SAMP>`-'</SAMP> special parameter. 6779It contains <CODE>i</CODE> when the shell is interactive. For example: 6780</P><P> 6781 6782<TABLE><tr><td> </td><td class=example><pre>case "$-" in 6783*i*) echo This shell is interactive ;; 6784*) echo This shell is not interactive ;; 6785esac 6786</pre></td></tr></table></P><P> 6787 6788Alternatively, startup scripts may examine the variable 6789<CODE>PS1</CODE>; it is unset in non-interactive shells, and set in 6790interactive shells. Thus: 6791</P><P> 6792 6793<TABLE><tr><td> </td><td class=example><pre>if [ -z "$PS1" ]; then 6794 echo This shell is not interactive 6795else 6796 echo This shell is interactive 6797fi 6798</pre></td></tr></table></P><P> 6799 6800<A NAME="Interactive Shell Behavior"></A> 6801<HR SIZE="6"> 6802<A NAME="SEC77"></A> 6803<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 6804<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC76"> < </A>]</TD> 6805<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> > </A>]</TD> 6806<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> << </A>]</TD> 6807<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC74"> Up </A>]</TD> 6808<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> >> </A>]</TD> 6809<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 6810<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 6811<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 6812<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 6813</TR></TABLE> 6814<H3> 6.3.3 Interactive Shell Behavior </H3> 6815<!--docid::SEC77::--> 6816<P> 6817 6818When the shell is running interactively, it changes its behavior in 6819several ways. 6820</P><P> 6821 6822<OL> 6823<LI> 6824Startup files are read and executed as described in <A HREF="bashref.html#SEC66">6.2 Bash Startup Files</A>. 6825<P> 6826 6827<LI> 6828Job Control (see section <A HREF="bashref.html#SEC87">7. Job Control</A>) is enabled by default. When job 6829control is in effect, Bash ignores the keyboard-generated job control 6830signals <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>. 6831<P> 6832 6833<LI> 6834Bash expands and displays <CODE>PS1</CODE> before reading the first line 6835of a command, and expands and displays <CODE>PS2</CODE> before reading the 6836second and subsequent lines of a multi-line command. 6837<P> 6838 6839<LI> 6840Bash executes the value of the <CODE>PROMPT_COMMAND</CODE> variable as a command 6841before printing the primary prompt, <CODE>$PS1</CODE> 6842(see section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>). 6843<P> 6844 6845<LI> 6846Readline (see section <A HREF="bashref.html#SEC91">8. Command Line Editing</A>) is used to read commands from 6847the user's terminal. 6848<P> 6849 6850<LI> 6851Bash inspects the value of the <CODE>ignoreeof</CODE> option to <CODE>set -o</CODE> 6852instead of exiting immediately when it receives an <CODE>EOF</CODE> on its 6853standard input when reading a command (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 6854<P> 6855 6856<LI> 6857Command history (see section <A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A>) 6858and history expansion (see section <A HREF="bashref.html#SEC118">9.3 History Expansion</A>) 6859are enabled by default. 6860Bash will save the command history to the file named by <CODE>$HISTFILE</CODE> 6861when an interactive shell exits. 6862<P> 6863 6864<LI> 6865Alias expansion (see section <A HREF="bashref.html#SEC80">6.6 Aliases</A>) is performed by default. 6866<P> 6867 6868<LI> 6869In the absence of any traps, Bash ignores <CODE>SIGTERM</CODE> 6870(see section <A HREF="bashref.html#SEC54">3.7.6 Signals</A>). 6871<P> 6872 6873<LI> 6874In the absence of any traps, <CODE>SIGINT</CODE> is caught and handled 6875((see section <A HREF="bashref.html#SEC54">3.7.6 Signals</A>). 6876<CODE>SIGINT</CODE> will interrupt some shell builtins. 6877<P> 6878 6879<LI> 6880An interactive login shell sends a <CODE>SIGHUP</CODE> to all jobs on exit 6881if the <CODE>hupoxexit</CODE> shell option has been enabled (see section <A HREF="bashref.html#SEC54">3.7.6 Signals</A>). 6882<P> 6883 6884<LI> 6885The <SAMP>`-n'</SAMP> invocation option is ignored, and <SAMP>`set -n'</SAMP> has 6886no effect (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 6887<P> 6888 6889<LI> 6890Bash will check for mail periodically, depending on the values of the 6891<CODE>MAIL</CODE>, <CODE>MAILPATH</CODE>, and <CODE>MAILCHECK</CODE> shell variables 6892(see section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>). 6893<P> 6894 6895<LI> 6896Expansion errors due to references to unbound shell variables after 6897<SAMP>`set -u'</SAMP> has been enabled will not cause the shell to exit 6898(see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 6899<P> 6900 6901<LI> 6902The shell will not exit on expansion errors caused by <VAR>var</VAR> being unset 6903or null in <CODE>${<VAR>var</VAR>:?<VAR>word</VAR>}</CODE> expansions 6904(see section <A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A>). 6905<P> 6906 6907<LI> 6908Redirection errors encountered by shell builtins will not cause the 6909shell to exit. 6910<P> 6911 6912<LI> 6913When running in POSIX mode, a special builtin returning an error 6914status will not cause the shell to exit (see section <A HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A>). 6915<P> 6916 6917<LI> 6918A failed <CODE>exec</CODE> will not cause the shell to exit 6919(see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>). 6920<P> 6921 6922<LI> 6923Parser syntax errors will not cause the shell to exit. 6924<P> 6925 6926<LI> 6927Simple spelling correction for directory arguments to the <CODE>cd</CODE> 6928builtin is enabled by default (see the description of the <CODE>cdspell</CODE> 6929option to the <CODE>shopt</CODE> builtin in <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 6930<P> 6931 6932<LI> 6933The shell will check the value of the <CODE>TMOUT</CODE> variable and exit 6934if a command is not read within the specified number of seconds after 6935printing <CODE>$PS1</CODE> (see section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>). 6936<P> 6937 6938</OL> 6939<P> 6940 6941<A NAME="Bash Conditional Expressions"></A> 6942<HR SIZE="6"> 6943<A NAME="SEC78"></A> 6944<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 6945<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC77"> < </A>]</TD> 6946<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> > </A>]</TD> 6947<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> << </A>]</TD> 6948<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 6949<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 6950<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 6951<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 6952<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 6953<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 6954</TR></TABLE> 6955<H2> 6.4 Bash Conditional Expressions </H2> 6956<!--docid::SEC78::--> 6957<P> 6958 6959Conditional expressions are used by the <CODE>[[</CODE> compound command 6960and the <CODE>test</CODE> and <CODE>[</CODE> builtin commands. 6961</P><P> 6962 6963Expressions may be unary or binary. 6964Unary expressions are often used to examine the status of a file. 6965There are string operators and numeric comparison operators as well. 6966If the <VAR>file</VAR> argument to one of the primaries is of the form 6967<TT>`/dev/fd/<VAR>N</VAR>'</TT>, then file descriptor <VAR>N</VAR> is checked. 6968If the <VAR>file</VAR> argument to one of the primaries is one of 6969<TT>`/dev/stdin'</TT>, <TT>`/dev/stdout'</TT>, or <TT>`/dev/stderr'</TT>, file 6970descriptor 0, 1, or 2, respectively, is checked. 6971</P><P> 6972 6973Unless otherwise specified, primaries that operate on files follow symbolic 6974links and operate on the target of the link, rather than the link itself. 6975</P><P> 6976 6977<DL COMPACT> 6978<DT><CODE>-a <VAR>file</VAR></CODE> 6979<DD>True if <VAR>file</VAR> exists. 6980<P> 6981 6982<DT><CODE>-b <VAR>file</VAR></CODE> 6983<DD>True if <VAR>file</VAR> exists and is a block special file. 6984<P> 6985 6986<DT><CODE>-c <VAR>file</VAR></CODE> 6987<DD>True if <VAR>file</VAR> exists and is a character special file. 6988<P> 6989 6990<DT><CODE>-d <VAR>file</VAR></CODE> 6991<DD>True if <VAR>file</VAR> exists and is a directory. 6992<P> 6993 6994<DT><CODE>-e <VAR>file</VAR></CODE> 6995<DD>True if <VAR>file</VAR> exists. 6996<P> 6997 6998<DT><CODE>-f <VAR>file</VAR></CODE> 6999<DD>True if <VAR>file</VAR> exists and is a regular file. 7000<P> 7001 7002<DT><CODE>-g <VAR>file</VAR></CODE> 7003<DD>True if <VAR>file</VAR> exists and its set-group-id bit is set. 7004<P> 7005 7006<DT><CODE>-h <VAR>file</VAR></CODE> 7007<DD>True if <VAR>file</VAR> exists and is a symbolic link. 7008<P> 7009 7010<DT><CODE>-k <VAR>file</VAR></CODE> 7011<DD>True if <VAR>file</VAR> exists and its "sticky" bit is set. 7012<P> 7013 7014<DT><CODE>-p <VAR>file</VAR></CODE> 7015<DD>True if <VAR>file</VAR> exists and is a named pipe (FIFO). 7016<P> 7017 7018<DT><CODE>-r <VAR>file</VAR></CODE> 7019<DD>True if <VAR>file</VAR> exists and is readable. 7020<P> 7021 7022<DT><CODE>-s <VAR>file</VAR></CODE> 7023<DD>True if <VAR>file</VAR> exists and has a size greater than zero. 7024<P> 7025 7026<DT><CODE>-t <VAR>fd</VAR></CODE> 7027<DD>True if file descriptor <VAR>fd</VAR> is open and refers to a terminal. 7028<P> 7029 7030<DT><CODE>-u <VAR>file</VAR></CODE> 7031<DD>True if <VAR>file</VAR> exists and its set-user-id bit is set. 7032<P> 7033 7034<DT><CODE>-w <VAR>file</VAR></CODE> 7035<DD>True if <VAR>file</VAR> exists and is writable. 7036<P> 7037 7038<DT><CODE>-x <VAR>file</VAR></CODE> 7039<DD>True if <VAR>file</VAR> exists and is executable. 7040<P> 7041 7042<DT><CODE>-O <VAR>file</VAR></CODE> 7043<DD>True if <VAR>file</VAR> exists and is owned by the effective user id. 7044<P> 7045 7046<DT><CODE>-G <VAR>file</VAR></CODE> 7047<DD>True if <VAR>file</VAR> exists and is owned by the effective group id. 7048<P> 7049 7050<DT><CODE>-L <VAR>file</VAR></CODE> 7051<DD>True if <VAR>file</VAR> exists and is a symbolic link. 7052<P> 7053 7054<DT><CODE>-S <VAR>file</VAR></CODE> 7055<DD>True if <VAR>file</VAR> exists and is a socket. 7056<P> 7057 7058<DT><CODE>-N <VAR>file</VAR></CODE> 7059<DD>True if <VAR>file</VAR> exists and has been modified since it was last read. 7060<P> 7061 7062<DT><CODE><VAR>file1</VAR> -nt <VAR>file2</VAR></CODE> 7063<DD>True if <VAR>file1</VAR> is newer (according to modification date) 7064than <VAR>file2</VAR>, or if <VAR>file1</VAR> exists and <VAR>file2</VAR> does not. 7065<P> 7066 7067<DT><CODE><VAR>file1</VAR> -ot <VAR>file2</VAR></CODE> 7068<DD>True if <VAR>file1</VAR> is older than <VAR>file2</VAR>, 7069or if <VAR>file2</VAR> exists and <VAR>file1</VAR> does not. 7070<P> 7071 7072<DT><CODE><VAR>file1</VAR> -ef <VAR>file2</VAR></CODE> 7073<DD>True if <VAR>file1</VAR> and <VAR>file2</VAR> refer to the same device and 7074inode numbers. 7075<P> 7076 7077<DT><CODE>-o <VAR>optname</VAR></CODE> 7078<DD>True if shell option <VAR>optname</VAR> is enabled. 7079The list of options appears in the description of the <SAMP>`-o'</SAMP> 7080option to the <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 7081<P> 7082 7083<DT><CODE>-z <VAR>string</VAR></CODE> 7084<DD>True if the length of <VAR>string</VAR> is zero. 7085<P> 7086 7087<DT><CODE>-n <VAR>string</VAR></CODE> 7088<DD><DT><CODE><VAR>string</VAR></CODE> 7089<DD>True if the length of <VAR>string</VAR> is non-zero. 7090<P> 7091 7092<DT><CODE><VAR>string1</VAR> == <VAR>string2</VAR></CODE> 7093<DD>True if the strings are equal. 7094<SAMP>`='</SAMP> may be used in place of <SAMP>`=='</SAMP> for strict POSIX compliance. 7095<P> 7096 7097<DT><CODE><VAR>string1</VAR> != <VAR>string2</VAR></CODE> 7098<DD>True if the strings are not equal. 7099<P> 7100 7101<DT><CODE><VAR>string1</VAR> < <VAR>string2</VAR></CODE> 7102<DD>True if <VAR>string1</VAR> sorts before <VAR>string2</VAR> lexicographically 7103in the current locale. 7104<P> 7105 7106<DT><CODE><VAR>string1</VAR> > <VAR>string2</VAR></CODE> 7107<DD>True if <VAR>string1</VAR> sorts after <VAR>string2</VAR> lexicographically 7108in the current locale. 7109<P> 7110 7111<DT><CODE><VAR>arg1</VAR> OP <VAR>arg2</VAR></CODE> 7112<DD><CODE>OP</CODE> is one of 7113<SAMP>`-eq'</SAMP>, <SAMP>`-ne'</SAMP>, <SAMP>`-lt'</SAMP>, <SAMP>`-le'</SAMP>, <SAMP>`-gt'</SAMP>, or <SAMP>`-ge'</SAMP>. 7114These arithmetic binary operators return true if <VAR>arg1</VAR> 7115is equal to, not equal to, less than, less than or equal to, 7116greater than, or greater than or equal to <VAR>arg2</VAR>, 7117respectively. <VAR>Arg1</VAR> and <VAR>arg2</VAR> 7118may be positive or negative integers. 7119<P> 7120 7121</DL> 7122<P> 7123 7124<A NAME="Shell Arithmetic"></A> 7125<HR SIZE="6"> 7126<A NAME="SEC79"></A> 7127<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 7128<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> < </A>]</TD> 7129<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> > </A>]</TD> 7130<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> << </A>]</TD> 7131<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 7132<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 7133<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 7134<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 7135<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 7136<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 7137</TR></TABLE> 7138<H2> 6.5 Shell Arithmetic </H2> 7139<!--docid::SEC79::--> 7140<P> 7141 7142The shell allows arithmetic expressions to be evaluated, as one of 7143the shell expansions or by the <CODE>let</CODE> and the <SAMP>`-i'</SAMP> option 7144to the <CODE>declare</CODE> builtins. 7145</P><P> 7146 7147Evaluation is done in fixed-width integers with no check for overflow, 7148though division by 0 is trapped and flagged as an error. 7149The operators and their precedence, associativity, and values 7150are the same as in the C language. 7151The following list of operators is grouped into levels of 7152equal-precedence operators. 7153The levels are listed in order of decreasing precedence. 7154</P><P> 7155 7156<DL COMPACT> 7157 7158<DT><CODE><VAR>id</VAR>++ <VAR>id</VAR>--</CODE> 7159<DD>variable post-increment and post-decrement 7160<P> 7161 7162<DT><CODE>++<VAR>id</VAR> --<VAR>id</VAR></CODE> 7163<DD>variable pre-increment and pre-decrement 7164<P> 7165 7166<DT><CODE>- +</CODE> 7167<DD>unary minus and plus 7168<P> 7169 7170<DT><CODE>! ~</CODE> 7171<DD>logical and bitwise negation 7172<P> 7173 7174<DT><CODE>**</CODE> 7175<DD>exponentiation 7176<P> 7177 7178<DT><CODE>* / %</CODE> 7179<DD>multiplication, division, remainder 7180<P> 7181 7182<DT><CODE>+ -</CODE> 7183<DD>addition, subtraction 7184<P> 7185 7186<DT><CODE><< >></CODE> 7187<DD>left and right bitwise shifts 7188<P> 7189 7190<DT><CODE><= >= < ></CODE> 7191<DD>comparison 7192<P> 7193 7194<DT><CODE>== !=</CODE> 7195<DD>equality and inequality 7196<P> 7197 7198<DT><CODE>&</CODE> 7199<DD>bitwise AND 7200<P> 7201 7202<DT><CODE>^</CODE> 7203<DD>bitwise exclusive OR 7204<P> 7205 7206<DT><CODE>|</CODE> 7207<DD>bitwise OR 7208<P> 7209 7210<DT><CODE>&&</CODE> 7211<DD>logical AND 7212<P> 7213 7214<DT><CODE>||</CODE> 7215<DD>logical OR 7216<P> 7217 7218<DT><CODE>expr ? expr : expr</CODE> 7219<DD>conditional operator 7220<P> 7221 7222<DT><CODE>= *= /= %= += -= <<= >>= &= ^= |=</CODE> 7223<DD>assignment 7224<P> 7225 7226<DT><CODE>expr1 , expr2</CODE> 7227<DD>comma 7228</DL> 7229<P> 7230 7231Shell variables are allowed as operands; parameter expansion is 7232performed before the expression is evaluated. 7233Within an expression, shell variables may also be referenced by name 7234without using the parameter expansion syntax. 7235A shell variable that is null or unset evaluates to 0 when referenced 7236by name without using the parameter expansion syntax. 7237The value of a variable is evaluated as an arithmetic expression 7238when it is referenced, or when a variable which has been given the 7239<VAR>integer</VAR> attribute using <SAMP>`declare -i'</SAMP> is assigned a value. 7240A null value evaluates to 0. 7241A shell variable need not have its integer attribute turned on 7242to be used in an expression. 7243</P><P> 7244 7245Constants with a leading 0 are interpreted as octal numbers. 7246A leading <SAMP>`0x'</SAMP> or <SAMP>`0X'</SAMP> denotes hexadecimal. Otherwise, 7247numbers take the form [<VAR>base</VAR><CODE>#</CODE>]<VAR>n</VAR>, where <VAR>base</VAR> 7248is a decimal number between 2 and 64 representing the arithmetic 7249base, and <VAR>n</VAR> is a number in that base. If <VAR>base</VAR><CODE>#</CODE> is 7250omitted, then base 10 is used. 7251The digits greater than 9 are represented by the lowercase letters, 7252the uppercase letters, <SAMP>`@'</SAMP>, and <SAMP>`_'</SAMP>, in that order. 7253If <VAR>base</VAR> is less than or equal to 36, lowercase and uppercase 7254letters may be used interchangeably to represent numbers between 10 7255and 35. 7256</P><P> 7257 7258Operators are evaluated in order of precedence. Sub-expressions in 7259parentheses are evaluated first and may override the precedence 7260rules above. 7261</P><P> 7262 7263<A NAME="Aliases"></A> 7264<HR SIZE="6"> 7265<A NAME="SEC80"></A> 7266<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 7267<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> < </A>]</TD> 7268<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> > </A>]</TD> 7269<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> << </A>]</TD> 7270<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 7271<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 7272<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 7273<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 7274<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 7275<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 7276</TR></TABLE> 7277<H2> 6.6 Aliases </H2> 7278<!--docid::SEC80::--> 7279<P> 7280 7281<VAR>Aliases</VAR> allow a string to be substituted for a word when it is used 7282as the first word of a simple command. 7283The shell maintains a list of aliases that may be set and unset with 7284the <CODE>alias</CODE> and <CODE>unalias</CODE> builtin commands. 7285</P><P> 7286 7287The first word of each simple command, if unquoted, is checked to see 7288if it has an alias. 7289If so, that word is replaced by the text of the alias. 7290The characters <SAMP>`/'</SAMP>, <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`='</SAMP> and any of the 7291shell metacharacters or quoting characters listed above may not appear 7292in an alias name. 7293The replacement text may contain any valid 7294shell input, including shell metacharacters. 7295The first word of the replacement text is tested for 7296aliases, but a word that is identical to an alias being expanded 7297is not expanded a second time. 7298This means that one may alias <CODE>ls</CODE> to <CODE>"ls -F"</CODE>, 7299for instance, and Bash does not try to recursively expand the 7300replacement text. If the last character of the alias value is a 7301space or tab character, then the next command word following the 7302alias is also checked for alias expansion. 7303</P><P> 7304 7305Aliases are created and listed with the <CODE>alias</CODE> 7306command, and removed with the <CODE>unalias</CODE> command. 7307</P><P> 7308 7309There is no mechanism for using arguments in the replacement text, 7310as in <CODE>csh</CODE>. 7311If arguments are needed, a shell function should be used 7312(see section <A HREF="bashref.html#SEC23">3.3 Shell Functions</A>). 7313</P><P> 7314 7315Aliases are not expanded when the shell is not interactive, 7316unless the <CODE>expand_aliases</CODE> shell option is set using 7317<CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 7318</P><P> 7319 7320The rules concerning the definition and use of aliases are 7321somewhat confusing. Bash 7322always reads at least one complete line 7323of input before executing any 7324of the commands on that line. Aliases are expanded when a 7325command is read, not when it is executed. Therefore, an 7326alias definition appearing on the same line as another 7327command does not take effect until the next line of input is read. 7328The commands following the alias definition 7329on that line are not affected by the new alias. 7330This behavior is also an issue when functions are executed. 7331Aliases are expanded when a function definition is read, 7332not when the function is executed, because a function definition 7333is itself a compound command. As a consequence, aliases 7334defined in a function are not available until after that 7335function is executed. To be safe, always put 7336alias definitions on a separate line, and do not use <CODE>alias</CODE> 7337in compound commands. 7338</P><P> 7339 7340For almost every purpose, shell functions are preferred over aliases. 7341</P><P> 7342 7343<A NAME="Arrays"></A> 7344<HR SIZE="6"> 7345<A NAME="SEC81"></A> 7346<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 7347<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> < </A>]</TD> 7348<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> > </A>]</TD> 7349<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD> 7350<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 7351<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 7352<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 7353<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 7354<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 7355<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 7356</TR></TABLE> 7357<H2> 6.7 Arrays </H2> 7358<!--docid::SEC81::--> 7359<P> 7360 7361Bash provides one-dimensional array variables. Any variable may be used as 7362an array; the <CODE>declare</CODE> builtin will explicitly declare an array. 7363There is no maximum 7364limit on the size of an array, nor any requirement that members 7365be indexed or assigned contiguously. Arrays are zero-based. 7366</P><P> 7367 7368An array is created automatically if any variable is assigned to using 7369the syntax 7370<TABLE><tr><td> </td><td class=example><pre>name[<VAR>subscript</VAR>]=<VAR>value</VAR> 7371</pre></td></tr></table></P><P> 7372 7373The <VAR>subscript</VAR> 7374is treated as an arithmetic expression that must evaluate to a number 7375greater than or equal to zero. To explicitly declare an array, use 7376<TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR> 7377</pre></td></tr></table>The syntax 7378<TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR>[<VAR>subscript</VAR>] 7379</pre></td></tr></table>is also accepted; the <VAR>subscript</VAR> is ignored. Attributes may be 7380specified for an array variable using the <CODE>declare</CODE> and 7381<CODE>readonly</CODE> builtins. Each attribute applies to all members of 7382an array. 7383</P><P> 7384 7385Arrays are assigned to using compound assignments of the form 7386<TABLE><tr><td> </td><td class=example><pre>name=(value<VAR>1</VAR> <small>...</small> value<VAR>n</VAR>) 7387</pre></td></tr></table>where each 7388<VAR>value</VAR> is of the form <CODE>[[<VAR>subscript</VAR>]=]</CODE><VAR>string</VAR>. If 7389the optional subscript is supplied, that index is assigned to; 7390otherwise the index of the element assigned is the last index assigned 7391to by the statement plus one. Indexing starts at zero. 7392This syntax is also accepted by the <CODE>declare</CODE> 7393builtin. Individual array elements may be assigned to using the 7394<CODE>name[</CODE><VAR>subscript</VAR><CODE>]=</CODE><VAR>value</VAR> syntax introduced above. 7395</P><P> 7396 7397Any element of an array may be referenced using 7398<CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>. 7399The braces are required to avoid 7400conflicts with the shell's filename expansion operators. If the 7401<VAR>subscript</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the word expands to all members 7402of the array <VAR>name</VAR>. These subscripts differ only when the word 7403appears within double quotes. 7404If the word is double-quoted, 7405<CODE>${name[*]}</CODE> expands to a single word with 7406the value of each array member separated by the first character of the 7407<CODE>IFS</CODE> variable, and <CODE>${name[@]}</CODE> expands each element of 7408<VAR>name</VAR> to a separate word. When there are no array members, 7409<CODE>${name[@]}</CODE> expands to nothing. 7410If the double-quoted expansion occurs within a word, the expansion of 7411the first parameter is joined with the beginning part of the original 7412word, and the expansion of the last parameter is joined with the last 7413part of the original word. 7414This is analogous to the 7415expansion of the special parameters <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP>. 7416<CODE>${#name[</CODE><VAR>subscript</VAR><CODE>]}</CODE> expands to the length of 7417<CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>. 7418If <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or 7419<SAMP>`*'</SAMP>, the expansion is the number of elements in the array. 7420Referencing an array variable without a subscript is equivalent to 7421referencing element zero. 7422</P><P> 7423 7424The <CODE>unset</CODE> builtin is used to destroy arrays. 7425<CODE>unset</CODE> <VAR>name</VAR>[<VAR>subscript</VAR>] 7426destroys the array element at index <VAR>subscript</VAR>. 7427Care must be taken to avoid unwanted side effects caused by filename 7428generation. 7429<CODE>unset</CODE> <VAR>name</VAR>, where <VAR>name</VAR> is an array, removes the 7430entire array. A subscript of <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP> also removes the 7431entire array. 7432</P><P> 7433 7434The <CODE>declare</CODE>, <CODE>local</CODE>, and <CODE>readonly</CODE> 7435builtins each accept a <SAMP>`-a'</SAMP> 7436option to specify an array. The <CODE>read</CODE> 7437builtin accepts a <SAMP>`-a'</SAMP> 7438option to assign a list of words read from the standard input 7439to an array, and can read values from the standard input into 7440individual array elements. The <CODE>set</CODE> and <CODE>declare</CODE> 7441builtins display array values in a way that allows them to be 7442reused as input. 7443</P><P> 7444 7445<A NAME="The Directory Stack"></A> 7446<HR SIZE="6"> 7447<A NAME="SEC82"></A> 7448<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 7449<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> < </A>]</TD> 7450<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> > </A>]</TD> 7451<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> << </A>]</TD> 7452<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 7453<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> >> </A>]</TD> 7454<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 7455<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 7456<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 7457<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 7458</TR></TABLE> 7459<H2> 6.8 The Directory Stack </H2> 7460<!--docid::SEC82::--> 7461<P> 7462 7463<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 7464<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC83">6.8.1 Directory Stack Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands to manipulate 7465 the directory stack.</TD></TR> 7466</TABLE></BLOCKQUOTE> 7467<P> 7468 7469The directory stack is a list of recently-visited directories. The 7470<CODE>pushd</CODE> builtin adds directories to the stack as it changes 7471the current directory, and the <CODE>popd</CODE> builtin removes specified 7472directories from the stack and changes the current directory to 7473the directory removed. The <CODE>dirs</CODE> builtin displays the contents 7474of the directory stack. 7475</P><P> 7476 7477The contents of the directory stack are also visible 7478as the value of the <CODE>DIRSTACK</CODE> shell variable. 7479</P><P> 7480 7481<A NAME="Directory Stack Builtins"></A> 7482<HR SIZE="6"> 7483<A NAME="SEC83"></A> 7484<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 7485<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> < </A>]</TD> 7486<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> > </A>]</TD> 7487<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> << </A>]</TD> 7488<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> Up </A>]</TD> 7489<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> >> </A>]</TD> 7490<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 7491<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 7492<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 7493<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 7494</TR></TABLE> 7495<H3> 6.8.1 Directory Stack Builtins </H3> 7496<!--docid::SEC83::--> 7497<P> 7498 7499<DL COMPACT> 7500 7501<DT><CODE>dirs</CODE> 7502<DD><A NAME="IDX272"></A> 7503<TABLE><tr><td> </td><td class=example><pre>dirs [+<VAR>N</VAR> | -<VAR>N</VAR>] [-clpv] 7504</pre></td></tr></table>Display the list of currently remembered directories. Directories 7505are added to the list with the <CODE>pushd</CODE> command; the 7506<CODE>popd</CODE> command removes directories from the list. 7507<DL COMPACT> 7508<DT><CODE>+<VAR>N</VAR></CODE> 7509<DD>Displays the <VAR>N</VAR>th directory (counting from the left of the 7510list printed by <CODE>dirs</CODE> when invoked without options), starting 7511with zero. 7512<DT><CODE>-<VAR>N</VAR></CODE> 7513<DD>Displays the <VAR>N</VAR>th directory (counting from the right of the 7514list printed by <CODE>dirs</CODE> when invoked without options), starting 7515with zero. 7516<DT><CODE>-c</CODE> 7517<DD>Clears the directory stack by deleting all of the elements. 7518<DT><CODE>-l</CODE> 7519<DD>Produces a longer listing; the default listing format uses a 7520tilde to denote the home directory. 7521<DT><CODE>-p</CODE> 7522<DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per 7523line. 7524<DT><CODE>-v</CODE> 7525<DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per 7526line, prefixing each entry with its index in the stack. 7527</DL> 7528<P> 7529 7530<DT><CODE>popd</CODE> 7531<DD><A NAME="IDX273"></A> 7532<TABLE><tr><td> </td><td class=example><pre>popd [+<VAR>N</VAR> | -<VAR>N</VAR>] [-n] 7533</pre></td></tr></table><P> 7534 7535Remove the top entry from the directory stack, and <CODE>cd</CODE> 7536to the new top directory. 7537When no arguments are given, <CODE>popd</CODE> 7538removes the top directory from the stack and 7539performs a <CODE>cd</CODE> to the new top directory. The 7540elements are numbered from 0 starting at the first directory listed with 7541<CODE>dirs</CODE>; i.e., <CODE>popd</CODE> is equivalent to <CODE>popd +0</CODE>. 7542<DL COMPACT> 7543<DT><CODE>+<VAR>N</VAR></CODE> 7544<DD>Removes the <VAR>N</VAR>th directory (counting from the left of the 7545list printed by <CODE>dirs</CODE>), starting with zero. 7546<DT><CODE>-<VAR>N</VAR></CODE> 7547<DD>Removes the <VAR>N</VAR>th directory (counting from the right of the 7548list printed by <CODE>dirs</CODE>), starting with zero. 7549<DT><CODE>-n</CODE> 7550<DD>Suppresses the normal change of directory when removing directories 7551from the stack, so that only the stack is manipulated. 7552</DL> 7553<P> 7554 7555<A NAME="IDX274"></A> 7556<DT><CODE>pushd</CODE> 7557<DD><TABLE><tr><td> </td><td class=example><pre>pushd [<VAR>dir</VAR> | <VAR>+N</VAR> | <VAR>-N</VAR>] [-n] 7558</pre></td></tr></table><P> 7559 7560Save the current directory on the top of the directory stack 7561and then <CODE>cd</CODE> to <VAR>dir</VAR>. 7562With no arguments, <CODE>pushd</CODE> exchanges the top two directories. 7563</P><P> 7564 7565<DL COMPACT> 7566<DT><CODE>+<VAR>N</VAR></CODE> 7567<DD>Brings the <VAR>N</VAR>th directory (counting from the left of the 7568list printed by <CODE>dirs</CODE>, starting with zero) to the top of 7569the list by rotating the stack. 7570<DT><CODE>-<VAR>N</VAR></CODE> 7571<DD>Brings the <VAR>N</VAR>th directory (counting from the right of the 7572list printed by <CODE>dirs</CODE>, starting with zero) to the top of 7573the list by rotating the stack. 7574<DT><CODE>-n</CODE> 7575<DD>Suppresses the normal change of directory when adding directories 7576to the stack, so that only the stack is manipulated. 7577<DT><CODE><VAR>dir</VAR></CODE> 7578<DD>Makes the current working directory be the top of the stack, and then 7579executes the equivalent of `<CODE>cd</CODE> <VAR>dir</VAR>'. 7580<CODE>cd</CODE>s to <VAR>dir</VAR>. 7581</DL> 7582<P> 7583 7584</DL> 7585<P> 7586 7587<A NAME="Printing a Prompt"></A> 7588<HR SIZE="6"> 7589<A NAME="SEC84"></A> 7590<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 7591<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> < </A>]</TD> 7592<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> > </A>]</TD> 7593<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD> 7594<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 7595<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 7596<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 7597<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 7598<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 7599<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 7600</TR></TABLE> 7601<H2> 6.9 Controlling the Prompt </H2> 7602<!--docid::SEC84::--> 7603<P> 7604 7605The value of the variable <CODE>PROMPT_COMMAND</CODE> is examined just before 7606Bash prints each primary prompt. If <CODE>PROMPT_COMMAND</CODE> is set and 7607has a non-null value, then the 7608value is executed just as if it had been typed on the command line. 7609</P><P> 7610 7611In addition, the following table describes the special characters which 7612can appear in the prompt variables: 7613</P><P> 7614 7615<DL COMPACT> 7616<DT><CODE>\a</CODE> 7617<DD>A bell character. 7618<DT><CODE>\d</CODE> 7619<DD>The date, in "Weekday Month Date" format (e.g., "Tue May 26"). 7620<DT><CODE>\D{<VAR>format</VAR>}</CODE> 7621<DD>The <VAR>format</VAR> is passed to <CODE>strftime</CODE>(3) and the result is inserted 7622into the prompt string; an empty <VAR>format</VAR> results in a locale-specific 7623time representation. The braces are required. 7624<DT><CODE>\e</CODE> 7625<DD>An escape character. 7626<DT><CODE>\h</CODE> 7627<DD>The hostname, up to the first `.'. 7628<DT><CODE>\H</CODE> 7629<DD>The hostname. 7630<DT><CODE>\j</CODE> 7631<DD>The number of jobs currently managed by the shell. 7632<DT><CODE>\l</CODE> 7633<DD>The basename of the shell's terminal device name. 7634<DT><CODE>\n</CODE> 7635<DD>A newline. 7636<DT><CODE>\r</CODE> 7637<DD>A carriage return. 7638<DT><CODE>\s</CODE> 7639<DD>The name of the shell, the basename of <CODE>$0</CODE> (the portion 7640following the final slash). 7641<DT><CODE>\t</CODE> 7642<DD>The time, in 24-hour HH:MM:SS format. 7643<DT><CODE>\T</CODE> 7644<DD>The time, in 12-hour HH:MM:SS format. 7645<DT><CODE>\@</CODE> 7646<DD>The time, in 12-hour am/pm format. 7647<DT><CODE>\A</CODE> 7648<DD>The time, in 24-hour HH:MM format. 7649<DT><CODE>\u</CODE> 7650<DD>The username of the current user. 7651<DT><CODE>\v</CODE> 7652<DD>The version of Bash (e.g., 2.00) 7653<DT><CODE>\V</CODE> 7654<DD>The release of Bash, version + patchlevel (e.g., 2.00.0) 7655<DT><CODE>\w</CODE> 7656<DD>The current working directory, with <CODE>$HOME</CODE> abbreviated with a tilde. 7657<DT><CODE>\W</CODE> 7658<DD>The basename of <CODE>$PWD</CODE>, with <CODE>$HOME</CODE> abbreviated with a tilde. 7659<DT><CODE>\!</CODE> 7660<DD>The history number of this command. 7661<DT><CODE>\#</CODE> 7662<DD>The command number of this command. 7663<DT><CODE>\$</CODE> 7664<DD>If the effective uid is 0, <CODE>#</CODE>, otherwise <CODE>$</CODE>. 7665<DT><CODE>\<VAR>nnn</VAR></CODE> 7666<DD>The character whose ASCII code is the octal value <VAR>nnn</VAR>. 7667<DT><CODE>\\</CODE> 7668<DD>A backslash. 7669<DT><CODE>\[</CODE> 7670<DD>Begin a sequence of non-printing characters. This could be used to 7671embed a terminal control sequence into the prompt. 7672<DT><CODE>\]</CODE> 7673<DD>End a sequence of non-printing characters. 7674</DL> 7675<P> 7676 7677The command number and the history number are usually different: 7678the history number of a command is its position in the history 7679list, which may include commands restored from the history file 7680(see section <A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A>), while the command number is 7681the position in the sequence of commands executed during the current 7682shell session. 7683</P><P> 7684 7685After the string is decoded, it is expanded via 7686parameter expansion, command substitution, arithmetic 7687expansion, and quote removal, subject to the value of the 7688<CODE>promptvars</CODE> shell option (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 7689</P><P> 7690 7691<A NAME="The Restricted Shell"></A> 7692<HR SIZE="6"> 7693<A NAME="SEC85"></A> 7694<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 7695<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> < </A>]</TD> 7696<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> > </A>]</TD> 7697<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> << </A>]</TD> 7698<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 7699<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 7700<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 7701<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 7702<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 7703<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 7704</TR></TABLE> 7705<H2> 6.10 The Restricted Shell </H2> 7706<!--docid::SEC85::--> 7707<P> 7708 7709If Bash is started with the name <CODE>rbash</CODE>, or the 7710<SAMP>`--restricted'</SAMP> 7711or 7712<SAMP>`-r'</SAMP> 7713option is supplied at invocation, the shell becomes restricted. 7714A restricted shell is used to 7715set up an environment more controlled than the standard shell. 7716A restricted shell behaves identically to <CODE>bash</CODE> 7717with the exception that the following are disallowed or not performed: 7718</P><P> 7719 7720<UL> 7721<LI> 7722Changing directories with the <CODE>cd</CODE> builtin. 7723<LI> 7724Setting or unsetting the values of the <CODE>SHELL</CODE>, <CODE>PATH</CODE>, 7725<CODE>ENV</CODE>, or <CODE>BASH_ENV</CODE> variables. 7726<LI> 7727Specifying command names containing slashes. 7728<LI> 7729Specifying a filename containing a slash as an argument to the <CODE>.</CODE> 7730builtin command. 7731<LI> 7732Specifying a filename containing a slash as an argument to the <SAMP>`-p'</SAMP> 7733option to the <CODE>hash</CODE> builtin command. 7734<LI> 7735Importing function definitions from the shell environment at startup. 7736<LI> 7737Parsing the value of <CODE>SHELLOPTS</CODE> from the shell environment at startup. 7738<LI> 7739Redirecting output using the <SAMP>`>'</SAMP>, <SAMP>`>|'</SAMP>, <SAMP>`<>'</SAMP>, <SAMP>`>&'</SAMP>, 7740<SAMP>`&>'</SAMP>, and <SAMP>`>>'</SAMP> redirection operators. 7741<LI> 7742Using the <CODE>exec</CODE> builtin to replace the shell with another command. 7743<LI> 7744Adding or deleting builtin commands with the 7745<SAMP>`-f'</SAMP> and <SAMP>`-d'</SAMP> options to the <CODE>enable</CODE> builtin. 7746<LI> 7747Using the <CODE>enable</CODE> builtin command to enable disabled shell builtins. 7748<LI> 7749Specifying the <SAMP>`-p'</SAMP> option to the <CODE>command</CODE> builtin. 7750<LI> 7751Turning off restricted mode with <SAMP>`set +r'</SAMP> or <SAMP>`set +o restricted'</SAMP>. 7752</UL> 7753<P> 7754 7755These restrictions are enforced after any startup files are read. 7756</P><P> 7757 7758When a command that is found to be a shell script is executed 7759(see section <A HREF="bashref.html#SEC55">3.8 Shell Scripts</A>), <CODE>rbash</CODE> turns off any restrictions in 7760the shell spawned to execute the script. 7761</P><P> 7762 7763<A NAME="Bash POSIX Mode"></A> 7764<HR SIZE="6"> 7765<A NAME="SEC86"></A> 7766<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 7767<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> < </A>]</TD> 7768<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> > </A>]</TD> 7769<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> << </A>]</TD> 7770<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> Up </A>]</TD> 7771<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> >> </A>]</TD> 7772<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 7773<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 7774<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 7775<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 7776</TR></TABLE> 7777<H2> 6.11 Bash POSIX Mode </H2> 7778<!--docid::SEC86::--> 7779<P> 7780 7781Starting Bash with the <SAMP>`--posix'</SAMP> command-line option or executing 7782<SAMP>`set -o posix'</SAMP> while Bash is running will cause Bash to conform more 7783closely to the POSIX 1003.2 standard by changing the behavior to 7784match that specified by POSIX in areas where the Bash default differs. 7785</P><P> 7786 7787When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after reading the 7788startup files. 7789</P><P> 7790 7791The following list is what's changed when `POSIX mode' is in effect: 7792</P><P> 7793 7794<OL> 7795<LI> 7796When a command in the hash table no longer exists, Bash will re-search 7797<CODE>$PATH</CODE> to find the new location. This is also available with 7798<SAMP>`shopt -s checkhash'</SAMP>. 7799<P> 7800 7801<LI> 7802The message printed by the job control code and builtins when a job 7803exits with a non-zero status is `Done(status)'. 7804<P> 7805 7806<LI> 7807The message printed by the job control code and builtins when a job 7808is stopped is `Stopped(<VAR>signame</VAR>)', where <VAR>signame</VAR> is, for 7809example, <CODE>SIGTSTP</CODE>. 7810<P> 7811 7812<LI> 7813The <CODE>bg</CODE> builtin uses the required format to describe each job placed 7814in the background, which does not include an indication of whether the job 7815is the current or previous job. 7816<P> 7817 7818<LI> 7819Reserved words appearing in a context where reserved words are recognized 7820do not undergo alias expansion. 7821<P> 7822 7823<LI> 7824The POSIX 1003.2 <CODE>PS1</CODE> and <CODE>PS2</CODE> expansions of <SAMP>`!'</SAMP> to 7825the history number and <SAMP>`!!'</SAMP> to <SAMP>`!'</SAMP> are enabled, 7826and parameter expansion is performed on the values of <CODE>PS1</CODE> and 7827<CODE>PS2</CODE> regardless of the setting of the <CODE>promptvars</CODE> option. 7828<P> 7829 7830<LI> 7831The POSIX 1003.2 startup files are executed (<CODE>$ENV</CODE>) rather than 7832the normal Bash files. 7833<P> 7834 7835<LI> 7836Tilde expansion is only performed on assignments preceding a command 7837name, rather than on all assignment statements on the line. 7838<P> 7839 7840<LI> 7841The default history file is <TT>`~/.sh_history'</TT> (this is the 7842default value of <CODE>$HISTFILE</CODE>). 7843<P> 7844 7845<LI> 7846The output of <SAMP>`kill -l'</SAMP> prints all the signal names on a single line, 7847separated by spaces, without the <SAMP>`SIG'</SAMP> prefix. 7848<P> 7849 7850<LI> 7851The <CODE>kill</CODE> builtin does not accept signal names with a <SAMP>`SIG'</SAMP> 7852prefix. 7853<P> 7854 7855<LI> 7856Non-interactive shells exit if <VAR>filename</VAR> in <CODE>.</CODE> <VAR>filename</VAR> 7857is not found. 7858<P> 7859 7860<LI> 7861Non-interactive shells exit if a syntax error in an arithmetic expansion 7862results in an invalid expression. 7863<P> 7864 7865<LI> 7866Redirection operators do not perform filename expansion on the word 7867in the redirection unless the shell is interactive. 7868<P> 7869 7870<LI> 7871Redirection operators do not perform word splitting on the word in the 7872redirection. 7873<P> 7874 7875<LI> 7876Function names must be valid shell <CODE>name</CODE>s. That is, they may not 7877contain characters other than letters, digits, and underscores, and 7878may not start with a digit. Declaring a function with an invalid name 7879causes a fatal syntax error in non-interactive shells. 7880<P> 7881 7882<LI> 7883POSIX 1003.2 special builtins are found before shell functions 7884during command lookup. 7885<P> 7886 7887<LI> 7888If a POSIX 1003.2 special builtin returns an error status, a 7889non-interactive shell exits. The fatal errors are those listed in 7890the POSIX.2 standard, and include things like passing incorrect options, 7891redirection errors, variable assignment errors for assignments preceding 7892the command name, and so on. 7893<P> 7894 7895<LI> 7896If <CODE>CDPATH</CODE> is set, the <CODE>cd</CODE> builtin will not implicitly 7897append the current directory to it. This means that <CODE>cd</CODE> will 7898fail if no valid directory name can be constructed from 7899any of the entries in <CODE>$CDPATH</CODE>, even if the a directory with 7900the same name as the name given as an argument to <CODE>cd</CODE> exists 7901in the current directory. 7902<P> 7903 7904<LI> 7905A non-interactive shell exits with an error status if a variable 7906assignment error occurs when no command name follows the assignment 7907statements. 7908A variable assignment error occurs, for example, when trying to assign 7909a value to a readonly variable. 7910<P> 7911 7912<LI> 7913A non-interactive shell exits with an error status if the iteration 7914variable in a <CODE>for</CODE> statement or the selection variable in a 7915<CODE>select</CODE> statement is a readonly variable. 7916<P> 7917 7918<LI> 7919Process substitution is not available. 7920<P> 7921 7922<LI> 7923Assignment statements preceding POSIX 1003.2 special builtins 7924persist in the shell environment after the builtin completes. 7925<P> 7926 7927<LI> 7928Assignment statements preceding shell function calls persist in the 7929shell environment after the function returns, as if a POSIX 7930special builtin command had been executed. 7931<P> 7932 7933<LI> 7934The <CODE>export</CODE> and <CODE>readonly</CODE> builtin commands display their 7935output in the format required by POSIX 1003.2. 7936<P> 7937 7938<LI> 7939The <CODE>trap</CODE> builtin displays signal names without the leading 7940<CODE>SIG</CODE>. 7941<P> 7942 7943<LI> 7944The <CODE>trap</CODE> builtin doesn't check the first argument for a possible 7945signal specification and revert the signal handling to the original 7946disposition if it is, unless that argument consists solely of digits and 7947is a valid signal number. If users want to reset the handler for a given 7948signal to the original disposition, they should use <SAMP>`-'</SAMP> as the 7949first argument. 7950<P> 7951 7952<LI> 7953The <CODE>.</CODE> and <CODE>source</CODE> builtins do not search the current directory 7954for the filename argument if it is not found by searching <CODE>PATH</CODE>. 7955<P> 7956 7957<LI> 7958Subshells spawned to execute command substitutions inherit the value of 7959the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode, 7960Bash clears the <SAMP>`-e'</SAMP> option in such subshells. 7961<P> 7962 7963<LI> 7964Alias expansion is always enabled, even in non-interactive shells. 7965<P> 7966 7967<LI> 7968When the <CODE>alias</CODE> builtin displays alias definitions, it does not 7969display them with a leading <SAMP>`alias '</SAMP> unless the <SAMP>`-p'</SAMP> option 7970is supplied. 7971<P> 7972 7973<LI> 7974When the <CODE>set</CODE> builtin is invoked without options, it does not display 7975shell function names and definitions. 7976<P> 7977 7978<LI> 7979When the <CODE>set</CODE> builtin is invoked without options, it displays 7980variable values without quotes, unless they contain shell metacharacters, 7981even if the result contains nonprinting characters. 7982<P> 7983 7984<LI> 7985When the <CODE>cd</CODE> builtin is invoked in <VAR>logical</VAR> mode, and the pathname 7986constructed from <CODE>$PWD</CODE> and the directory name supplied as an argument 7987does not refer to an existing directory, <CODE>cd</CODE> will fail instead of 7988falling back to <VAR>physical</VAR> mode. 7989<P> 7990 7991<LI> 7992When the <CODE>pwd</CODE> builtin is supplied the <SAMP>`-P'</SAMP> option, it resets 7993<CODE>$PWD</CODE> to a pathname containing no symlinks. 7994<P> 7995 7996<LI> 7997The <CODE>pwd</CODE> builtin verifies that the value it prints is the same as the 7998current directory, even if it is not asked to check the file system with the 7999<SAMP>`-P'</SAMP> option. 8000<P> 8001 8002<LI> 8003When listing the history, the <CODE>fc</CODE> builtin does not include an 8004indication of whether or not a history entry has been modified. 8005<P> 8006 8007<LI> 8008The default editor used by <CODE>fc</CODE> is <CODE>ed</CODE>. 8009<P> 8010 8011<LI> 8012The <CODE>type</CODE> and <CODE>command</CODE> builtins will not report a non-executable 8013file as having been found, though the shell will attempt to execute such a 8014file if it is the only so-named file found in <CODE>$PATH</CODE>. 8015<P> 8016 8017<LI> 8018The <CODE>vi</CODE> editing mode will invoke the <CODE>vi</CODE> editor directly when 8019the <SAMP>`v'</SAMP> command is run, instead of checking <CODE>$FCEDIT</CODE> and 8020<CODE>$EDITOR</CODE>. 8021<P> 8022 8023<LI> 8024When the <CODE>xpg_echo</CODE> option is enabled, Bash does not attempt to interpret 8025any arguments to <CODE>echo</CODE> as options. Each argument is displayed, after 8026escape characters are converted. 8027<P> 8028 8029</OL> 8030<P> 8031 8032There is other POSIX 1003.2 behavior that Bash does not implement by 8033default even when in POSIX mode. 8034Specifically: 8035</P><P> 8036 8037<OL> 8038 8039<LI> 8040The <CODE>fc</CODE> builtin checks <CODE>$EDITOR</CODE> as a program to edit history 8041entries if <CODE>FCEDIT</CODE> is unset, rather than defaulting directly to 8042<CODE>ed</CODE>. <CODE>fc</CODE> uses <CODE>ed</CODE> if <CODE>EDITOR</CODE> is unset. 8043<P> 8044 8045<LI> 8046As noted above, Bash requires the <CODE>xpg_echo</CODE> option to be enabled for 8047the <CODE>echo</CODE> builtin to be fully conformant. 8048<P> 8049 8050</OL> 8051<P> 8052 8053Bash can be configured to be POSIX-conformant by default, by specifying 8054the <SAMP>`--enable-strict-posix-default'</SAMP> to <CODE>configure</CODE> when building 8055(see section <A HREF="bashref.html#SEC130">10.8 Optional Features</A>). 8056</P><P> 8057 8058<A NAME="Job Control"></A> 8059<HR SIZE="6"> 8060<A NAME="SEC87"></A> 8061<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8062<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> < </A>]</TD> 8063<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> > </A>]</TD> 8064<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD> 8065<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 8066<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> 8067<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8068<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8069<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8070<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8071</TR></TABLE> 8072<H1> 7. Job Control </H1> 8073<!--docid::SEC87::--> 8074<P> 8075 8076This chapter discusses what job control is, how it works, and how 8077Bash allows you to access its facilities. 8078</P><P> 8079 8080<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 8081<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC88">7.1 Job Control Basics</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How job control works.</TD></TR> 8082<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands used to interact 8083 with job control.</TD></TR> 8084<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC90">7.3 Job Control Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables Bash uses to customize job 8085 control.</TD></TR> 8086</TABLE></BLOCKQUOTE> 8087<P> 8088 8089<A NAME="Job Control Basics"></A> 8090<HR SIZE="6"> 8091<A NAME="SEC88"></A> 8092<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8093<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> < </A>]</TD> 8094<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> > </A>]</TD> 8095<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> << </A>]</TD> 8096<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> Up </A>]</TD> 8097<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> 8098<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8099<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8100<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8101<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8102</TR></TABLE> 8103<H2> 7.1 Job Control Basics </H2> 8104<!--docid::SEC88::--> 8105<P> 8106 8107Job control 8108refers to the ability to selectively stop (suspend) 8109the execution of processes and continue (resume) 8110their execution at a later point. A user typically employs 8111this facility via an interactive interface supplied jointly 8112by the system's terminal driver and Bash. 8113</P><P> 8114 8115The shell associates a <VAR>job</VAR> with each pipeline. It keeps a 8116table of currently executing jobs, which may be listed with the 8117<CODE>jobs</CODE> command. When Bash starts a job 8118asynchronously, it prints a line that looks 8119like: 8120<TABLE><tr><td> </td><td class=example><pre>[1] 25647 8121</pre></td></tr></table>indicating that this job is job number 1 and that the process ID 8122of the last process in the pipeline associated with this job is 812325647. All of the processes in a single pipeline are members of 8124the same job. Bash uses the <VAR>job</VAR> abstraction as the 8125basis for job control. 8126</P><P> 8127 8128To facilitate the implementation of the user interface to job 8129control, the operating system maintains the notion of a current terminal 8130process group ID. Members of this process group (processes whose 8131process group ID is equal to the current terminal process group 8132ID) receive keyboard-generated signals such as <CODE>SIGINT</CODE>. 8133These processes are said to be in the foreground. Background 8134processes are those whose process group ID differs from the 8135terminal's; such processes are immune to keyboard-generated 8136signals. Only foreground processes are allowed to read from or 8137write to the terminal. Background processes which attempt to 8138read from (write to) the terminal are sent a <CODE>SIGTTIN</CODE> 8139(<CODE>SIGTTOU</CODE>) signal by the terminal driver, which, unless 8140caught, suspends the process. 8141</P><P> 8142 8143If the operating system on which Bash is running supports 8144job control, Bash contains facilities to use it. Typing the 8145<VAR>suspend</VAR> character (typically <SAMP>`^Z'</SAMP>, Control-Z) while a 8146process is running causes that process to be stopped and returns 8147control to Bash. Typing the <VAR>delayed suspend</VAR> character 8148(typically <SAMP>`^Y'</SAMP>, Control-Y) causes the process to be stopped 8149when it attempts to read input from the terminal, and control to 8150be returned to Bash. The user then manipulates the state of 8151this job, using the <CODE>bg</CODE> command to continue it in the 8152background, the <CODE>fg</CODE> command to continue it in the 8153foreground, or the <CODE>kill</CODE> command to kill it. A <SAMP>`^Z'</SAMP> 8154takes effect immediately, and has the additional side effect of 8155causing pending output and typeahead to be discarded. 8156</P><P> 8157 8158There are a number of ways to refer to a job in the shell. The 8159character <SAMP>`%'</SAMP> introduces a job name. 8160</P><P> 8161 8162Job number <CODE>n</CODE> may be referred to as <SAMP>`%n'</SAMP>. 8163The symbols <SAMP>`%%'</SAMP> and <SAMP>`%+'</SAMP> refer to the shell's notion of the 8164current job, which is the last job stopped while it was in the foreground 8165or started in the background. 8166A single <SAMP>`%'</SAMP> (with no accompanying job specification) also refers 8167to the current job. 8168The previous job may be referenced using <SAMP>`%-'</SAMP>. In output 8169pertaining to jobs (e.g., the output of the <CODE>jobs</CODE> command), 8170the current job is always flagged with a <SAMP>`+'</SAMP>, and the 8171previous job with a <SAMP>`-'</SAMP>. 8172</P><P> 8173 8174A job may also be referred to 8175using a prefix of the name used to start it, or using a substring 8176that appears in its command line. For example, <SAMP>`%ce'</SAMP> refers 8177to a stopped <CODE>ce</CODE> job. Using <SAMP>`%?ce'</SAMP>, on the 8178other hand, refers to any job containing the string <SAMP>`ce'</SAMP> in 8179its command line. If the prefix or substring matches more than one job, 8180Bash reports an error. 8181</P><P> 8182 8183Simply naming a job can be used to bring it into the foreground: 8184<SAMP>`%1'</SAMP> is a synonym for <SAMP>`fg %1'</SAMP>, bringing job 1 from the 8185background into the foreground. Similarly, <SAMP>`%1 &'</SAMP> resumes 8186job 1 in the background, equivalent to <SAMP>`bg %1'</SAMP> 8187</P><P> 8188 8189The shell learns immediately whenever a job changes state. 8190Normally, Bash waits until it is about to print a prompt 8191before reporting changes in a job's status so as to not interrupt 8192any other output. 8193If the <SAMP>`-b'</SAMP> option to the <CODE>set</CODE> builtin is enabled, 8194Bash reports such changes immediately (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 8195Any trap on <CODE>SIGCHLD</CODE> is executed for each child process 8196that exits. 8197</P><P> 8198 8199If an attempt to exit Bash is made while jobs are stopped, the 8200shell prints a message warning that there are stopped jobs. 8201The <CODE>jobs</CODE> command may then be used to inspect their status. 8202If a second attempt to exit is made without an intervening command, 8203Bash does not print another warning, and the stopped jobs are terminated. 8204</P><P> 8205 8206<A NAME="Job Control Builtins"></A> 8207<HR SIZE="6"> 8208<A NAME="SEC89"></A> 8209<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8210<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> < </A>]</TD> 8211<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> > </A>]</TD> 8212<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> << </A>]</TD> 8213<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> Up </A>]</TD> 8214<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> 8215<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8216<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8217<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8218<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8219</TR></TABLE> 8220<H2> 7.2 Job Control Builtins </H2> 8221<!--docid::SEC89::--> 8222<P> 8223 8224<DL COMPACT> 8225 8226<DT><CODE>bg</CODE> 8227<DD><A NAME="IDX275"></A> 8228<TABLE><tr><td> </td><td class=example><pre>bg [<VAR>jobspec</VAR> <small>...</small>] 8229</pre></td></tr></table>Resume each suspended job <VAR>jobspec</VAR> in the background, as if it 8230had been started with <SAMP>`&'</SAMP>. 8231If <VAR>jobspec</VAR> is not supplied, the current job is used. 8232The return status is zero unless it is run when job control is not 8233enabled, or, when run with job control enabled, any 8234<VAR>jobspec</VAR> was not found or specifies a job 8235that was started without job control. 8236<P> 8237 8238<DT><CODE>fg</CODE> 8239<DD><A NAME="IDX276"></A> 8240<TABLE><tr><td> </td><td class=example><pre>fg [<VAR>jobspec</VAR>] 8241</pre></td></tr></table>Resume the job <VAR>jobspec</VAR> in the foreground and make it the current job. 8242If <VAR>jobspec</VAR> is not supplied, the current job is used. 8243The return status is that of the command placed into the foreground, 8244or non-zero if run when job control is disabled or, when run with 8245job control enabled, <VAR>jobspec</VAR> does not specify a valid job or 8246<VAR>jobspec</VAR> specifies a job that was started without job control. 8247<P> 8248 8249<DT><CODE>jobs</CODE> 8250<DD><A NAME="IDX277"></A> 8251<TABLE><tr><td> </td><td class=example><pre>jobs [-lnprs] [<VAR>jobspec</VAR>] 8252jobs -x <VAR>command</VAR> [<VAR>arguments</VAR>] 8253</pre></td></tr></table><P> 8254 8255The first form lists the active jobs. The options have the 8256following meanings: 8257</P><P> 8258 8259<DL COMPACT> 8260<DT><CODE>-l</CODE> 8261<DD>List process IDs in addition to the normal information. 8262<P> 8263 8264<DT><CODE>-n</CODE> 8265<DD>Display information only about jobs that have changed status since 8266the user was last notified of their status. 8267<P> 8268 8269<DT><CODE>-p</CODE> 8270<DD>List only the process ID of the job's process group leader. 8271<P> 8272 8273<DT><CODE>-r</CODE> 8274<DD>Restrict output to running jobs. 8275<P> 8276 8277<DT><CODE>-s</CODE> 8278<DD>Restrict output to stopped jobs. 8279</DL> 8280<P> 8281 8282If <VAR>jobspec</VAR> is given, 8283output is restricted to information about that job. 8284If <VAR>jobspec</VAR> is not supplied, the status of all jobs is 8285listed. 8286</P><P> 8287 8288If the <SAMP>`-x'</SAMP> option is supplied, <CODE>jobs</CODE> replaces any 8289<VAR>jobspec</VAR> found in <VAR>command</VAR> or <VAR>arguments</VAR> with the 8290corresponding process group ID, and executes <VAR>command</VAR>, 8291passing it <VAR>argument</VAR>s, returning its exit status. 8292</P><P> 8293 8294<DT><CODE>kill</CODE> 8295<DD><A NAME="IDX278"></A> 8296<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> 8297kill -l [<VAR>exit_status</VAR>] 8298</pre></td></tr></table>Send a signal specified by <VAR>sigspec</VAR> or <VAR>signum</VAR> to the process 8299named by job specification <VAR>jobspec</VAR> or process ID <VAR>pid</VAR>. 8300<VAR>sigspec</VAR> is either a case-insensitive signal name such as 8301<CODE>SIGINT</CODE> (with or without the <CODE>SIG</CODE> prefix) 8302or a signal number; <VAR>signum</VAR> is a signal number. 8303If <VAR>sigspec</VAR> and <VAR>signum</VAR> are not present, <CODE>SIGTERM</CODE> is used. 8304The <SAMP>`-l'</SAMP> option lists the signal names. 8305If any arguments are supplied when <SAMP>`-l'</SAMP> is given, the names of the 8306signals corresponding to the arguments are listed, and the return status 8307is zero. 8308<VAR>exit_status</VAR> is a number specifying a signal number or the exit 8309status of a process terminated by a signal. 8310The return status is zero if at least one signal was successfully sent, 8311or non-zero if an error occurs or an invalid option is encountered. 8312<P> 8313 8314<DT><CODE>wait</CODE> 8315<DD><A NAME="IDX279"></A> 8316<TABLE><tr><td> </td><td class=example><pre>wait [<VAR>jobspec</VAR> or <VAR>pid</VAR> ...] 8317</pre></td></tr></table>Wait until the child process specified by each process ID <VAR>pid</VAR> 8318or job specification <VAR>jobspec</VAR> exits and return the exit status of the 8319last command waited for. 8320If a job spec is given, all processes in the job are waited for. 8321If no arguments are given, all currently active child processes are 8322waited for, and the return status is zero. 8323If neither <VAR>jobspec</VAR> nor <VAR>pid</VAR> specifies an active child process 8324of the shell, the return status is 127. 8325<P> 8326 8327<DT><CODE>disown</CODE> 8328<DD><A NAME="IDX280"></A> 8329<TABLE><tr><td> </td><td class=example><pre>disown [-ar] [-h] [<VAR>jobspec</VAR> <small>...</small>] 8330</pre></td></tr></table>Without options, each <VAR>jobspec</VAR> is removed from the table of 8331active jobs. 8332If the <SAMP>`-h'</SAMP> option is given, the job is not removed from the table, 8333but is marked so that <CODE>SIGHUP</CODE> is not sent to the job if the shell 8334receives a <CODE>SIGHUP</CODE>. 8335If <VAR>jobspec</VAR> is not present, and neither the <SAMP>`-a'</SAMP> nor <SAMP>`-r'</SAMP> 8336option is supplied, the current job is used. 8337If no <VAR>jobspec</VAR> is supplied, the <SAMP>`-a'</SAMP> option means to remove or 8338mark all jobs; the <SAMP>`-r'</SAMP> option without a <VAR>jobspec</VAR> 8339argument restricts operation to running jobs. 8340<P> 8341 8342<DT><CODE>suspend</CODE> 8343<DD><A NAME="IDX281"></A> 8344<TABLE><tr><td> </td><td class=example><pre>suspend [-f] 8345</pre></td></tr></table>Suspend the execution of this shell until it receives a 8346<CODE>SIGCONT</CODE> signal. The <SAMP>`-f'</SAMP> option means to suspend 8347even if the shell is a login shell. 8348<P> 8349 8350</DL> 8351<P> 8352 8353When job control is not active, the <CODE>kill</CODE> and <CODE>wait</CODE> 8354builtins do not accept <VAR>jobspec</VAR> arguments. They must be 8355supplied process IDs. 8356</P><P> 8357 8358<A NAME="Job Control Variables"></A> 8359<HR SIZE="6"> 8360<A NAME="SEC90"></A> 8361<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8362<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> < </A>]</TD> 8363<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> > </A>]</TD> 8364<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> << </A>]</TD> 8365<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> Up </A>]</TD> 8366<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD> 8367<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8368<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8369<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8370<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8371</TR></TABLE> 8372<H2> 7.3 Job Control Variables </H2> 8373<!--docid::SEC90::--> 8374<P> 8375 8376<DL COMPACT> 8377 8378<A NAME="IDX282"></A> 8379<DT><CODE>auto_resume</CODE> 8380<DD><A NAME="IDX283"></A> 8381This variable controls how the shell interacts with the user and 8382job control. If this variable exists then single word simple 8383commands without redirections are treated as candidates for resumption 8384of an existing job. There is no ambiguity allowed; if there is 8385more than one job beginning with the string typed, then 8386the most recently accessed job will be selected. 8387The name of a stopped job, in this context, is the command line 8388used to start it. If this variable is set to the value <SAMP>`exact'</SAMP>, 8389the string supplied must match the name of a stopped job exactly; 8390if set to <SAMP>`substring'</SAMP>, 8391the string supplied needs to match a substring of the name of a 8392stopped job. The <SAMP>`substring'</SAMP> value provides functionality 8393analogous to the <SAMP>`%?'</SAMP> job ID (see section <A HREF="bashref.html#SEC88">7.1 Job Control Basics</A>). 8394If set to any other value, the supplied string must 8395be a prefix of a stopped job's name; this provides functionality 8396analogous to the <SAMP>`%'</SAMP> job ID. 8397<P> 8398 8399</DL> 8400<P> 8401 8402<A NAME="IDX284"></A> 8403</P><P> 8404 8405<A NAME="Command Line Editing"></A> 8406<HR SIZE="6"> 8407<A NAME="SEC91"></A> 8408<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8409<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> < </A>]</TD> 8410<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> > </A>]</TD> 8411<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> << </A>]</TD> 8412<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 8413<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> >> </A>]</TD> 8414<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8415<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8416<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8417<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8418</TR></TABLE> 8419<H1> 8. Command Line Editing </H1> 8420<!--docid::SEC91::--> 8421<P> 8422 8423This chapter describes the basic features of the GNU 8424command line editing interface. 8425Command line editing is provided by the Readline library, which is 8426used by several different programs, including Bash. 8427</P><P> 8428 8429<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 8430<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC92">8.1 Introduction to Line Editing</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Notation used in this text.</TD></TR> 8431<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC93">8.2 Readline Interaction</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The minimum set of commands for editing a line.</TD></TR> 8432<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC99">8.3 Readline Init File</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Customizing Readline from a user's view.</TD></TR> 8433<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC103">8.4 Bindable Readline Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A description of most of the Readline commands 8434 available for binding</TD></TR> 8435<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC112">8.5 Readline vi Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A short description of how to make Readline 8436 behave like the vi editor.</TD></TR> 8437<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC113">8.6 Programmable Completion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify the possible completions for 8438 a specific command.</TD></TR> 8439<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC114">8.7 Programmable Completion Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands to specify how to 8440 complete arguments for a particular command.</TD></TR> 8441</TABLE></BLOCKQUOTE> 8442<P> 8443 8444<A NAME="Introduction and Notation"></A> 8445<HR SIZE="6"> 8446<A NAME="SEC92"></A> 8447<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8448<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> < </A>]</TD> 8449<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> > </A>]</TD> 8450<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD> 8451<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> 8452<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> >> </A>]</TD> 8453<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8454<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8455<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8456<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8457</TR></TABLE> 8458<H2> 8.1 Introduction to Line Editing </H2> 8459<!--docid::SEC92::--> 8460<P> 8461 8462The following paragraphs describe the notation used to represent 8463keystrokes. 8464</P><P> 8465 8466The text <KBD>C-k</KBD> is read as `Control-K' and describes the character 8467produced when the <KBD>k</KBD> key is pressed while the Control key 8468is depressed. 8469</P><P> 8470 8471The text <KBD>M-k</KBD> is read as `Meta-K' and describes the character 8472produced when the Meta key (if you have one) is depressed, and the <KBD>k</KBD> 8473key is pressed. 8474The Meta key is labeled <KBD>ALT</KBD> on many keyboards. 8475On keyboards with two keys labeled <KBD>ALT</KBD> (usually to either side of 8476the space bar), the <KBD>ALT</KBD> on the left side is generally set to 8477work as a Meta key. 8478The <KBD>ALT</KBD> key on the right may also be configured to work as a 8479Meta key or may be configured as some other modifier, such as a 8480Compose key for typing accented characters. 8481</P><P> 8482 8483If you do not have a Meta or <KBD>ALT</KBD> key, or another key working as 8484a Meta key, the identical keystroke can be generated by typing <KBD>ESC</KBD> 8485<EM>first</EM>, and then typing <KBD>k</KBD>. 8486Either process is known as <EM>metafying</EM> the <KBD>k</KBD> key. 8487</P><P> 8488 8489The text <KBD>M-C-k</KBD> is read as `Meta-Control-k' and describes the 8490character produced by <EM>metafying</EM> <KBD>C-k</KBD>. 8491</P><P> 8492 8493In addition, several keys have their own names. Specifically, 8494<KBD>DEL</KBD>, <KBD>ESC</KBD>, <KBD>LFD</KBD>, <KBD>SPC</KBD>, <KBD>RET</KBD>, and <KBD>TAB</KBD> all 8495stand for themselves when seen in this text, or in an init file 8496(see section <A HREF="bashref.html#SEC99">8.3 Readline Init File</A>). 8497If your keyboard lacks a <KBD>LFD</KBD> key, typing <KBD>C-j</KBD> will 8498produce the desired character. 8499The <KBD>RET</KBD> key may be labeled <KBD>Return</KBD> or <KBD>Enter</KBD> on 8500some keyboards. 8501</P><P> 8502 8503<A NAME="Readline Interaction"></A> 8504<HR SIZE="6"> 8505<A NAME="SEC93"></A> 8506<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8507<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> < </A>]</TD> 8508<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> > </A>]</TD> 8509<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> << </A>]</TD> 8510<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> 8511<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> >> </A>]</TD> 8512<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8513<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8514<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8515<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8516</TR></TABLE> 8517<H2> 8.2 Readline Interaction </H2> 8518<!--docid::SEC93::--> 8519<P> 8520 8521Often during an interactive session you type in a long line of text, 8522only to notice that the first word on the line is misspelled. The 8523Readline library gives you a set of commands for manipulating the text 8524as you type it in, allowing you to just fix your typo, and not forcing 8525you to retype the majority of the line. Using these editing commands, 8526you move the cursor to the place that needs correction, and delete or 8527insert the text of the corrections. Then, when you are satisfied with 8528the line, you simply press <KBD>RET</KBD>. You do not have to be at the 8529end of the line to press <KBD>RET</KBD>; the entire line is accepted 8530regardless of the location of the cursor within the line. 8531</P><P> 8532 8533<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 8534<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC94">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> 8535<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC95">8.2.2 Readline Movement Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the input line.</TD></TR> 8536<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC96">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> 8537<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC97">8.2.4 Readline Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Giving numeric arguments to commands.</TD></TR> 8538<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC98">8.2.5 Searching for Commands in the History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Searching through previous lines.</TD></TR> 8539</TABLE></BLOCKQUOTE> 8540<P> 8541 8542<A NAME="Readline Bare Essentials"></A> 8543<HR SIZE="6"> 8544<A NAME="SEC94"></A> 8545<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8546<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> < </A>]</TD> 8547<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> > </A>]</TD> 8548<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> << </A>]</TD> 8549<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> Up </A>]</TD> 8550<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> >> </A>]</TD> 8551<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8552<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8553<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8554<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8555</TR></TABLE> 8556<H3> 8.2.1 Readline Bare Essentials </H3> 8557<!--docid::SEC94::--> 8558<P> 8559 8560In order to enter characters into the line, simply type them. The typed 8561character appears where the cursor was, and then the cursor moves one 8562space to the right. If you mistype a character, you can use your 8563erase character to back up and delete the mistyped character. 8564</P><P> 8565 8566Sometimes you may mistype a character, and 8567not notice the error until you have typed several other characters. In 8568that case, you can type <KBD>C-b</KBD> to move the cursor to the left, and then 8569correct your mistake. Afterwards, you can move the cursor to the right 8570with <KBD>C-f</KBD>. 8571</P><P> 8572 8573When you add text in the middle of a line, you will notice that characters 8574to the right of the cursor are `pushed over' to make room for the text 8575that you have inserted. Likewise, when you delete text behind the cursor, 8576characters to the right of the cursor are `pulled back' to fill in the 8577blank space created by the removal of the text. A list of the bare 8578essentials for editing the text of an input line follows. 8579</P><P> 8580 8581<DL COMPACT> 8582<DT><KBD>C-b</KBD> 8583<DD>Move back one character. 8584<DT><KBD>C-f</KBD> 8585<DD>Move forward one character. 8586<DT><KBD>DEL</KBD> or <KBD>Backspace</KBD> 8587<DD>Delete the character to the left of the cursor. 8588<DT><KBD>C-d</KBD> 8589<DD>Delete the character underneath the cursor. 8590<DT>Printing characters 8591<DD>Insert the character into the line at the cursor. 8592<DT><KBD>C-_</KBD> or <KBD>C-x C-u</KBD> 8593<DD>Undo the last editing command. You can undo all the way back to an 8594empty line. 8595</DL> 8596<P> 8597 8598(Depending on your configuration, the <KBD>Backspace</KBD> key be set to 8599delete the character to the left of the cursor and the <KBD>DEL</KBD> key set 8600to delete the character underneath the cursor, like <KBD>C-d</KBD>, rather 8601than the character to the left of the cursor.) 8602</P><P> 8603 8604<A NAME="Readline Movement Commands"></A> 8605<HR SIZE="6"> 8606<A NAME="SEC95"></A> 8607<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8608<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> < </A>]</TD> 8609<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> > </A>]</TD> 8610<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> << </A>]</TD> 8611<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> Up </A>]</TD> 8612<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> >> </A>]</TD> 8613<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8614<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8615<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8616<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8617</TR></TABLE> 8618<H3> 8.2.2 Readline Movement Commands </H3> 8619<!--docid::SEC95::--> 8620<P> 8621 8622The above table describes the most basic keystrokes that you need 8623in order to do editing of the input line. For your convenience, many 8624other commands have been added in addition to <KBD>C-b</KBD>, <KBD>C-f</KBD>, 8625<KBD>C-d</KBD>, and <KBD>DEL</KBD>. Here are some commands for moving more rapidly 8626about the line. 8627</P><P> 8628 8629<DL COMPACT> 8630<DT><KBD>C-a</KBD> 8631<DD>Move to the start of the line. 8632<DT><KBD>C-e</KBD> 8633<DD>Move to the end of the line. 8634<DT><KBD>M-f</KBD> 8635<DD>Move forward a word, where a word is composed of letters and digits. 8636<DT><KBD>M-b</KBD> 8637<DD>Move backward a word. 8638<DT><KBD>C-l</KBD> 8639<DD>Clear the screen, reprinting the current line at the top. 8640</DL> 8641<P> 8642 8643Notice how <KBD>C-f</KBD> moves forward a character, while <KBD>M-f</KBD> moves 8644forward a word. It is a loose convention that control keystrokes 8645operate on characters while meta keystrokes operate on words. 8646</P><P> 8647 8648<A NAME="Readline Killing Commands"></A> 8649<HR SIZE="6"> 8650<A NAME="SEC96"></A> 8651<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8652<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> < </A>]</TD> 8653<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> > </A>]</TD> 8654<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> << </A>]</TD> 8655<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> Up </A>]</TD> 8656<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> >> </A>]</TD> 8657<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8658<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8659<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8660<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8661</TR></TABLE> 8662<H3> 8.2.3 Readline Killing Commands </H3> 8663<!--docid::SEC96::--> 8664<P> 8665 8666<A NAME="IDX285"></A> 8667<A NAME="IDX286"></A> 8668</P><P> 8669 8670<EM>Killing</EM> text means to delete the text from the line, but to save 8671it away for later use, usually by <EM>yanking</EM> (re-inserting) 8672it back into the line. 8673(`Cut' and `paste' are more recent jargon for `kill' and `yank'.) 8674</P><P> 8675 8676If the description for a command says that it `kills' text, then you can 8677be sure that you can get the text back in a different (or the same) 8678place later. 8679</P><P> 8680 8681When you use a kill command, the text is saved in a <EM>kill-ring</EM>. 8682Any number of consecutive kills save all of the killed text together, so 8683that when you yank it back, you get it all. The kill 8684ring is not line specific; the text that you killed on a previously 8685typed line is available to be yanked back later, when you are typing 8686another line. 8687<A NAME="IDX287"></A> 8688</P><P> 8689 8690Here is the list of commands for killing text. 8691</P><P> 8692 8693<DL COMPACT> 8694<DT><KBD>C-k</KBD> 8695<DD>Kill the text from the current cursor position to the end of the line. 8696<P> 8697 8698<DT><KBD>M-d</KBD> 8699<DD>Kill from the cursor to the end of the current word, or, if between 8700words, to the end of the next word. 8701Word boundaries are the same as those used by <KBD>M-f</KBD>. 8702<P> 8703 8704<DT><KBD>M-<KBD>DEL</KBD></KBD> 8705<DD>Kill from the cursor the start of the current word, or, if between 8706words, to the start of the previous word. 8707Word boundaries are the same as those used by <KBD>M-b</KBD>. 8708<P> 8709 8710<DT><KBD>C-w</KBD> 8711<DD>Kill from the cursor to the previous whitespace. This is different than 8712<KBD>M-<KBD>DEL</KBD></KBD> because the word boundaries differ. 8713<P> 8714 8715</DL> 8716<P> 8717 8718Here is how to <EM>yank</EM> the text back into the line. Yanking 8719means to copy the most-recently-killed text from the kill buffer. 8720</P><P> 8721 8722<DL COMPACT> 8723<DT><KBD>C-y</KBD> 8724<DD>Yank the most recently killed text back into the buffer at the cursor. 8725<P> 8726 8727<DT><KBD>M-y</KBD> 8728<DD>Rotate the kill-ring, and yank the new top. You can only do this if 8729the prior command is <KBD>C-y</KBD> or <KBD>M-y</KBD>. 8730</DL> 8731<P> 8732 8733<A NAME="Readline Arguments"></A> 8734<HR SIZE="6"> 8735<A NAME="SEC97"></A> 8736<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8737<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> < </A>]</TD> 8738<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> > </A>]</TD> 8739<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> << </A>]</TD> 8740<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> Up </A>]</TD> 8741<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> >> </A>]</TD> 8742<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8743<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8744<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8745<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8746</TR></TABLE> 8747<H3> 8.2.4 Readline Arguments </H3> 8748<!--docid::SEC97::--> 8749<P> 8750 8751You can pass numeric arguments to Readline commands. Sometimes the 8752argument acts as a repeat count, other times it is the <I>sign</I> of the 8753argument that is significant. If you pass a negative argument to a 8754command which normally acts in a forward direction, that command will 8755act in a backward direction. For example, to kill text back to the 8756start of the line, you might type <SAMP>`M-- C-k'</SAMP>. 8757</P><P> 8758 8759The general way to pass numeric arguments to a command is to type meta 8760digits before the command. If the first `digit' typed is a minus 8761sign (<SAMP>`-'</SAMP>), then the sign of the argument will be negative. Once 8762you have typed one meta digit to get the argument started, you can type 8763the remainder of the digits, and then the command. For example, to give 8764the <KBD>C-d</KBD> command an argument of 10, you could type <SAMP>`M-1 0 C-d'</SAMP>, 8765which will delete the next ten characters on the input line. 8766</P><P> 8767 8768<A NAME="Searching"></A> 8769<HR SIZE="6"> 8770<A NAME="SEC98"></A> 8771<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8772<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> < </A>]</TD> 8773<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> > </A>]</TD> 8774<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> << </A>]</TD> 8775<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> Up </A>]</TD> 8776<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> >> </A>]</TD> 8777<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8778<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8779<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8780<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8781</TR></TABLE> 8782<H3> 8.2.5 Searching for Commands in the History </H3> 8783<!--docid::SEC98::--> 8784<P> 8785 8786Readline provides commands for searching through the command history 8787(see section <A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A>) 8788for lines containing a specified string. 8789There are two search modes: <EM>incremental</EM> and <EM>non-incremental</EM>. 8790</P><P> 8791 8792Incremental searches begin before the user has finished typing the 8793search string. 8794As each character of the search string is typed, Readline displays 8795the next entry from the history matching the string typed so far. 8796An incremental search requires only as many characters as needed to 8797find the desired history entry. 8798To search backward in the history for a particular string, type 8799<KBD>C-r</KBD>. Typing <KBD>C-s</KBD> searches forward through the history. 8800The characters present in the value of the <CODE>isearch-terminators</CODE> variable 8801are used to terminate an incremental search. 8802If that variable has not been assigned a value, the <KBD>ESC</KBD> and 8803<KBD>C-J</KBD> characters will terminate an incremental search. 8804<KBD>C-g</KBD> will abort an incremental search and restore the original line. 8805When the search is terminated, the history entry containing the 8806search string becomes the current line. 8807</P><P> 8808 8809To find other matching entries in the history list, type <KBD>C-r</KBD> or 8810<KBD>C-s</KBD> as appropriate. 8811This will search backward or forward in the history for the next 8812entry matching the search string typed so far. 8813Any other key sequence bound to a Readline command will terminate 8814the search and execute that command. 8815For instance, a <KBD>RET</KBD> will terminate the search and accept 8816the line, thereby executing the command from the history list. 8817A movement command will terminate the search, make the last line found 8818the current line, and begin editing. 8819</P><P> 8820 8821Readline remembers the last incremental search string. If two 8822<KBD>C-r</KBD>s are typed without any intervening characters defining a new 8823search string, any remembered search string is used. 8824</P><P> 8825 8826Non-incremental searches read the entire search string before starting 8827to search for matching history lines. The search string may be 8828typed by the user or be part of the contents of the current line. 8829</P><P> 8830 8831<A NAME="Readline Init File"></A> 8832<HR SIZE="6"> 8833<A NAME="SEC99"></A> 8834<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8835<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> < </A>]</TD> 8836<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> > </A>]</TD> 8837<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD> 8838<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> 8839<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> 8840<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8841<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8842<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8843<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8844</TR></TABLE> 8845<H2> 8.3 Readline Init File </H2> 8846<!--docid::SEC99::--> 8847<P> 8848 8849Although the Readline library comes with a set of Emacs-like 8850keybindings installed by default, it is possible to use a different set 8851of keybindings. 8852Any user can customize programs that use Readline by putting 8853commands in an <EM>inputrc</EM> file, conventionally in his home directory. 8854The name of this 8855file is taken from the value of the shell variable <CODE>INPUTRC</CODE>. If 8856that variable is unset, the default is <TT>`~/.inputrc'</TT>. 8857</P><P> 8858 8859When a program which uses the Readline library starts up, the 8860init file is read, and the key bindings are set. 8861</P><P> 8862 8863In addition, the <CODE>C-x C-r</CODE> command re-reads this init file, thus 8864incorporating any changes that you might have made to it. 8865</P><P> 8866 8867<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 8868<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC100">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> 8869</TABLE> 8870 8871<br> 8872<TABLE BORDER=0 CELLSPACING=0> 8873<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC101">8.3.2 Conditional Init Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Conditional key bindings in the inputrc file.</TD></TR> 8874</TABLE> 8875 8876<br> 8877<TABLE BORDER=0 CELLSPACING=0> 8878<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC102">8.3.3 Sample Init File</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">An example inputrc file.</TD></TR> 8879</TABLE></BLOCKQUOTE> 8880<P> 8881 8882<A NAME="Readline Init File Syntax"></A> 8883<HR SIZE="6"> 8884<A NAME="SEC100"></A> 8885<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 8886<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> < </A>]</TD> 8887<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> > </A>]</TD> 8888<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD> 8889<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> Up </A>]</TD> 8890<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> 8891<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 8892<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 8893<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 8894<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 8895</TR></TABLE> 8896<H3> 8.3.1 Readline Init File Syntax </H3> 8897<!--docid::SEC100::--> 8898<P> 8899 8900There are only a few basic constructs allowed in the 8901Readline init file. Blank lines are ignored. 8902Lines beginning with a <SAMP>`#'</SAMP> are comments. 8903Lines beginning with a <SAMP>`$'</SAMP> indicate conditional 8904constructs (see section <A HREF="bashref.html#SEC101">8.3.2 Conditional Init Constructs</A>). Other lines 8905denote variable settings and key bindings. 8906</P><P> 8907 8908<DL COMPACT> 8909<DT>Variable Settings 8910<DD>You can modify the run-time behavior of Readline by 8911altering the values of variables in Readline 8912using the <CODE>set</CODE> command within the init file. 8913The syntax is simple: 8914<P> 8915 8916<TABLE><tr><td> </td><td class=example><pre>set <VAR>variable</VAR> <VAR>value</VAR> 8917</pre></td></tr></table></P><P> 8918 8919Here, for example, is how to 8920change from the default Emacs-like key binding to use 8921<CODE>vi</CODE> line editing commands: 8922</P><P> 8923 8924<TABLE><tr><td> </td><td class=example><pre>set editing-mode vi 8925</pre></td></tr></table></P><P> 8926 8927Variable names and values, where appropriate, are recognized without regard 8928to case. Unrecognized variable names are ignored. 8929</P><P> 8930 8931Boolean variables (those that can be set to on or off) are set to on if 8932the value is null or empty, <VAR>on</VAR> (case-insensitive), or 1. Any other 8933value results in the variable being set to off. 8934</P><P> 8935 8936The <CODE>bind -V</CODE> command lists the current Readline variable names 8937and values. See section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>. 8938</P><P> 8939 8940A great deal of run-time behavior is changeable with the following 8941variables. 8942</P><P> 8943 8944<A NAME="IDX288"></A> 8945<DL COMPACT> 8946 8947<DT><CODE>bell-style</CODE> 8948<DD><A NAME="IDX289"></A> 8949Controls what happens when Readline wants to ring the terminal bell. 8950If set to <SAMP>`none'</SAMP>, Readline never rings the bell. If set to 8951<SAMP>`visible'</SAMP>, Readline uses a visible bell if one is available. 8952If set to <SAMP>`audible'</SAMP> (the default), Readline attempts to ring 8953the terminal's bell. 8954<P> 8955 8956<DT><CODE>bind-tty-special-chars</CODE> 8957<DD><A NAME="IDX290"></A> 8958If set to <SAMP>`on'</SAMP>, Readline attempts to bind the control characters 8959treated specially by the kernel's terminal driver to their Readline 8960equivalents. 8961<P> 8962 8963<DT><CODE>comment-begin</CODE> 8964<DD><A NAME="IDX291"></A> 8965The string to insert at the beginning of the line when the 8966<CODE>insert-comment</CODE> command is executed. The default value 8967is <CODE>"#"</CODE>. 8968<P> 8969 8970<DT><CODE>completion-ignore-case</CODE> 8971<DD>If set to <SAMP>`on'</SAMP>, Readline performs filename matching and completion 8972in a case-insensitive fashion. 8973The default value is <SAMP>`off'</SAMP>. 8974<P> 8975 8976<DT><CODE>completion-query-items</CODE> 8977<DD><A NAME="IDX292"></A> 8978The number of possible completions that determines when the user is 8979asked whether the list of possibilities should be displayed. 8980If the number of possible completions is greater than this value, 8981Readline will ask the user whether or not he wishes to view 8982them; otherwise, they are simply listed. 8983This variable must be set to an integer value greater than or equal to 0. 8984A negative value means Readline should never ask. 8985The default limit is <CODE>100</CODE>. 8986<P> 8987 8988<DT><CODE>convert-meta</CODE> 8989<DD><A NAME="IDX293"></A> 8990If set to <SAMP>`on'</SAMP>, Readline will convert characters with the 8991eighth bit set to an ASCII key sequence by stripping the eighth 8992bit and prefixing an <KBD>ESC</KBD> character, converting them to a 8993meta-prefixed key sequence. The default value is <SAMP>`on'</SAMP>. 8994<P> 8995 8996<DT><CODE>disable-completion</CODE> 8997<DD><A NAME="IDX294"></A> 8998If set to <SAMP>`On'</SAMP>, Readline will inhibit word completion. 8999Completion characters will be inserted into the line as if they had 9000been mapped to <CODE>self-insert</CODE>. The default is <SAMP>`off'</SAMP>. 9001<P> 9002 9003<DT><CODE>editing-mode</CODE> 9004<DD><A NAME="IDX295"></A> 9005The <CODE>editing-mode</CODE> variable controls which default set of 9006key bindings is used. By default, Readline starts up in Emacs editing 9007mode, where the keystrokes are most similar to Emacs. This variable can be 9008set to either <SAMP>`emacs'</SAMP> or <SAMP>`vi'</SAMP>. 9009<P> 9010 9011<DT><CODE>enable-keypad</CODE> 9012<DD><A NAME="IDX296"></A> 9013When set to <SAMP>`on'</SAMP>, Readline will try to enable the application 9014keypad when it is called. Some systems need this to enable the 9015arrow keys. The default is <SAMP>`off'</SAMP>. 9016<P> 9017 9018<DT><CODE>expand-tilde</CODE> 9019<DD><A NAME="IDX297"></A> 9020If set to <SAMP>`on'</SAMP>, tilde expansion is performed when Readline 9021attempts word completion. The default is <SAMP>`off'</SAMP>. 9022<P> 9023 9024<DT><CODE>history-preserve-point</CODE> 9025<DD><A NAME="IDX298"></A> 9026If set to <SAMP>`on'</SAMP>, the history code attempts to place point at the 9027same location on each history line retrieved with <CODE>previous-history</CODE> 9028or <CODE>next-history</CODE>. The default is <SAMP>`off'</SAMP>. 9029<P> 9030 9031<DT><CODE>horizontal-scroll-mode</CODE> 9032<DD><A NAME="IDX299"></A> 9033This variable can be set to either <SAMP>`on'</SAMP> or <SAMP>`off'</SAMP>. Setting it 9034to <SAMP>`on'</SAMP> means that the text of the lines being edited will scroll 9035horizontally on a single screen line when they are longer than the width 9036of the screen, instead of wrapping onto a new screen line. By default, 9037this variable is set to <SAMP>`off'</SAMP>. 9038<P> 9039 9040<DT><CODE>input-meta</CODE> 9041<DD><A NAME="IDX300"></A> 9042<A NAME="IDX301"></A> 9043If set to <SAMP>`on'</SAMP>, Readline will enable eight-bit input (it 9044will not clear the eighth bit in the characters it reads), 9045regardless of what the terminal claims it can support. The 9046default value is <SAMP>`off'</SAMP>. The name <CODE>meta-flag</CODE> is a 9047synonym for this variable. 9048<P> 9049 9050<DT><CODE>isearch-terminators</CODE> 9051<DD><A NAME="IDX302"></A> 9052The string of characters that should terminate an incremental search without 9053subsequently executing the character as a command (see section <A HREF="bashref.html#SEC98">8.2.5 Searching for Commands in the History</A>). 9054If this variable has not been given a value, the characters <KBD>ESC</KBD> and 9055<KBD>C-J</KBD> will terminate an incremental search. 9056<P> 9057 9058<DT><CODE>keymap</CODE> 9059<DD><A NAME="IDX303"></A> 9060Sets Readline's idea of the current keymap for key binding commands. 9061Acceptable <CODE>keymap</CODE> names are 9062<CODE>emacs</CODE>, 9063<CODE>emacs-standard</CODE>, 9064<CODE>emacs-meta</CODE>, 9065<CODE>emacs-ctlx</CODE>, 9066<CODE>vi</CODE>, 9067<CODE>vi-move</CODE>, 9068<CODE>vi-command</CODE>, and 9069<CODE>vi-insert</CODE>. 9070<CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>; <CODE>emacs</CODE> is 9071equivalent to <CODE>emacs-standard</CODE>. The default value is <CODE>emacs</CODE>. 9072The value of the <CODE>editing-mode</CODE> variable also affects the 9073default keymap. 9074<P> 9075 9076<DT><CODE>mark-directories</CODE> 9077<DD>If set to <SAMP>`on'</SAMP>, completed directory names have a slash 9078appended. The default is <SAMP>`on'</SAMP>. 9079<P> 9080 9081<DT><CODE>mark-modified-lines</CODE> 9082<DD><A NAME="IDX304"></A> 9083This variable, when set to <SAMP>`on'</SAMP>, causes Readline to display an 9084asterisk (<SAMP>`*'</SAMP>) at the start of history lines which have been modified. 9085This variable is <SAMP>`off'</SAMP> by default. 9086<P> 9087 9088<DT><CODE>mark-symlinked-directories</CODE> 9089<DD><A NAME="IDX305"></A> 9090If set to <SAMP>`on'</SAMP>, completed names which are symbolic links 9091to directories have a slash appended (subject to the value of 9092<CODE>mark-directories</CODE>). 9093The default is <SAMP>`off'</SAMP>. 9094<P> 9095 9096<DT><CODE>match-hidden-files</CODE> 9097<DD><A NAME="IDX306"></A> 9098This variable, when set to <SAMP>`on'</SAMP>, causes Readline to match files whose 9099names begin with a <SAMP>`.'</SAMP> (hidden files) when performing filename 9100completion, unless the leading <SAMP>`.'</SAMP> is 9101supplied by the user in the filename to be completed. 9102This variable is <SAMP>`on'</SAMP> by default. 9103<P> 9104 9105<DT><CODE>output-meta</CODE> 9106<DD><A NAME="IDX307"></A> 9107If set to <SAMP>`on'</SAMP>, Readline will display characters with the 9108eighth bit set directly rather than as a meta-prefixed escape 9109sequence. The default is <SAMP>`off'</SAMP>. 9110<P> 9111 9112<DT><CODE>page-completions</CODE> 9113<DD><A NAME="IDX308"></A> 9114If set to <SAMP>`on'</SAMP>, Readline uses an internal <CODE>more</CODE>-like pager 9115to display a screenful of possible completions at a time. 9116This variable is <SAMP>`on'</SAMP> by default. 9117<P> 9118 9119<DT><CODE>print-completions-horizontally</CODE> 9120<DD>If set to <SAMP>`on'</SAMP>, Readline will display completions with matches 9121sorted horizontally in alphabetical order, rather than down the screen. 9122The default is <SAMP>`off'</SAMP>. 9123<P> 9124 9125<DT><CODE>show-all-if-ambiguous</CODE> 9126<DD><A NAME="IDX309"></A> 9127This alters the default behavior of the completion functions. If 9128set to <SAMP>`on'</SAMP>, 9129words which have more than one possible completion cause the 9130matches to be listed immediately instead of ringing the bell. 9131The default value is <SAMP>`off'</SAMP>. 9132<P> 9133 9134<DT><CODE>show-all-if-unmodified</CODE> 9135<DD><A NAME="IDX310"></A> 9136This alters the default behavior of the completion functions in 9137a fashion similar to <VAR>show-all-if-ambiguous</VAR>. 9138If set to <SAMP>`on'</SAMP>, 9139words which have more than one possible completion without any 9140possible partial completion (the possible completions don't share 9141a common prefix) cause the matches to be listed immediately instead 9142of ringing the bell. 9143The default value is <SAMP>`off'</SAMP>. 9144<P> 9145 9146<DT><CODE>visible-stats</CODE> 9147<DD><A NAME="IDX311"></A> 9148If set to <SAMP>`on'</SAMP>, a character denoting a file's type 9149is appended to the filename when listing possible 9150completions. The default is <SAMP>`off'</SAMP>. 9151<P> 9152 9153</DL> 9154<P> 9155 9156<DT>Key Bindings 9157<DD>The syntax for controlling key bindings in the init file is 9158simple. First you need to find the name of the command that you 9159want to change. The following sections contain tables of the command 9160name, the default keybinding, if any, and a short description of what 9161the command does. 9162<P> 9163 9164Once you know the name of the command, simply place on a line 9165in the init file the name of the key 9166you wish to bind the command to, a colon, and then the name of the 9167command. The name of the key 9168can be expressed in different ways, depending on what you find most 9169comfortable. 9170</P><P> 9171 9172In addition to command names, readline allows keys to be bound 9173to a string that is inserted when the key is pressed (a <VAR>macro</VAR>). 9174</P><P> 9175 9176The <CODE>bind -p</CODE> command displays Readline function names and 9177bindings in a format that can put directly into an initialization file. 9178See section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>. 9179</P><P> 9180 9181<DL COMPACT> 9182<DT><VAR>keyname</VAR>: <VAR>function-name</VAR> or <VAR>macro</VAR> 9183<DD><VAR>keyname</VAR> is the name of a key spelled out in English. For example: 9184<TABLE><tr><td> </td><td class=example><pre>Control-u: universal-argument 9185Meta-Rubout: backward-kill-word 9186Control-o: "> output" 9187</pre></td></tr></table><P> 9188 9189In the above example, <KBD>C-u</KBD> is bound to the function 9190<CODE>universal-argument</CODE>, 9191<KBD>M-DEL</KBD> is bound to the function <CODE>backward-kill-word</CODE>, and 9192<KBD>C-o</KBD> is bound to run the macro 9193expressed on the right hand side (that is, to insert the text 9194<SAMP>`> output'</SAMP> into the line). 9195</P><P> 9196 9197A number of symbolic character names are recognized while 9198processing this key binding syntax: 9199<VAR>DEL</VAR>, 9200<VAR>ESC</VAR>, 9201<VAR>ESCAPE</VAR>, 9202<VAR>LFD</VAR>, 9203<VAR>NEWLINE</VAR>, 9204<VAR>RET</VAR>, 9205<VAR>RETURN</VAR>, 9206<VAR>RUBOUT</VAR>, 9207<VAR>SPACE</VAR>, 9208<VAR>SPC</VAR>, 9209and 9210<VAR>TAB</VAR>. 9211</P><P> 9212 9213<DT>"<VAR>keyseq</VAR>": <VAR>function-name</VAR> or <VAR>macro</VAR> 9214<DD><VAR>keyseq</VAR> differs from <VAR>keyname</VAR> above in that strings 9215denoting an entire key sequence can be specified, by placing 9216the key sequence in double quotes. Some GNU Emacs style key 9217escapes can be used, as in the following example, but the 9218special character names are not recognized. 9219<P> 9220 9221<TABLE><tr><td> </td><td class=example><pre>"\C-u": universal-argument 9222"\C-x\C-r": re-read-init-file 9223"\e[11~": "Function Key 1" 9224</pre></td></tr></table></P><P> 9225 9226In the above example, <KBD>C-u</KBD> is again bound to the function 9227<CODE>universal-argument</CODE> (just as it was in the first example), 9228<SAMP>`<KBD>C-x</KBD> <KBD>C-r</KBD>'</SAMP> is bound to the function <CODE>re-read-init-file</CODE>, 9229and <SAMP>`<KBD>ESC</KBD> <KBD>[</KBD> <KBD>1</KBD> <KBD>1</KBD> <KBD>~</KBD>'</SAMP> is bound to insert 9230the text <SAMP>`Function Key 1'</SAMP>. 9231</P><P> 9232 9233</DL> 9234<P> 9235 9236The following GNU Emacs style escape sequences are available when 9237specifying key sequences: 9238</P><P> 9239 9240<DL COMPACT> 9241<DT><CODE><KBD>\C-</KBD></CODE> 9242<DD>control prefix 9243<DT><CODE><KBD>\M-</KBD></CODE> 9244<DD>meta prefix 9245<DT><CODE><KBD>\e</KBD></CODE> 9246<DD>an escape character 9247<DT><CODE><KBD>\\</KBD></CODE> 9248<DD>backslash 9249<DT><CODE><KBD>\"</KBD></CODE> 9250<DD><KBD>"</KBD>, a double quotation mark 9251<DT><CODE><KBD>\'</KBD></CODE> 9252<DD><KBD>'</KBD>, a single quote or apostrophe 9253</DL> 9254<P> 9255 9256In addition to the GNU Emacs style escape sequences, a second 9257set of backslash escapes is available: 9258</P><P> 9259 9260<DL COMPACT> 9261<DT><CODE>\a</CODE> 9262<DD>alert (bell) 9263<DT><CODE>\b</CODE> 9264<DD>backspace 9265<DT><CODE>\d</CODE> 9266<DD>delete 9267<DT><CODE>\f</CODE> 9268<DD>form feed 9269<DT><CODE>\n</CODE> 9270<DD>newline 9271<DT><CODE>\r</CODE> 9272<DD>carriage return 9273<DT><CODE>\t</CODE> 9274<DD>horizontal tab 9275<DT><CODE>\v</CODE> 9276<DD>vertical tab 9277<DT><CODE>\<VAR>nnn</VAR></CODE> 9278<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR> 9279(one to three digits) 9280<DT><CODE>\x<VAR>HH</VAR></CODE> 9281<DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR> 9282(one or two hex digits) 9283</DL> 9284<P> 9285 9286When entering the text of a macro, single or double quotes must 9287be used to indicate a macro definition. 9288Unquoted text is assumed to be a function name. 9289In the macro body, the backslash escapes described above are expanded. 9290Backslash will quote any other character in the macro text, 9291including <SAMP>`"'</SAMP> and <SAMP>`''</SAMP>. 9292For example, the following binding will make <SAMP>`<KBD>C-x</KBD> \'</SAMP> 9293insert a single <SAMP>`\'</SAMP> into the line: 9294<TABLE><tr><td> </td><td class=example><pre>"\C-x\\": "\\" 9295</pre></td></tr></table></P><P> 9296 9297</DL> 9298<P> 9299 9300<A NAME="Conditional Init Constructs"></A> 9301<HR SIZE="6"> 9302<A NAME="SEC101"></A> 9303<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 9304<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> < </A>]</TD> 9305<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> > </A>]</TD> 9306<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> << </A>]</TD> 9307<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> Up </A>]</TD> 9308<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> 9309<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 9310<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 9311<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 9312<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 9313</TR></TABLE> 9314<H3> 8.3.2 Conditional Init Constructs </H3> 9315<!--docid::SEC101::--> 9316<P> 9317 9318Readline implements a facility similar in spirit to the conditional 9319compilation features of the C preprocessor which allows key 9320bindings and variable settings to be performed as the result 9321of tests. There are four parser directives used. 9322</P><P> 9323 9324<DL COMPACT> 9325<DT><CODE>$if</CODE> 9326<DD>The <CODE>$if</CODE> construct allows bindings to be made based on the 9327editing mode, the terminal being used, or the application using 9328Readline. The text of the test extends to the end of the line; 9329no characters are required to isolate it. 9330<P> 9331 9332<DL COMPACT> 9333<DT><CODE>mode</CODE> 9334<DD>The <CODE>mode=</CODE> form of the <CODE>$if</CODE> directive is used to test 9335whether Readline is in <CODE>emacs</CODE> or <CODE>vi</CODE> mode. 9336This may be used in conjunction 9337with the <SAMP>`set keymap'</SAMP> command, for instance, to set bindings in 9338the <CODE>emacs-standard</CODE> and <CODE>emacs-ctlx</CODE> keymaps only if 9339Readline is starting out in <CODE>emacs</CODE> mode. 9340<P> 9341 9342<DT><CODE>term</CODE> 9343<DD>The <CODE>term=</CODE> form may be used to include terminal-specific 9344key bindings, perhaps to bind the key sequences output by the 9345terminal's function keys. The word on the right side of the 9346<SAMP>`='</SAMP> is tested against both the full name of the terminal and 9347the portion of the terminal name before the first <SAMP>`-'</SAMP>. This 9348allows <CODE>sun</CODE> to match both <CODE>sun</CODE> and <CODE>sun-cmd</CODE>, 9349for instance. 9350<P> 9351 9352<DT><CODE>application</CODE> 9353<DD>The <VAR>application</VAR> construct is used to include 9354application-specific settings. Each program using the Readline 9355library sets the <VAR>application name</VAR>, and you can test for 9356a particular value. 9357This could be used to bind key sequences to functions useful for 9358a specific program. For instance, the following command adds a 9359key sequence that quotes the current or previous word in Bash: 9360<TABLE><tr><td> </td><td class=example><pre>$if Bash 9361# Quote the current or previous word 9362"\C-xq": "\eb\"\ef\"" 9363$endif 9364</pre></td></tr></table></DL> 9365<P> 9366 9367<DT><CODE>$endif</CODE> 9368<DD>This command, as seen in the previous example, terminates an 9369<CODE>$if</CODE> command. 9370<P> 9371 9372<DT><CODE>$else</CODE> 9373<DD>Commands in this branch of the <CODE>$if</CODE> directive are executed if 9374the test fails. 9375<P> 9376 9377<DT><CODE>$include</CODE> 9378<DD>This directive takes a single filename as an argument and reads commands 9379and bindings from that file. 9380For example, the following directive reads from <TT>`/etc/inputrc'</TT>: 9381<TABLE><tr><td> </td><td class=example><pre>$include /etc/inputrc 9382</pre></td></tr></table></DL> 9383<P> 9384 9385<A NAME="Sample Init File"></A> 9386<HR SIZE="6"> 9387<A NAME="SEC102"></A> 9388<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 9389<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> < </A>]</TD> 9390<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> > </A>]</TD> 9391<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD> 9392<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> Up </A>]</TD> 9393<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD> 9394<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 9395<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 9396<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 9397<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 9398</TR></TABLE> 9399<H3> 8.3.3 Sample Init File </H3> 9400<!--docid::SEC102::--> 9401<P> 9402 9403Here is an example of an <VAR>inputrc</VAR> file. This illustrates key 9404binding, variable assignment, and conditional syntax. 9405</P><P> 9406 9407<TABLE><tr><td> </td><td class=example><pre># This file controls the behaviour of line input editing for 9408# programs that use the GNU Readline library. Existing 9409# programs include FTP, Bash, and GDB. 9410# 9411# You can re-read the inputrc file with C-x C-r. 9412# Lines beginning with '#' are comments. 9413# 9414# First, include any systemwide bindings and variable 9415# assignments from /etc/Inputrc 9416$include /etc/Inputrc 9417 9418# 9419# Set various bindings for emacs mode. 9420 9421set editing-mode emacs 9422 9423$if mode=emacs 9424 9425Meta-Control-h: backward-kill-word Text after the function name is ignored 9426 9427# 9428# Arrow keys in keypad mode 9429# 9430#"\M-OD": backward-char 9431#"\M-OC": forward-char 9432#"\M-OA": previous-history 9433#"\M-OB": next-history 9434# 9435# Arrow keys in ANSI mode 9436# 9437"\M-[D": backward-char 9438"\M-[C": forward-char 9439"\M-[A": previous-history 9440"\M-[B": next-history 9441# 9442# Arrow keys in 8 bit keypad mode 9443# 9444#"\M-\C-OD": backward-char 9445#"\M-\C-OC": forward-char 9446#"\M-\C-OA": previous-history 9447#"\M-\C-OB": next-history 9448# 9449# Arrow keys in 8 bit ANSI mode 9450# 9451#"\M-\C-[D": backward-char 9452#"\M-\C-[C": forward-char 9453#"\M-\C-[A": previous-history 9454#"\M-\C-[B": next-history 9455 9456C-q: quoted-insert 9457 9458$endif 9459 9460# An old-style binding. This happens to be the default. 9461TAB: complete 9462 9463# Macros that are convenient for shell interaction 9464$if Bash 9465# edit the path 9466"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f" 9467# prepare to type a quoted word -- 9468# insert open and close double quotes 9469# and move to just after the open quote 9470"\C-x\"": "\"\"\C-b" 9471# insert a backslash (testing backslash escapes 9472# in sequences and macros) 9473"\C-x\\": "\\" 9474# Quote the current or previous word 9475"\C-xq": "\eb\"\ef\"" 9476# Add a binding to refresh the line, which is unbound 9477"\C-xr": redraw-current-line 9478# Edit variable on current line. 9479"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y=" 9480$endif 9481 9482# use a visible bell if one is available 9483set bell-style visible 9484 9485# don't strip characters to 7 bits when reading 9486set input-meta on 9487 9488# allow iso-latin1 characters to be inserted rather 9489# than converted to prefix-meta sequences 9490set convert-meta off 9491 9492# display characters with the eighth bit set directly 9493# rather than as meta-prefixed characters 9494set output-meta on 9495 9496# if there are more than 150 possible completions for 9497# a word, ask the user if he wants to see all of them 9498set completion-query-items 150 9499 9500# For FTP 9501$if Ftp 9502"\C-xg": "get \M-?" 9503"\C-xt": "put \M-?" 9504"\M-.": yank-last-arg 9505$endif 9506</pre></td></tr></table></P><P> 9507 9508<A NAME="Bindable Readline Commands"></A> 9509<HR SIZE="6"> 9510<A NAME="SEC103"></A> 9511<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 9512<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> < </A>]</TD> 9513<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> > </A>]</TD> 9514<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> << </A>]</TD> 9515<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> 9516<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> >> </A>]</TD> 9517<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 9518<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 9519<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 9520<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 9521</TR></TABLE> 9522<H2> 8.4 Bindable Readline Commands </H2> 9523<!--docid::SEC103::--> 9524<P> 9525 9526<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 9527<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the line.</TD></TR> 9528<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Getting at previous lines.</TD></TR> 9529<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for changing text.</TD></TR> 9530<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for killing and yanking.</TD></TR> 9531<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC108">8.4.5 Specifying Numeric Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying numeric arguments, repeat counts.</TD></TR> 9532<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC109">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> 9533<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC110">8.4.7 Keyboard Macros</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Saving and re-executing typed characters</TD></TR> 9534<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Other miscellaneous commands.</TD></TR> 9535</TABLE></BLOCKQUOTE> 9536<P> 9537 9538This section describes Readline commands that may be bound to key 9539sequences. 9540You can list your key bindings by executing 9541<CODE>bind -P</CODE> or, for a more terse format, suitable for an 9542<VAR>inputrc</VAR> file, <CODE>bind -p</CODE>. (See section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>.) 9543Command names without an accompanying key sequence are unbound by default. 9544</P><P> 9545 9546In the following descriptions, <EM>point</EM> refers to the current cursor 9547position, and <EM>mark</EM> refers to a cursor position saved by the 9548<CODE>set-mark</CODE> command. 9549The text between the point and mark is referred to as the <EM>region</EM>. 9550</P><P> 9551 9552<A NAME="Commands For Moving"></A> 9553<HR SIZE="6"> 9554<A NAME="SEC104"></A> 9555<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 9556<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> < </A>]</TD> 9557<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> > </A>]</TD> 9558<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> << </A>]</TD> 9559<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> 9560<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> >> </A>]</TD> 9561<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 9562<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 9563<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 9564<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 9565</TR></TABLE> 9566<H3> 8.4.1 Commands For Moving </H3> 9567<!--docid::SEC104::--> 9568<DL COMPACT> 9569<A NAME="IDX312"></A> 9570<DT><CODE>beginning-of-line (C-a)</CODE> 9571<DD><A NAME="IDX313"></A> 9572Move to the start of the current line. 9573<P> 9574 9575<A NAME="IDX314"></A> 9576<DT><CODE>end-of-line (C-e)</CODE> 9577<DD><A NAME="IDX315"></A> 9578Move to the end of the line. 9579<P> 9580 9581<A NAME="IDX316"></A> 9582<DT><CODE>forward-char (C-f)</CODE> 9583<DD><A NAME="IDX317"></A> 9584Move forward a character. 9585<P> 9586 9587<A NAME="IDX318"></A> 9588<DT><CODE>backward-char (C-b)</CODE> 9589<DD><A NAME="IDX319"></A> 9590Move back a character. 9591<P> 9592 9593<A NAME="IDX320"></A> 9594<DT><CODE>forward-word (M-f)</CODE> 9595<DD><A NAME="IDX321"></A> 9596Move forward to the end of the next word. Words are composed of 9597letters and digits. 9598<P> 9599 9600<A NAME="IDX322"></A> 9601<DT><CODE>backward-word (M-b)</CODE> 9602<DD><A NAME="IDX323"></A> 9603Move back to the start of the current or previous word. Words are 9604composed of letters and digits. 9605<P> 9606 9607<A NAME="IDX324"></A> 9608<DT><CODE>clear-screen (C-l)</CODE> 9609<DD><A NAME="IDX325"></A> 9610Clear the screen and redraw the current line, 9611leaving the current line at the top of the screen. 9612<P> 9613 9614<A NAME="IDX326"></A> 9615<DT><CODE>redraw-current-line ()</CODE> 9616<DD><A NAME="IDX327"></A> 9617Refresh the current line. By default, this is unbound. 9618<P> 9619 9620</DL> 9621<P> 9622 9623<A NAME="Commands For History"></A> 9624<HR SIZE="6"> 9625<A NAME="SEC105"></A> 9626<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 9627<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> < </A>]</TD> 9628<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> > </A>]</TD> 9629<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> << </A>]</TD> 9630<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> 9631<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> >> </A>]</TD> 9632<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 9633<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 9634<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 9635<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 9636</TR></TABLE> 9637<H3> 8.4.2 Commands For Manipulating The History </H3> 9638<!--docid::SEC105::--> 9639<P> 9640 9641<DL COMPACT> 9642<A NAME="IDX328"></A> 9643<DT><CODE>accept-line (Newline or Return)</CODE> 9644<DD><A NAME="IDX329"></A> 9645Accept the line regardless of where the cursor is. 9646If this line is 9647non-empty, add it to the history list according to the setting of 9648the <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> variables. 9649If this line is a modified history line, then restore the history line 9650to its original state. 9651<P> 9652 9653<A NAME="IDX330"></A> 9654<DT><CODE>previous-history (C-p)</CODE> 9655<DD><A NAME="IDX331"></A> 9656Move `back' through the history list, fetching the previous command. 9657<P> 9658 9659<A NAME="IDX332"></A> 9660<DT><CODE>next-history (C-n)</CODE> 9661<DD><A NAME="IDX333"></A> 9662Move `forward' through the history list, fetching the next command. 9663<P> 9664 9665<A NAME="IDX334"></A> 9666<DT><CODE>beginning-of-history (M-<)</CODE> 9667<DD><A NAME="IDX335"></A> 9668Move to the first line in the history. 9669<P> 9670 9671<A NAME="IDX336"></A> 9672<DT><CODE>end-of-history (M->)</CODE> 9673<DD><A NAME="IDX337"></A> 9674Move to the end of the input history, i.e., the line currently 9675being entered. 9676<P> 9677 9678<A NAME="IDX338"></A> 9679<DT><CODE>reverse-search-history (C-r)</CODE> 9680<DD><A NAME="IDX339"></A> 9681Search backward starting at the current line and moving `up' through 9682the history as necessary. This is an incremental search. 9683<P> 9684 9685<A NAME="IDX340"></A> 9686<DT><CODE>forward-search-history (C-s)</CODE> 9687<DD><A NAME="IDX341"></A> 9688Search forward starting at the current line and moving `down' through 9689the the history as necessary. This is an incremental search. 9690<P> 9691 9692<A NAME="IDX342"></A> 9693<DT><CODE>non-incremental-reverse-search-history (M-p)</CODE> 9694<DD><A NAME="IDX343"></A> 9695Search backward starting at the current line and moving `up' 9696through the history as necessary using a non-incremental search 9697for a string supplied by the user. 9698<P> 9699 9700<A NAME="IDX344"></A> 9701<DT><CODE>non-incremental-forward-search-history (M-n)</CODE> 9702<DD><A NAME="IDX345"></A> 9703Search forward starting at the current line and moving `down' 9704through the the history as necessary using a non-incremental search 9705for a string supplied by the user. 9706<P> 9707 9708<A NAME="IDX346"></A> 9709<DT><CODE>history-search-forward ()</CODE> 9710<DD><A NAME="IDX347"></A> 9711Search forward through the history for the string of characters 9712between the start of the current line and the point. 9713This is a non-incremental search. 9714By default, this command is unbound. 9715<P> 9716 9717<A NAME="IDX348"></A> 9718<DT><CODE>history-search-backward ()</CODE> 9719<DD><A NAME="IDX349"></A> 9720Search backward through the history for the string of characters 9721between the start of the current line and the point. This 9722is a non-incremental search. By default, this command is unbound. 9723<P> 9724 9725<A NAME="IDX350"></A> 9726<DT><CODE>yank-nth-arg (M-C-y)</CODE> 9727<DD><A NAME="IDX351"></A> 9728Insert the first argument to the previous command (usually 9729the second word on the previous line) at point. 9730With an argument <VAR>n</VAR>, 9731insert the <VAR>n</VAR>th word from the previous command (the words 9732in the previous command begin with word 0). A negative argument 9733inserts the <VAR>n</VAR>th word from the end of the previous command. 9734Once the argument <VAR>n</VAR> is computed, the argument is extracted 9735as if the <SAMP>`!<VAR>n</VAR>'</SAMP> history expansion had been specified. 9736<P> 9737 9738<A NAME="IDX352"></A> 9739<DT><CODE>yank-last-arg (M-. or M-_)</CODE> 9740<DD><A NAME="IDX353"></A> 9741Insert last argument to the previous command (the last word of the 9742previous history entry). With an 9743argument, behave exactly like <CODE>yank-nth-arg</CODE>. 9744Successive calls to <CODE>yank-last-arg</CODE> move back through the history 9745list, inserting the last argument of each line in turn. 9746The history expansion facilities are used to extract the last argument, 9747as if the <SAMP>`!$'</SAMP> history expansion had been specified. 9748<P> 9749 9750</DL> 9751<P> 9752 9753<A NAME="Commands For Text"></A> 9754<HR SIZE="6"> 9755<A NAME="SEC106"></A> 9756<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 9757<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> < </A>]</TD> 9758<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> > </A>]</TD> 9759<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD> 9760<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> 9761<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> >> </A>]</TD> 9762<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 9763<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 9764<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 9765<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 9766</TR></TABLE> 9767<H3> 8.4.3 Commands For Changing Text </H3> 9768<!--docid::SEC106::--> 9769<P> 9770 9771<DL COMPACT> 9772<A NAME="IDX354"></A> 9773<DT><CODE>delete-char (C-d)</CODE> 9774<DD><A NAME="IDX355"></A> 9775Delete the character at point. If point is at the 9776beginning of the line, there are no characters in the line, and 9777the last character typed was not bound to <CODE>delete-char</CODE>, then 9778return EOF. 9779<P> 9780 9781<A NAME="IDX356"></A> 9782<DT><CODE>backward-delete-char (Rubout)</CODE> 9783<DD><A NAME="IDX357"></A> 9784Delete the character behind the cursor. A numeric argument means 9785to kill the characters instead of deleting them. 9786<P> 9787 9788<A NAME="IDX358"></A> 9789<DT><CODE>forward-backward-delete-char ()</CODE> 9790<DD><A NAME="IDX359"></A> 9791Delete the character under the cursor, unless the cursor is at the 9792end of the line, in which case the character behind the cursor is 9793deleted. By default, this is not bound to a key. 9794<P> 9795 9796<A NAME="IDX360"></A> 9797<DT><CODE>quoted-insert (C-q or C-v)</CODE> 9798<DD><A NAME="IDX361"></A> 9799Add the next character typed to the line verbatim. This is 9800how to insert key sequences like <KBD>C-q</KBD>, for example. 9801<P> 9802 9803<A NAME="IDX362"></A> 9804<DT><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE> 9805<DD><A NAME="IDX363"></A> 9806Insert yourself. 9807<P> 9808 9809<A NAME="IDX364"></A> 9810<DT><CODE>transpose-chars (C-t)</CODE> 9811<DD><A NAME="IDX365"></A> 9812Drag the character before the cursor forward over 9813the character at the cursor, moving the 9814cursor forward as well. If the insertion point 9815is at the end of the line, then this 9816transposes the last two characters of the line. 9817Negative arguments have no effect. 9818<P> 9819 9820<A NAME="IDX366"></A> 9821<DT><CODE>transpose-words (M-t)</CODE> 9822<DD><A NAME="IDX367"></A> 9823Drag the word before point past the word after point, 9824moving point past that word as well. 9825If the insertion point is at the end of the line, this transposes 9826the last two words on the line. 9827<P> 9828 9829<A NAME="IDX368"></A> 9830<DT><CODE>upcase-word (M-u)</CODE> 9831<DD><A NAME="IDX369"></A> 9832Uppercase the current (or following) word. With a negative argument, 9833uppercase the previous word, but do not move the cursor. 9834<P> 9835 9836<A NAME="IDX370"></A> 9837<DT><CODE>downcase-word (M-l)</CODE> 9838<DD><A NAME="IDX371"></A> 9839Lowercase the current (or following) word. With a negative argument, 9840lowercase the previous word, but do not move the cursor. 9841<P> 9842 9843<A NAME="IDX372"></A> 9844<DT><CODE>capitalize-word (M-c)</CODE> 9845<DD><A NAME="IDX373"></A> 9846Capitalize the current (or following) word. With a negative argument, 9847capitalize the previous word, but do not move the cursor. 9848<P> 9849 9850<A NAME="IDX374"></A> 9851<DT><CODE>overwrite-mode ()</CODE> 9852<DD><A NAME="IDX375"></A> 9853Toggle overwrite mode. With an explicit positive numeric argument, 9854switches to overwrite mode. With an explicit non-positive numeric 9855argument, switches to insert mode. This command affects only 9856<CODE>emacs</CODE> mode; <CODE>vi</CODE> mode does overwrite differently. 9857Each call to <CODE>readline()</CODE> starts in insert mode. 9858<P> 9859 9860In overwrite mode, characters bound to <CODE>self-insert</CODE> replace 9861the text at point rather than pushing the text to the right. 9862Characters bound to <CODE>backward-delete-char</CODE> replace the character 9863before point with a space. 9864</P><P> 9865 9866By default, this command is unbound. 9867</P><P> 9868 9869</DL> 9870<P> 9871 9872<A NAME="Commands For Killing"></A> 9873<HR SIZE="6"> 9874<A NAME="SEC107"></A> 9875<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 9876<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> < </A>]</TD> 9877<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> > </A>]</TD> 9878<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> << </A>]</TD> 9879<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> 9880<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> >> </A>]</TD> 9881<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 9882<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 9883<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 9884<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 9885</TR></TABLE> 9886<H3> 8.4.4 Killing And Yanking </H3> 9887<!--docid::SEC107::--> 9888<P> 9889 9890<DL COMPACT> 9891 9892<A NAME="IDX376"></A> 9893<DT><CODE>kill-line (C-k)</CODE> 9894<DD><A NAME="IDX377"></A> 9895Kill the text from point to the end of the line. 9896<P> 9897 9898<A NAME="IDX378"></A> 9899<DT><CODE>backward-kill-line (C-x Rubout)</CODE> 9900<DD><A NAME="IDX379"></A> 9901Kill backward to the beginning of the line. 9902<P> 9903 9904<A NAME="IDX380"></A> 9905<DT><CODE>unix-line-discard (C-u)</CODE> 9906<DD><A NAME="IDX381"></A> 9907Kill backward from the cursor to the beginning of the current line. 9908<P> 9909 9910<A NAME="IDX382"></A> 9911<DT><CODE>kill-whole-line ()</CODE> 9912<DD><A NAME="IDX383"></A> 9913Kill all characters on the current line, no matter where point is. 9914By default, this is unbound. 9915<P> 9916 9917<A NAME="IDX384"></A> 9918<DT><CODE>kill-word (M-d)</CODE> 9919<DD><A NAME="IDX385"></A> 9920Kill from point to the end of the current word, or if between 9921words, to the end of the next word. 9922Word boundaries are the same as <CODE>forward-word</CODE>. 9923<P> 9924 9925<A NAME="IDX386"></A> 9926<DT><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE> 9927<DD><A NAME="IDX387"></A> 9928Kill the word behind point. 9929Word boundaries are the same as <CODE>backward-word</CODE>. 9930<P> 9931 9932<A NAME="IDX388"></A> 9933<DT><CODE>unix-word-rubout (C-w)</CODE> 9934<DD><A NAME="IDX389"></A> 9935Kill the word behind point, using white space as a word boundary. 9936The killed text is saved on the kill-ring. 9937<P> 9938 9939<A NAME="IDX390"></A> 9940<DT><CODE>unix-filename-rubout ()</CODE> 9941<DD><A NAME="IDX391"></A> 9942Kill the word behind point, using white space and the slash character 9943as the word boundaries. 9944The killed text is saved on the kill-ring. 9945<P> 9946 9947<A NAME="IDX392"></A> 9948<DT><CODE>delete-horizontal-space ()</CODE> 9949<DD><A NAME="IDX393"></A> 9950Delete all spaces and tabs around point. By default, this is unbound. 9951<P> 9952 9953<A NAME="IDX394"></A> 9954<DT><CODE>kill-region ()</CODE> 9955<DD><A NAME="IDX395"></A> 9956Kill the text in the current region. 9957By default, this command is unbound. 9958<P> 9959 9960<A NAME="IDX396"></A> 9961<DT><CODE>copy-region-as-kill ()</CODE> 9962<DD><A NAME="IDX397"></A> 9963Copy the text in the region to the kill buffer, so it can be yanked 9964right away. By default, this command is unbound. 9965<P> 9966 9967<A NAME="IDX398"></A> 9968<DT><CODE>copy-backward-word ()</CODE> 9969<DD><A NAME="IDX399"></A> 9970Copy the word before point to the kill buffer. 9971The word boundaries are the same as <CODE>backward-word</CODE>. 9972By default, this command is unbound. 9973<P> 9974 9975<A NAME="IDX400"></A> 9976<DT><CODE>copy-forward-word ()</CODE> 9977<DD><A NAME="IDX401"></A> 9978Copy the word following point to the kill buffer. 9979The word boundaries are the same as <CODE>forward-word</CODE>. 9980By default, this command is unbound. 9981<P> 9982 9983<A NAME="IDX402"></A> 9984<DT><CODE>yank (C-y)</CODE> 9985<DD><A NAME="IDX403"></A> 9986Yank the top of the kill ring into the buffer at point. 9987<P> 9988 9989<A NAME="IDX404"></A> 9990<DT><CODE>yank-pop (M-y)</CODE> 9991<DD><A NAME="IDX405"></A> 9992Rotate the kill-ring, and yank the new top. You can only do this if 9993the prior command is <CODE>yank</CODE> or <CODE>yank-pop</CODE>. 9994</DL> 9995<P> 9996 9997<A NAME="Numeric Arguments"></A> 9998<HR SIZE="6"> 9999<A NAME="SEC108"></A> 10000<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 10001<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> < </A>]</TD> 10002<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> > </A>]</TD> 10003<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> << </A>]</TD> 10004<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> 10005<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> >> </A>]</TD> 10006<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 10007<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 10008<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 10009<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 10010</TR></TABLE> 10011<H3> 8.4.5 Specifying Numeric Arguments </H3> 10012<!--docid::SEC108::--> 10013<DL COMPACT> 10014 10015<A NAME="IDX406"></A> 10016<DT><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE> 10017<DD><A NAME="IDX407"></A> 10018Add this digit to the argument already accumulating, or start a new 10019argument. <KBD>M--</KBD> starts a negative argument. 10020<P> 10021 10022<A NAME="IDX408"></A> 10023<DT><CODE>universal-argument ()</CODE> 10024<DD><A NAME="IDX409"></A> 10025This is another way to specify an argument. 10026If this command is followed by one or more digits, optionally with a 10027leading minus sign, those digits define the argument. 10028If the command is followed by digits, executing <CODE>universal-argument</CODE> 10029again ends the numeric argument, but is otherwise ignored. 10030As a special case, if this command is immediately followed by a 10031character that is neither a digit or minus sign, the argument count 10032for the next command is multiplied by four. 10033The argument count is initially one, so executing this function the 10034first time makes the argument count four, a second time makes the 10035argument count sixteen, and so on. 10036By default, this is not bound to a key. 10037</DL> 10038<P> 10039 10040<A NAME="Commands For Completion"></A> 10041<HR SIZE="6"> 10042<A NAME="SEC109"></A> 10043<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 10044<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> < </A>]</TD> 10045<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> > </A>]</TD> 10046<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> << </A>]</TD> 10047<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> 10048<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> >> </A>]</TD> 10049<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 10050<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 10051<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 10052<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 10053</TR></TABLE> 10054<H3> 8.4.6 Letting Readline Type For You </H3> 10055<!--docid::SEC109::--> 10056<P> 10057 10058<DL COMPACT> 10059<A NAME="IDX410"></A> 10060<DT><CODE>complete (<KBD>TAB</KBD>)</CODE> 10061<DD><A NAME="IDX411"></A> 10062Attempt to perform completion on the text before point. 10063The actual completion performed is application-specific. 10064Bash attempts completion treating the text as a variable (if the 10065text begins with <SAMP>`$'</SAMP>), username (if the text begins with 10066<SAMP>`~'</SAMP>), hostname (if the text begins with <SAMP>`@'</SAMP>), or 10067command (including aliases and functions) in turn. If none 10068of these produces a match, filename completion is attempted. 10069<P> 10070 10071<A NAME="IDX412"></A> 10072<DT><CODE>possible-completions (M-?)</CODE> 10073<DD><A NAME="IDX413"></A> 10074List the possible completions of the text before point. 10075<P> 10076 10077<A NAME="IDX414"></A> 10078<DT><CODE>insert-completions (M-*)</CODE> 10079<DD><A NAME="IDX415"></A> 10080Insert all completions of the text before point that would have 10081been generated by <CODE>possible-completions</CODE>. 10082<P> 10083 10084<A NAME="IDX416"></A> 10085<DT><CODE>menu-complete ()</CODE> 10086<DD><A NAME="IDX417"></A> 10087Similar to <CODE>complete</CODE>, but replaces the word to be completed 10088with a single match from the list of possible completions. 10089Repeated execution of <CODE>menu-complete</CODE> steps through the list 10090of possible completions, inserting each match in turn. 10091At the end of the list of completions, the bell is rung 10092(subject to the setting of <CODE>bell-style</CODE>) 10093and the original text is restored. 10094An argument of <VAR>n</VAR> moves <VAR>n</VAR> positions forward in the list 10095of matches; a negative argument may be used to move backward 10096through the list. 10097This command is intended to be bound to <KBD>TAB</KBD>, but is unbound 10098by default. 10099<P> 10100 10101<A NAME="IDX418"></A> 10102<DT><CODE>delete-char-or-list ()</CODE> 10103<DD><A NAME="IDX419"></A> 10104Deletes the character under the cursor if not at the beginning or 10105end of the line (like <CODE>delete-char</CODE>). 10106If at the end of the line, behaves identically to 10107<CODE>possible-completions</CODE>. 10108This command is unbound by default. 10109<P> 10110 10111<A NAME="IDX420"></A> 10112<DT><CODE>complete-filename (M-/)</CODE> 10113<DD><A NAME="IDX421"></A> 10114Attempt filename completion on the text before point. 10115<P> 10116 10117<A NAME="IDX422"></A> 10118<DT><CODE>possible-filename-completions (C-x /)</CODE> 10119<DD><A NAME="IDX423"></A> 10120List the possible completions of the text before point, 10121treating it as a filename. 10122<P> 10123 10124<A NAME="IDX424"></A> 10125<DT><CODE>complete-username (M-~)</CODE> 10126<DD><A NAME="IDX425"></A> 10127Attempt completion on the text before point, treating 10128it as a username. 10129<P> 10130 10131<A NAME="IDX426"></A> 10132<DT><CODE>possible-username-completions (C-x ~)</CODE> 10133<DD><A NAME="IDX427"></A> 10134List the possible completions of the text before point, 10135treating it as a username. 10136<P> 10137 10138<A NAME="IDX428"></A> 10139<DT><CODE>complete-variable (M-$)</CODE> 10140<DD><A NAME="IDX429"></A> 10141Attempt completion on the text before point, treating 10142it as a shell variable. 10143<P> 10144 10145<A NAME="IDX430"></A> 10146<DT><CODE>possible-variable-completions (C-x $)</CODE> 10147<DD><A NAME="IDX431"></A> 10148List the possible completions of the text before point, 10149treating it as a shell variable. 10150<P> 10151 10152<A NAME="IDX432"></A> 10153<DT><CODE>complete-hostname (M-@)</CODE> 10154<DD><A NAME="IDX433"></A> 10155Attempt completion on the text before point, treating 10156it as a hostname. 10157<P> 10158 10159<A NAME="IDX434"></A> 10160<DT><CODE>possible-hostname-completions (C-x @)</CODE> 10161<DD><A NAME="IDX435"></A> 10162List the possible completions of the text before point, 10163treating it as a hostname. 10164<P> 10165 10166<A NAME="IDX436"></A> 10167<DT><CODE>complete-command (M-!)</CODE> 10168<DD><A NAME="IDX437"></A> 10169Attempt completion on the text before point, treating 10170it as a command name. Command completion attempts to 10171match the text against aliases, reserved words, shell 10172functions, shell builtins, and finally executable filenames, 10173in that order. 10174<P> 10175 10176<A NAME="IDX438"></A> 10177<DT><CODE>possible-command-completions (C-x !)</CODE> 10178<DD><A NAME="IDX439"></A> 10179List the possible completions of the text before point, 10180treating it as a command name. 10181<P> 10182 10183<A NAME="IDX440"></A> 10184<DT><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE> 10185<DD><A NAME="IDX441"></A> 10186Attempt completion on the text before point, comparing 10187the text against lines from the history list for possible 10188completion matches. 10189<P> 10190 10191<A NAME="IDX442"></A> 10192<DT><CODE>complete-into-braces (M-{)</CODE> 10193<DD><A NAME="IDX443"></A> 10194Perform filename completion and insert the list of possible completions 10195enclosed within braces so the list is available to the shell 10196(see section <A HREF="bashref.html#SEC28">3.5.1 Brace Expansion</A>). 10197<P> 10198 10199</DL> 10200<P> 10201 10202<A NAME="Keyboard Macros"></A> 10203<HR SIZE="6"> 10204<A NAME="SEC110"></A> 10205<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 10206<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> < </A>]</TD> 10207<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> > </A>]</TD> 10208<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> << </A>]</TD> 10209<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> 10210<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> >> </A>]</TD> 10211<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 10212<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 10213<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 10214<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 10215</TR></TABLE> 10216<H3> 8.4.7 Keyboard Macros </H3> 10217<!--docid::SEC110::--> 10218<DL COMPACT> 10219 10220<A NAME="IDX444"></A> 10221<DT><CODE>start-kbd-macro (C-x ()</CODE> 10222<DD><A NAME="IDX445"></A> 10223Begin saving the characters typed into the current keyboard macro. 10224<P> 10225 10226<A NAME="IDX446"></A> 10227<DT><CODE>end-kbd-macro (C-x ))</CODE> 10228<DD><A NAME="IDX447"></A> 10229Stop saving the characters typed into the current keyboard macro 10230and save the definition. 10231<P> 10232 10233<A NAME="IDX448"></A> 10234<DT><CODE>call-last-kbd-macro (C-x e)</CODE> 10235<DD><A NAME="IDX449"></A> 10236Re-execute the last keyboard macro defined, by making the characters 10237in the macro appear as if typed at the keyboard. 10238<P> 10239 10240</DL> 10241<P> 10242 10243<A NAME="Miscellaneous Commands"></A> 10244<HR SIZE="6"> 10245<A NAME="SEC111"></A> 10246<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 10247<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> < </A>]</TD> 10248<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> > </A>]</TD> 10249<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> << </A>]</TD> 10250<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD> 10251<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> >> </A>]</TD> 10252<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 10253<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 10254<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 10255<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 10256</TR></TABLE> 10257<H3> 8.4.8 Some Miscellaneous Commands </H3> 10258<!--docid::SEC111::--> 10259<DL COMPACT> 10260 10261<A NAME="IDX450"></A> 10262<DT><CODE>re-read-init-file (C-x C-r)</CODE> 10263<DD><A NAME="IDX451"></A> 10264Read in the contents of the <VAR>inputrc</VAR> file, and incorporate 10265any bindings or variable assignments found there. 10266<P> 10267 10268<A NAME="IDX452"></A> 10269<DT><CODE>abort (C-g)</CODE> 10270<DD><A NAME="IDX453"></A> 10271Abort the current editing command and 10272ring the terminal's bell (subject to the setting of 10273<CODE>bell-style</CODE>). 10274<P> 10275 10276<A NAME="IDX454"></A> 10277<DT><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE> 10278<DD><A NAME="IDX455"></A> 10279If the metafied character <VAR>x</VAR> is lowercase, run the command 10280that is bound to the corresponding uppercase character. 10281<P> 10282 10283<A NAME="IDX456"></A> 10284<DT><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE> 10285<DD><A NAME="IDX457"></A> 10286Metafy the next character typed. This is for keyboards 10287without a meta key. Typing <SAMP>`<KBD>ESC</KBD> f'</SAMP> is equivalent to typing 10288<KBD>M-f</KBD>. 10289<P> 10290 10291<A NAME="IDX458"></A> 10292<DT><CODE>undo (C-_ or C-x C-u)</CODE> 10293<DD><A NAME="IDX459"></A> 10294Incremental undo, separately remembered for each line. 10295<P> 10296 10297<A NAME="IDX460"></A> 10298<DT><CODE>revert-line (M-r)</CODE> 10299<DD><A NAME="IDX461"></A> 10300Undo all changes made to this line. This is like executing the <CODE>undo</CODE> 10301command enough times to get back to the beginning. 10302<P> 10303 10304<A NAME="IDX462"></A> 10305<DT><CODE>tilde-expand (M-&)</CODE> 10306<DD><A NAME="IDX463"></A> 10307Perform tilde expansion on the current word. 10308<P> 10309 10310<A NAME="IDX464"></A> 10311<DT><CODE>set-mark (C-@)</CODE> 10312<DD><A NAME="IDX465"></A> 10313Set the mark to the point. If a 10314numeric argument is supplied, the mark is set to that position. 10315<P> 10316 10317<A NAME="IDX466"></A> 10318<DT><CODE>exchange-point-and-mark (C-x C-x)</CODE> 10319<DD><A NAME="IDX467"></A> 10320Swap the point with the mark. The current cursor position is set to 10321the saved position, and the old cursor position is saved as the mark. 10322<P> 10323 10324<A NAME="IDX468"></A> 10325<DT><CODE>character-search (C-])</CODE> 10326<DD><A NAME="IDX469"></A> 10327A character is read and point is moved to the next occurrence of that 10328character. A negative count searches for previous occurrences. 10329<P> 10330 10331<A NAME="IDX470"></A> 10332<DT><CODE>character-search-backward (M-C-])</CODE> 10333<DD><A NAME="IDX471"></A> 10334A character is read and point is moved to the previous occurrence 10335of that character. A negative count searches for subsequent 10336occurrences. 10337<P> 10338 10339<A NAME="IDX472"></A> 10340<DT><CODE>insert-comment (M-#)</CODE> 10341<DD><A NAME="IDX473"></A> 10342Without a numeric argument, the value of the <CODE>comment-begin</CODE> 10343variable is inserted at the beginning of the current line. 10344If a numeric argument is supplied, this command acts as a toggle: if 10345the characters at the beginning of the line do not match the value 10346of <CODE>comment-begin</CODE>, the value is inserted, otherwise 10347the characters in <CODE>comment-begin</CODE> are deleted from the beginning of 10348the line. 10349In either case, the line is accepted as if a newline had been typed. 10350The default value of <CODE>comment-begin</CODE> causes this command 10351to make the current line a shell comment. 10352If a numeric argument causes the comment character to be removed, the line 10353will be executed by the shell. 10354<P> 10355 10356<A NAME="IDX474"></A> 10357<DT><CODE>dump-functions ()</CODE> 10358<DD><A NAME="IDX475"></A> 10359Print all of the functions and their key bindings to the 10360Readline output stream. If a numeric argument is supplied, 10361the output is formatted in such a way that it can be made part 10362of an <VAR>inputrc</VAR> file. This command is unbound by default. 10363<P> 10364 10365<A NAME="IDX476"></A> 10366<DT><CODE>dump-variables ()</CODE> 10367<DD><A NAME="IDX477"></A> 10368Print all of the settable variables and their values to the 10369Readline output stream. If a numeric argument is supplied, 10370the output is formatted in such a way that it can be made part 10371of an <VAR>inputrc</VAR> file. This command is unbound by default. 10372<P> 10373 10374<A NAME="IDX478"></A> 10375<DT><CODE>dump-macros ()</CODE> 10376<DD><A NAME="IDX479"></A> 10377Print all of the Readline key sequences bound to macros and the 10378strings they output. If a numeric argument is supplied, 10379the output is formatted in such a way that it can be made part 10380of an <VAR>inputrc</VAR> file. This command is unbound by default. 10381<P> 10382 10383<A NAME="IDX480"></A> 10384<DT><CODE>glob-complete-word (M-g)</CODE> 10385<DD><A NAME="IDX481"></A> 10386The word before point is treated as a pattern for pathname expansion, 10387with an asterisk implicitly appended. This pattern is used to 10388generate a list of matching file names for possible completions. 10389<P> 10390 10391<A NAME="IDX482"></A> 10392<DT><CODE>glob-expand-word (C-x *)</CODE> 10393<DD><A NAME="IDX483"></A> 10394The word before point is treated as a pattern for pathname expansion, 10395and the list of matching file names is inserted, replacing the word. 10396If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before 10397pathname expansion. 10398<P> 10399 10400<A NAME="IDX484"></A> 10401<DT><CODE>glob-list-expansions (C-x g)</CODE> 10402<DD><A NAME="IDX485"></A> 10403The list of expansions that would have been generated by 10404<CODE>glob-expand-word</CODE> is displayed, and the line is redrawn. 10405If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before 10406pathname expansion. 10407<P> 10408 10409<A NAME="IDX486"></A> 10410<DT><CODE>display-shell-version (C-x C-v)</CODE> 10411<DD><A NAME="IDX487"></A> 10412Display version information about the current instance of Bash. 10413<P> 10414 10415<A NAME="IDX488"></A> 10416<DT><CODE>shell-expand-line (M-C-e)</CODE> 10417<DD><A NAME="IDX489"></A> 10418Expand the line as the shell does. 10419This performs alias and history expansion as well as all of the shell 10420word expansions (see section <A HREF="bashref.html#SEC27">3.5 Shell Expansions</A>). 10421<P> 10422 10423<A NAME="IDX490"></A> 10424<DT><CODE>history-expand-line (M-^)</CODE> 10425<DD><A NAME="IDX491"></A> 10426Perform history expansion on the current line. 10427<P> 10428 10429<A NAME="IDX492"></A> 10430<DT><CODE>magic-space ()</CODE> 10431<DD><A NAME="IDX493"></A> 10432Perform history expansion on the current line and insert a space 10433(see section <A HREF="bashref.html#SEC118">9.3 History Expansion</A>). 10434<P> 10435 10436<A NAME="IDX494"></A> 10437<DT><CODE>alias-expand-line ()</CODE> 10438<DD><A NAME="IDX495"></A> 10439Perform alias expansion on the current line (see section <A HREF="bashref.html#SEC80">6.6 Aliases</A>). 10440<P> 10441 10442<A NAME="IDX496"></A> 10443<DT><CODE>history-and-alias-expand-line ()</CODE> 10444<DD><A NAME="IDX497"></A> 10445Perform history and alias expansion on the current line. 10446<P> 10447 10448<A NAME="IDX498"></A> 10449<DT><CODE>insert-last-argument (M-. or M-_)</CODE> 10450<DD><A NAME="IDX499"></A> 10451A synonym for <CODE>yank-last-arg</CODE>. 10452<P> 10453 10454<A NAME="IDX500"></A> 10455<DT><CODE>operate-and-get-next (C-o)</CODE> 10456<DD><A NAME="IDX501"></A> 10457Accept the current line for execution and fetch the next line 10458relative to the current line from the history for editing. Any 10459argument is ignored. 10460<P> 10461 10462<A NAME="IDX502"></A> 10463<DT><CODE>edit-and-execute-command (C-xC-e)</CODE> 10464<DD><A NAME="IDX503"></A> 10465Invoke an editor on the current command line, and execute the result as shell 10466commands. 10467Bash attempts to invoke 10468<CODE>$VISUAL</CODE>, <CODE>$EDITOR</CODE>, and <CODE>emacs</CODE> 10469as the editor, in that order. 10470<P> 10471 10472</DL> 10473<P> 10474 10475<A NAME="Readline vi Mode"></A> 10476<HR SIZE="6"> 10477<A NAME="SEC112"></A> 10478<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 10479<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> < </A>]</TD> 10480<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> > </A>]</TD> 10481<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> << </A>]</TD> 10482<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> 10483<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> >> </A>]</TD> 10484<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 10485<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 10486<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 10487<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 10488</TR></TABLE> 10489<H2> 8.5 Readline vi Mode </H2> 10490<!--docid::SEC112::--> 10491<P> 10492 10493While the Readline library does not have a full set of <CODE>vi</CODE> 10494editing functions, it does contain enough to allow simple editing 10495of the line. The Readline <CODE>vi</CODE> mode behaves as specified in 10496the POSIX 1003.2 standard. 10497</P><P> 10498 10499In order to switch interactively between <CODE>emacs</CODE> and <CODE>vi</CODE> 10500editing modes, use the <SAMP>`set -o emacs'</SAMP> and <SAMP>`set -o vi'</SAMP> 10501commands (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 10502The Readline default is <CODE>emacs</CODE> mode. 10503</P><P> 10504 10505When you enter a line in <CODE>vi</CODE> mode, you are already placed in 10506`insertion' mode, as if you had typed an <SAMP>`i'</SAMP>. Pressing <KBD>ESC</KBD> 10507switches you into `command' mode, where you can edit the text of the 10508line with the standard <CODE>vi</CODE> movement keys, move to previous 10509history lines with <SAMP>`k'</SAMP> and subsequent lines with <SAMP>`j'</SAMP>, and 10510so forth. 10511</P><P> 10512 10513<A NAME="Programmable Completion"></A> 10514<HR SIZE="6"> 10515<A NAME="SEC113"></A> 10516<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 10517<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> < </A>]</TD> 10518<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> > </A>]</TD> 10519<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> << </A>]</TD> 10520<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> 10521<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> >> </A>]</TD> 10522<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 10523<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 10524<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 10525<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 10526</TR></TABLE> 10527<H2> 8.6 Programmable Completion </H2> 10528<!--docid::SEC113::--> 10529<P> 10530 10531When word completion is attempted for an argument to a command for 10532which a completion specification (a <VAR>compspec</VAR>) has been defined 10533using the <CODE>complete</CODE> builtin (see section <A HREF="bashref.html#SEC114">8.7 Programmable Completion Builtins</A>), 10534the programmable completion facilities are invoked. 10535</P><P> 10536 10537First, the command name is identified. 10538If a compspec has been defined for that command, the 10539compspec is used to generate the list of possible completions for the word. 10540If the command word is a full pathname, a compspec for the full 10541pathname is searched for first. 10542If no compspec is found for the full pathname, an attempt is made to 10543find a compspec for the portion following the final slash. 10544</P><P> 10545 10546Once a compspec has been found, it is used to generate the list of 10547matching words. 10548If a compspec is not found, the default Bash completion 10549described above (see section <A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A>) is performed. 10550</P><P> 10551 10552First, the actions specified by the compspec are used. 10553Only matches which are prefixed by the word being completed are 10554returned. 10555When the <SAMP>`-f'</SAMP> or <SAMP>`-d'</SAMP> option is used for filename or 10556directory name completion, the shell variable <CODE>FIGNORE</CODE> is 10557used to filter the matches. 10558See section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>. 10559</P><P> 10560 10561Any completions specified by a filename expansion pattern to the 10562<SAMP>`-G'</SAMP> option are generated next. 10563The words generated by the pattern need not match the word being completed. 10564The <CODE>GLOBIGNORE</CODE> shell variable is not used to filter the matches, 10565but the <CODE>FIGNORE</CODE> shell variable is used. 10566</P><P> 10567 10568Next, the string specified as the argument to the <SAMP>`-W'</SAMP> option 10569is considered. 10570The string is first split using the characters in the <CODE>IFS</CODE> 10571special variable as delimiters. 10572Shell quoting is honored. 10573Each word is then expanded using 10574brace expansion, tilde expansion, parameter and variable expansion, 10575command substitution, and arithmetic expansion, 10576as described above (see section <A HREF="bashref.html#SEC27">3.5 Shell Expansions</A>). 10577The results are split using the rules described above 10578(see section <A HREF="bashref.html#SEC34">3.5.7 Word Splitting</A>). 10579The results of the expansion are prefix-matched against the word being 10580completed, and the matching words become the possible completions. 10581</P><P> 10582 10583After these matches have been generated, any shell function or command 10584specified with the <SAMP>`-F'</SAMP> and <SAMP>`-C'</SAMP> options is invoked. 10585When the command or function is invoked, the <CODE>COMP_LINE</CODE> and 10586<CODE>COMP_POINT</CODE> variables are assigned values as described above 10587(see section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>). 10588If a shell function is being invoked, the <CODE>COMP_WORDS</CODE> and 10589<CODE>COMP_CWORD</CODE> variables are also set. 10590When the function or command is invoked, the first argument is the 10591name of the command whose arguments are being completed, the 10592second argument is the word being completed, and the third argument 10593is the word preceding the word being completed on the current command line. 10594No filtering of the generated completions against the word being completed 10595is performed; the function or command has complete freedom in generating 10596the matches. 10597</P><P> 10598 10599Any function specified with <SAMP>`-F'</SAMP> is invoked first. 10600The function may use any of the shell facilities, including the 10601<CODE>compgen</CODE> builtin described below 10602(see section <A HREF="bashref.html#SEC114">8.7 Programmable Completion Builtins</A>), to generate the matches. 10603It must put the possible completions in the <CODE>COMPREPLY</CODE> array 10604variable. 10605</P><P> 10606 10607Next, any command specified with the <SAMP>`-C'</SAMP> option is invoked 10608in an environment equivalent to command substitution. 10609It should print a list of completions, one per line, to 10610the standard output. 10611Backslash may be used to escape a newline, if necessary. 10612</P><P> 10613 10614After all of the possible completions are generated, any filter 10615specified with the <SAMP>`-X'</SAMP> option is applied to the list. 10616The filter is a pattern as used for pathname expansion; a <SAMP>`&'</SAMP> 10617in the pattern is replaced with the text of the word being completed. 10618A literal <SAMP>`&'</SAMP> may be escaped with a backslash; the backslash 10619is removed before attempting a match. 10620Any completion that matches the pattern will be removed from the list. 10621A leading <SAMP>`!'</SAMP> negates the pattern; in this case any completion 10622not matching the pattern will be removed. 10623</P><P> 10624 10625Finally, any prefix and suffix specified with the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> 10626options are added to each member of the completion list, and the result is 10627returned to the Readline completion code as the list of possible 10628completions. 10629</P><P> 10630 10631If the previously-applied actions do not generate any matches, and the 10632<SAMP>`-o dirnames'</SAMP> option was supplied to <CODE>complete</CODE> when the 10633compspec was defined, directory name completion is attempted. 10634</P><P> 10635 10636If the <SAMP>`-o plusdirs'</SAMP> option was supplied to <CODE>complete</CODE> when 10637the compspec was defined, directory name completion is attempted and any 10638matches are added to the results of the other actions. 10639</P><P> 10640 10641By default, if a compspec is found, whatever it generates is returned to 10642the completion code as the full set of possible completions. 10643The default Bash completions are not attempted, and the Readline default 10644of filename completion is disabled. 10645If the <SAMP>`-o bashdefault'</SAMP> option was supplied to <CODE>complete</CODE> when 10646the compspec was defined, the default Bash completions are attempted 10647if the compspec generates no matches. 10648If the <SAMP>`-o default'</SAMP> option was supplied to <CODE>complete</CODE> when the 10649compspec was defined, Readline's default completion will be performed 10650if the compspec (and, if attempted, the default Bash completions) 10651generate no matches. 10652</P><P> 10653 10654When a compspec indicates that directory name completion is desired, 10655the programmable completion functions force Readline to append a slash 10656to completed names which are symbolic links to directories, subject to 10657the value of the <VAR>mark-directories</VAR> Readline variable, regardless 10658of the setting of the <VAR>mark-symlinked-directories</VAR> Readline variable. 10659</P><P> 10660 10661<A NAME="Programmable Completion Builtins"></A> 10662<HR SIZE="6"> 10663<A NAME="SEC114"></A> 10664<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 10665<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> < </A>]</TD> 10666<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> > </A>]</TD> 10667<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD> 10668<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD> 10669<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> >> </A>]</TD> 10670<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 10671<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 10672<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 10673<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 10674</TR></TABLE> 10675<H2> 8.7 Programmable Completion Builtins </H2> 10676<!--docid::SEC114::--> 10677<P> 10678 10679Two builtin commands are available to manipulate the programmable completion 10680facilities. 10681</P><P> 10682 10683<DL COMPACT> 10684<DT><CODE>compgen</CODE> 10685<DD><A NAME="IDX504"></A> 10686<TABLE><tr><td> </td><td class=example><pre><CODE>compgen [<VAR>option</VAR>] [<VAR>word</VAR>]</CODE> 10687</pre></td></tr></table><P> 10688 10689Generate possible completion matches for <VAR>word</VAR> according to 10690the <VAR>option</VAR>s, which may be any option accepted by the 10691<CODE>complete</CODE> 10692builtin with the exception of <SAMP>`-p'</SAMP> and <SAMP>`-r'</SAMP>, and write 10693the matches to the standard output. 10694When using the <SAMP>`-F'</SAMP> or <SAMP>`-C'</SAMP> options, the various shell variables 10695set by the programmable completion facilities, while available, will not 10696have useful values. 10697</P><P> 10698 10699The matches will be generated in the same way as if the programmable 10700completion code had generated them directly from a completion specification 10701with the same flags. 10702If <VAR>word</VAR> is specified, only those completions matching <VAR>word</VAR> 10703will be displayed. 10704</P><P> 10705 10706The return value is true unless an invalid option is supplied, or no 10707matches were generated. 10708</P><P> 10709 10710<DT><CODE>complete</CODE> 10711<DD><A NAME="IDX505"></A> 10712<TABLE><tr><td> </td><td class=example><pre><CODE>complete [-abcdefgjksuv] [-o <VAR>comp-option</VAR>] [-A <VAR>action</VAR>] [-G <VAR>globpat</VAR>] [-W <VAR>wordlist</VAR>] 10713[-P <VAR>prefix</VAR>] [-S <VAR>suffix</VAR>] [-X <VAR>filterpat</VAR>] [-F <VAR>function</VAR>] 10714[-C <VAR>command</VAR>] <VAR>name</VAR> [<VAR>name</VAR> <small>...</small>]</CODE> 10715<CODE>complete -pr [<VAR>name</VAR> <small>...</small>]</CODE> 10716</pre></td></tr></table><P> 10717 10718Specify how arguments to each <VAR>name</VAR> should be completed. 10719If the <SAMP>`-p'</SAMP> option is supplied, or if no options are supplied, existing 10720completion specifications are printed in a way that allows them to be 10721reused as input. 10722The <SAMP>`-r'</SAMP> option removes a completion specification for 10723each <VAR>name</VAR>, or, if no <VAR>name</VAR>s are supplied, all 10724completion specifications. 10725</P><P> 10726 10727The process of applying these completion specifications when word completion 10728is attempted is described above (see section <A HREF="bashref.html#SEC113">8.6 Programmable Completion</A>). 10729</P><P> 10730 10731Other options, if specified, have the following meanings. 10732The arguments to the <SAMP>`-G'</SAMP>, <SAMP>`-W'</SAMP>, and <SAMP>`-X'</SAMP> options 10733(and, if necessary, the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> options) 10734should be quoted to protect them from expansion before the 10735<CODE>complete</CODE> builtin is invoked. 10736</P><P> 10737 10738<DL COMPACT> 10739<DT><CODE>-o <VAR>comp-option</VAR></CODE> 10740<DD>The <VAR>comp-option</VAR> controls several aspects of the compspec's behavior 10741beyond the simple generation of completions. 10742<VAR>comp-option</VAR> may be one of: 10743<P> 10744 10745<DL COMPACT> 10746 10747<DT><CODE>bashdefault</CODE> 10748<DD>Perform the rest of the default Bash completions if the compspec 10749generates no matches. 10750<P> 10751 10752<DT><CODE>default</CODE> 10753<DD>Use Readline's default filename completion if the compspec generates 10754no matches. 10755<P> 10756 10757<DT><CODE>dirnames</CODE> 10758<DD>Perform directory name completion if the compspec generates no matches. 10759<P> 10760 10761<DT><CODE>filenames</CODE> 10762<DD>Tell Readline that the compspec generates filenames, so it can perform any 10763filename-specific processing (like adding a slash to directory names or 10764suppressing trailing spaces). This option is intended to be used with 10765shell functions specified with <SAMP>`-F'</SAMP>. 10766<P> 10767 10768<DT><CODE>nospace</CODE> 10769<DD>Tell Readline not to append a space (the default) to words completed at 10770the end of the line. 10771<P> 10772 10773<DT><CODE>plusdirs</CODE> 10774<DD>After any matches defined by the compspec are generated, 10775directory name completion is attempted and any 10776matches are added to the results of the other actions. 10777<P> 10778 10779</DL> 10780<P> 10781 10782<DT><CODE>-A <VAR>action</VAR></CODE> 10783<DD>The <VAR>action</VAR> may be one of the following to generate a list of possible 10784completions: 10785<P> 10786 10787<DL COMPACT> 10788<DT><CODE>alias</CODE> 10789<DD>Alias names. May also be specified as <SAMP>`-a'</SAMP>. 10790<P> 10791 10792<DT><CODE>arrayvar</CODE> 10793<DD>Array variable names. 10794<P> 10795 10796<DT><CODE>binding</CODE> 10797<DD>Readline key binding names (see section <A HREF="bashref.html#SEC103">8.4 Bindable Readline Commands</A>). 10798<P> 10799 10800<DT><CODE>builtin</CODE> 10801<DD>Names of shell builtin commands. May also be specified as <SAMP>`-b'</SAMP>. 10802<P> 10803 10804<DT><CODE>command</CODE> 10805<DD>Command names. May also be specified as <SAMP>`-c'</SAMP>. 10806<P> 10807 10808<DT><CODE>directory</CODE> 10809<DD>Directory names. May also be specified as <SAMP>`-d'</SAMP>. 10810<P> 10811 10812<DT><CODE>disabled</CODE> 10813<DD>Names of disabled shell builtins. 10814<P> 10815 10816<DT><CODE>enabled</CODE> 10817<DD>Names of enabled shell builtins. 10818<P> 10819 10820<DT><CODE>export</CODE> 10821<DD>Names of exported shell variables. May also be specified as <SAMP>`-e'</SAMP>. 10822<P> 10823 10824<DT><CODE>file</CODE> 10825<DD>File names. May also be specified as <SAMP>`-f'</SAMP>. 10826<P> 10827 10828<DT><CODE>function</CODE> 10829<DD>Names of shell functions. 10830<P> 10831 10832<DT><CODE>group</CODE> 10833<DD>Group names. May also be specified as <SAMP>`-g'</SAMP>. 10834<P> 10835 10836<DT><CODE>helptopic</CODE> 10837<DD>Help topics as accepted by the <CODE>help</CODE> builtin (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 10838<P> 10839 10840<DT><CODE>hostname</CODE> 10841<DD>Hostnames, as taken from the file specified by the 10842<CODE>HOSTFILE</CODE> shell variable (see section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>). 10843<P> 10844 10845<DT><CODE>job</CODE> 10846<DD>Job names, if job control is active. May also be specified as <SAMP>`-j'</SAMP>. 10847<P> 10848 10849<DT><CODE>keyword</CODE> 10850<DD>Shell reserved words. May also be specified as <SAMP>`-k'</SAMP>. 10851<P> 10852 10853<DT><CODE>running</CODE> 10854<DD>Names of running jobs, if job control is active. 10855<P> 10856 10857<DT><CODE>service</CODE> 10858<DD>Service names. May also be specified as <SAMP>`-s'</SAMP>. 10859<P> 10860 10861<DT><CODE>setopt</CODE> 10862<DD>Valid arguments for the <SAMP>`-o'</SAMP> option to the <CODE>set</CODE> builtin 10863(see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 10864<P> 10865 10866<DT><CODE>shopt</CODE> 10867<DD>Shell option names as accepted by the <CODE>shopt</CODE> builtin 10868(see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 10869<P> 10870 10871<DT><CODE>signal</CODE> 10872<DD>Signal names. 10873<P> 10874 10875<DT><CODE>stopped</CODE> 10876<DD>Names of stopped jobs, if job control is active. 10877<P> 10878 10879<DT><CODE>user</CODE> 10880<DD>User names. May also be specified as <SAMP>`-u'</SAMP>. 10881<P> 10882 10883<DT><CODE>variable</CODE> 10884<DD>Names of all shell variables. May also be specified as <SAMP>`-v'</SAMP>. 10885</DL> 10886<P> 10887 10888<DT><CODE>-G <VAR>globpat</VAR></CODE> 10889<DD>The filename expansion pattern <VAR>globpat</VAR> is expanded to generate 10890the possible completions. 10891<P> 10892 10893<DT><CODE>-W <VAR>wordlist</VAR></CODE> 10894<DD>The <VAR>wordlist</VAR> is split using the characters in the 10895<CODE>IFS</CODE> special variable as delimiters, and each resultant word 10896is expanded. 10897The possible completions are the members of the resultant list which 10898match the word being completed. 10899<P> 10900 10901<DT><CODE>-C <VAR>command</VAR></CODE> 10902<DD><VAR>command</VAR> is executed in a subshell environment, and its output is 10903used as the possible completions. 10904<P> 10905 10906<DT><CODE>-F <VAR>function</VAR></CODE> 10907<DD>The shell function <VAR>function</VAR> is executed in the current shell 10908environment. 10909When it finishes, the possible completions are retrieved from the value 10910of the <CODE>COMPREPLY</CODE> array variable. 10911<P> 10912 10913<DT><CODE>-X <VAR>filterpat</VAR></CODE> 10914<DD><VAR>filterpat</VAR> is a pattern as used for filename expansion. 10915It is applied to the list of possible completions generated by the 10916preceding options and arguments, and each completion matching 10917<VAR>filterpat</VAR> is removed from the list. 10918A leading <SAMP>`!'</SAMP> in <VAR>filterpat</VAR> negates the pattern; in this 10919case, any completion not matching <VAR>filterpat</VAR> is removed. 10920<P> 10921 10922<DT><CODE>-P <VAR>prefix</VAR></CODE> 10923<DD><VAR>prefix</VAR> is added at the beginning of each possible completion 10924after all other options have been applied. 10925<P> 10926 10927<DT><CODE>-S <VAR>suffix</VAR></CODE> 10928<DD><VAR>suffix</VAR> is appended to each possible completion 10929after all other options have been applied. 10930</DL> 10931<P> 10932 10933The return value is true unless an invalid option is supplied, an option 10934other than <SAMP>`-p'</SAMP> or <SAMP>`-r'</SAMP> is supplied without a <VAR>name</VAR> 10935argument, an attempt is made to remove a completion specification for 10936a <VAR>name</VAR> for which no specification exists, or 10937an error occurs adding a completion specification. 10938</P><P> 10939 10940</DL> 10941<A NAME="IDX506"></A> 10942<P> 10943 10944<A NAME="Using History Interactively"></A> 10945<HR SIZE="6"> 10946<A NAME="SEC115"></A> 10947<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 10948<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> < </A>]</TD> 10949<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> > </A>]</TD> 10950<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 10951<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 10952<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> >> </A>]</TD> 10953<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 10954<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 10955<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 10956<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 10957</TR></TABLE> 10958<H1> 9. Using History Interactively </H1> 10959<!--docid::SEC115::--> 10960<P> 10961 10962This chapter describes how to use the GNU History Library 10963interactively, from a user's standpoint. 10964It should be considered a user's guide. 10965For information on using the GNU History Library in other programs, 10966see the GNU Readline Library Manual. 10967</P><P> 10968 10969<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 10970<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash lets you manipulate your command 10971 history.</TD></TR> 10972<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC117">9.2 Bash History Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The Bash builtin commands that manipulate 10973 the command history.</TD></TR> 10974<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC118">9.3 History Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What it feels like using History as a user.</TD></TR> 10975</TABLE></BLOCKQUOTE> 10976<P> 10977 10978<A NAME="Bash History Facilities"></A> 10979<HR SIZE="6"> 10980<A NAME="SEC116"></A> 10981<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 10982<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> < </A>]</TD> 10983<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> > </A>]</TD> 10984<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 10985<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> Up </A>]</TD> 10986<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> >> </A>]</TD> 10987<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 10988<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 10989<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 10990<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 10991</TR></TABLE> 10992<H2> 9.1 Bash History Facilities </H2> 10993<!--docid::SEC116::--> 10994<P> 10995 10996When the <SAMP>`-o history'</SAMP> option to the <CODE>set</CODE> builtin 10997is enabled (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>), 10998the shell provides access to the <EM>command history</EM>, 10999the list of commands previously typed. 11000The value of the <CODE>HISTSIZE</CODE> shell variable is used as the 11001number of commands to save in a history list. 11002The text of the last <CODE>$HISTSIZE</CODE> 11003commands (default 500) is saved. 11004The shell stores each command in the history list prior to 11005parameter and variable expansion 11006but after history expansion is performed, subject to the 11007values of the shell variables 11008<CODE>HISTIGNORE</CODE> and <CODE>HISTCONTROL</CODE>. 11009</P><P> 11010 11011When the shell starts up, the history is initialized from the 11012file named by the <CODE>HISTFILE</CODE> variable (default <TT>`~/.bash_history'</TT>). 11013The file named by the value of <CODE>HISTFILE</CODE> is truncated, if 11014necessary, to contain no more than the number of lines specified by 11015the value of the <CODE>HISTFILESIZE</CODE> variable. 11016When an interactive shell exits, the last 11017<CODE>$HISTSIZE</CODE> lines are copied from the history list to the file 11018named by <CODE>$HISTFILE</CODE>. 11019If the <CODE>histappend</CODE> shell option is set (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>), 11020the lines are appended to the history file, 11021otherwise the history file is overwritten. 11022If <CODE>HISTFILE</CODE> 11023is unset, or if the history file is unwritable, the history is 11024not saved. After saving the history, the history file is truncated 11025to contain no more than <CODE>$HISTFILESIZE</CODE> 11026lines. If <CODE>HISTFILESIZE</CODE> is not set, no truncation is performed. 11027</P><P> 11028 11029If the <CODE>HISTTIMEFORMAT</CODE> is set, the time stamp information 11030associated with each history entry is written to the history file. 11031</P><P> 11032 11033The builtin command <CODE>fc</CODE> may be used to list or edit and re-execute 11034a portion of the history list. 11035The <CODE>history</CODE> builtin may be used to display or modify the history 11036list and manipulate the history file. 11037When using command-line editing, search commands 11038are available in each editing mode that provide access to the 11039history list (see section <A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A>). 11040</P><P> 11041 11042The shell allows control over which commands are saved on the history 11043list. The <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> 11044variables may be set to cause the shell to save only a subset of the 11045commands entered. 11046The <CODE>cmdhist</CODE> 11047shell option, if enabled, causes the shell to attempt to save each 11048line of a multi-line command in the same history entry, adding 11049semicolons where necessary to preserve syntactic correctness. 11050The <CODE>lithist</CODE> 11051shell option causes the shell to save the command with embedded newlines 11052instead of semicolons. 11053The <CODE>shopt</CODE> builtin is used to set these options. 11054See section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>, for a description of <CODE>shopt</CODE>. 11055</P><P> 11056 11057<A NAME="Bash History Builtins"></A> 11058<HR SIZE="6"> 11059<A NAME="SEC117"></A> 11060<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11061<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> < </A>]</TD> 11062<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> > </A>]</TD> 11063<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> << </A>]</TD> 11064<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> Up </A>]</TD> 11065<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> >> </A>]</TD> 11066<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11067<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11068<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11069<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11070</TR></TABLE> 11071<H2> 9.2 Bash History Builtins </H2> 11072<!--docid::SEC117::--> 11073<P> 11074 11075Bash provides two builtin commands which manipulate the 11076history list and history file. 11077</P><P> 11078 11079<DL COMPACT> 11080 11081<DT><CODE>fc</CODE> 11082<DD><A NAME="IDX507"></A> 11083<TABLE><tr><td> </td><td class=example><pre><CODE>fc [-e <VAR>ename</VAR>] [-nlr] [<VAR>first</VAR>] [<VAR>last</VAR>]</CODE> 11084<CODE>fc -s [<VAR>pat</VAR>=<VAR>rep</VAR>] [<VAR>command</VAR>]</CODE> 11085</pre></td></tr></table><P> 11086 11087Fix Command. In the first form, a range of commands from <VAR>first</VAR> to 11088<VAR>last</VAR> is selected from the history list. Both <VAR>first</VAR> and 11089<VAR>last</VAR> may be specified as a string (to locate the most recent 11090command beginning with that string) or as a number (an index into the 11091history list, where a negative number is used as an offset from the 11092current command number). If <VAR>last</VAR> is not specified it is set to 11093<VAR>first</VAR>. If <VAR>first</VAR> is not specified it is set to the previous 11094command for editing and -16 for listing. If the <SAMP>`-l'</SAMP> flag is 11095given, the commands are listed on standard output. The <SAMP>`-n'</SAMP> flag 11096suppresses the command numbers when listing. The <SAMP>`-r'</SAMP> flag 11097reverses the order of the listing. Otherwise, the editor given by 11098<VAR>ename</VAR> is invoked on a file containing those commands. If 11099<VAR>ename</VAR> is not given, the value of the following variable expansion 11100is used: <CODE>${FCEDIT:-${EDITOR:-vi}}</CODE>. This says to use the 11101value of the <CODE>FCEDIT</CODE> variable if set, or the value of the 11102<CODE>EDITOR</CODE> variable if that is set, or <CODE>vi</CODE> if neither is set. 11103When editing is complete, the edited commands are echoed and executed. 11104</P><P> 11105 11106In the second form, <VAR>command</VAR> is re-executed after each instance 11107of <VAR>pat</VAR> in the selected command is replaced by <VAR>rep</VAR>. 11108</P><P> 11109 11110A useful alias to use with the <CODE>fc</CODE> command is <CODE>r='fc -s'</CODE>, so 11111that typing <SAMP>`r cc'</SAMP> runs the last command beginning with <CODE>cc</CODE> 11112and typing <SAMP>`r'</SAMP> re-executes the last command (see section <A HREF="bashref.html#SEC80">6.6 Aliases</A>). 11113</P><P> 11114 11115<DT><CODE>history</CODE> 11116<DD><A NAME="IDX508"></A> 11117<TABLE><tr><td> </td><td class=example><pre>history [<VAR>n</VAR>] 11118history -c 11119history -d <VAR>offset</VAR> 11120history [-anrw] [<VAR>filename</VAR>] 11121history -ps <VAR>arg</VAR> 11122</pre></td></tr></table><P> 11123 11124With no options, display the history list with line numbers. 11125Lines prefixed with a <SAMP>`*'</SAMP> have been modified. 11126An argument of <VAR>n</VAR> lists only the last <VAR>n</VAR> lines. 11127If the shell variable <CODE>HISTTIMEFORMAT</CODE> is set and not null, 11128it is used as a format string for <VAR>strftime</VAR> to display 11129the time stamp associated with each displayed history entry. 11130No intervening blank is printed between the formatted time stamp 11131and the history line. 11132</P><P> 11133 11134Options, if supplied, have the following meanings: 11135</P><P> 11136 11137<DL COMPACT> 11138<DT><CODE>-c</CODE> 11139<DD>Clear the history list. This may be combined 11140with the other options to replace the history list completely. 11141<P> 11142 11143<DT><CODE>-d <VAR>offset</VAR></CODE> 11144<DD>Delete the history entry at position <VAR>offset</VAR>. 11145<VAR>offset</VAR> should be specified as it appears when the history is 11146displayed. 11147<P> 11148 11149<DT><CODE>-a</CODE> 11150<DD>Append the new 11151history lines (history lines entered since the beginning of the 11152current Bash session) to the history file. 11153<P> 11154 11155<DT><CODE>-n</CODE> 11156<DD>Append the history lines not already read from the history file 11157to the current history list. These are lines appended to the history 11158file since the beginning of the current Bash session. 11159<P> 11160 11161<DT><CODE>-r</CODE> 11162<DD>Read the current history file and append its contents to 11163the history list. 11164<P> 11165 11166<DT><CODE>-w</CODE> 11167<DD>Write out the current history to the history file. 11168<P> 11169 11170<DT><CODE>-p</CODE> 11171<DD>Perform history substitution on the <VAR>arg</VAR>s and display the result 11172on the standard output, without storing the results in the history list. 11173<P> 11174 11175<DT><CODE>-s</CODE> 11176<DD>The <VAR>arg</VAR>s are added to the end of 11177the history list as a single entry. 11178<P> 11179 11180</DL> 11181<P> 11182 11183When any of the <SAMP>`-w'</SAMP>, <SAMP>`-r'</SAMP>, <SAMP>`-a'</SAMP>, or <SAMP>`-n'</SAMP> options is 11184used, if <VAR>filename</VAR> 11185is given, then it is used as the history file. If not, then 11186the value of the <CODE>HISTFILE</CODE> variable is used. 11187</P><P> 11188 11189</DL> 11190<P> 11191 11192<A NAME="History Interaction"></A> 11193<HR SIZE="6"> 11194<A NAME="SEC118"></A> 11195<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11196<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> < </A>]</TD> 11197<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> > </A>]</TD> 11198<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 11199<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> Up </A>]</TD> 11200<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> >> </A>]</TD> 11201<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11202<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11203<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11204<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11205</TR></TABLE> 11206<H2> 9.3 History Expansion </H2> 11207<!--docid::SEC118::--> 11208<P> 11209 11210The History library provides a history expansion feature that is similar 11211to the history expansion provided by <CODE>csh</CODE>. This section 11212describes the syntax used to manipulate the history information. 11213</P><P> 11214 11215History expansions introduce words from the history list into 11216the input stream, making it easy to repeat commands, insert the 11217arguments to a previous command into the current input line, or 11218fix errors in previous commands quickly. 11219</P><P> 11220 11221History expansion takes place in two parts. The first is to determine 11222which line from the history list should be used during substitution. 11223The second is to select portions of that line for inclusion into the 11224current one. The line selected from the history is called the 11225<EM>event</EM>, and the portions of that line that are acted upon are 11226called <EM>words</EM>. Various <EM>modifiers</EM> are available to manipulate 11227the selected words. The line is broken into words in the same fashion 11228that Bash does, so that several words 11229surrounded by quotes are considered one word. 11230History expansions are introduced by the appearance of the 11231history expansion character, which is <SAMP>`!'</SAMP> by default. 11232Only <SAMP>`\'</SAMP> and <SAMP>`''</SAMP> may be used to escape the history expansion 11233character. 11234</P><P> 11235 11236Several shell options settable with the <CODE>shopt</CODE> 11237builtin (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>) may be used to tailor 11238the behavior of history expansion. If the 11239<CODE>histverify</CODE> shell option is enabled, and Readline 11240is being used, history substitutions are not immediately passed to 11241the shell parser. 11242Instead, the expanded line is reloaded into the Readline 11243editing buffer for further modification. 11244If Readline is being used, and the <CODE>histreedit</CODE> 11245shell option is enabled, a failed history expansion will be 11246reloaded into the Readline editing buffer for correction. 11247The <SAMP>`-p'</SAMP> option to the <CODE>history</CODE> builtin command 11248may be used to see what a history expansion will do before using it. 11249The <SAMP>`-s'</SAMP> option to the <CODE>history</CODE> builtin may be used to 11250add commands to the end of the history list without actually executing 11251them, so that they are available for subsequent recall. 11252This is most useful in conjunction with Readline. 11253</P><P> 11254 11255The shell allows control of the various characters used by the 11256history expansion mechanism with the <CODE>histchars</CODE> variable. 11257</P><P> 11258 11259<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 11260<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC119">9.3.1 Event Designators</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify which history line to use.</TD></TR> 11261<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC120">9.3.2 Word Designators</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying which words are of interest.</TD></TR> 11262<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC121">9.3.3 Modifiers</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Modifying the results of substitution.</TD></TR> 11263</TABLE></BLOCKQUOTE> 11264<P> 11265 11266<A NAME="Event Designators"></A> 11267<HR SIZE="6"> 11268<A NAME="SEC119"></A> 11269<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11270<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> < </A>]</TD> 11271<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> > </A>]</TD> 11272<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 11273<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> Up </A>]</TD> 11274<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> >> </A>]</TD> 11275<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11276<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11277<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11278<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11279</TR></TABLE> 11280<H3> 9.3.1 Event Designators </H3> 11281<!--docid::SEC119::--> 11282<P> 11283 11284An event designator is a reference to a command line entry in the 11285history list. 11286<A NAME="IDX509"></A> 11287</P><P> 11288 11289<DL COMPACT> 11290 11291<DT><CODE>!</CODE> 11292<DD>Start a history substitution, except when followed by a space, tab, 11293the end of the line, <SAMP>`='</SAMP> or <SAMP>`('</SAMP> (when the 11294<CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> builtin). 11295<P> 11296 11297<DT><CODE>!<VAR>n</VAR></CODE> 11298<DD>Refer to command line <VAR>n</VAR>. 11299<P> 11300 11301<DT><CODE>!-<VAR>n</VAR></CODE> 11302<DD>Refer to the command <VAR>n</VAR> lines back. 11303<P> 11304 11305<DT><CODE>!!</CODE> 11306<DD>Refer to the previous command. This is a synonym for <SAMP>`!-1'</SAMP>. 11307<P> 11308 11309<DT><CODE>!<VAR>string</VAR></CODE> 11310<DD>Refer to the most recent command starting with <VAR>string</VAR>. 11311<P> 11312 11313<DT><CODE>!?<VAR>string</VAR>[?]</CODE> 11314<DD>Refer to the most recent command containing <VAR>string</VAR>. The trailing 11315<SAMP>`?'</SAMP> may be omitted if the <VAR>string</VAR> is followed immediately by 11316a newline. 11317<P> 11318 11319<DT><CODE>^<VAR>string1</VAR>^<VAR>string2</VAR>^</CODE> 11320<DD>Quick Substitution. Repeat the last command, replacing <VAR>string1</VAR> 11321with <VAR>string2</VAR>. Equivalent to 11322<CODE>!!:s/<VAR>string1</VAR>/<VAR>string2</VAR>/</CODE>. 11323<P> 11324 11325<DT><CODE>!#</CODE> 11326<DD>The entire command line typed so far. 11327<P> 11328 11329</DL> 11330<P> 11331 11332<A NAME="Word Designators"></A> 11333<HR SIZE="6"> 11334<A NAME="SEC120"></A> 11335<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11336<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> < </A>]</TD> 11337<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> > </A>]</TD> 11338<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> << </A>]</TD> 11339<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> Up </A>]</TD> 11340<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> >> </A>]</TD> 11341<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11342<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11343<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11344<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11345</TR></TABLE> 11346<H3> 9.3.2 Word Designators </H3> 11347<!--docid::SEC120::--> 11348<P> 11349 11350Word designators are used to select desired words from the event. 11351A <SAMP>`:'</SAMP> separates the event specification from the word designator. It 11352may be omitted if the word designator begins with a <SAMP>`^'</SAMP>, <SAMP>`$'</SAMP>, 11353<SAMP>`*'</SAMP>, <SAMP>`-'</SAMP>, or <SAMP>`%'</SAMP>. Words are numbered from the beginning 11354of the line, with the first word being denoted by 0 (zero). Words are 11355inserted into the current line separated by single spaces. 11356</P><P> 11357 11358For example, 11359</P><P> 11360 11361<DL COMPACT> 11362<DT><CODE>!!</CODE> 11363<DD>designates the preceding command. When you type this, the preceding 11364command is repeated in toto. 11365<P> 11366 11367<DT><CODE>!!:$</CODE> 11368<DD>designates the last argument of the preceding command. This may be 11369shortened to <CODE>!$</CODE>. 11370<P> 11371 11372<DT><CODE>!fi:2</CODE> 11373<DD>designates the second argument of the most recent command starting with 11374the letters <CODE>fi</CODE>. 11375</DL> 11376<P> 11377 11378Here are the word designators: 11379 11380<DL COMPACT> 11381 11382<DT><CODE>0 (zero)</CODE> 11383<DD>The <CODE>0</CODE>th word. For many applications, this is the command word. 11384<P> 11385 11386<DT><CODE><VAR>n</VAR></CODE> 11387<DD>The <VAR>n</VAR>th word. 11388<P> 11389 11390<DT><CODE>^</CODE> 11391<DD>The first argument; that is, word 1. 11392<P> 11393 11394<DT><CODE>$</CODE> 11395<DD>The last argument. 11396<P> 11397 11398<DT><CODE>%</CODE> 11399<DD>The word matched by the most recent <SAMP>`?<VAR>string</VAR>?'</SAMP> search. 11400<P> 11401 11402<DT><CODE><VAR>x</VAR>-<VAR>y</VAR></CODE> 11403<DD>A range of words; <SAMP>`-<VAR>y</VAR>'</SAMP> abbreviates <SAMP>`0-<VAR>y</VAR>'</SAMP>. 11404<P> 11405 11406<DT><CODE>*</CODE> 11407<DD>All of the words, except the <CODE>0</CODE>th. This is a synonym for <SAMP>`1-$'</SAMP>. 11408It is not an error to use <SAMP>`*'</SAMP> if there is just one word in the event; 11409the empty string is returned in that case. 11410<P> 11411 11412<DT><CODE><VAR>x</VAR>*</CODE> 11413<DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP> 11414<P> 11415 11416<DT><CODE><VAR>x</VAR>-</CODE> 11417<DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP> like <SAMP>`<VAR>x</VAR>*'</SAMP>, but omits the last word. 11418<P> 11419 11420</DL> 11421<P> 11422 11423If a word designator is supplied without an event specification, the 11424previous command is used as the event. 11425</P><P> 11426 11427<A NAME="Modifiers"></A> 11428<HR SIZE="6"> 11429<A NAME="SEC121"></A> 11430<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11431<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> < </A>]</TD> 11432<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> > </A>]</TD> 11433<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 11434<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> Up </A>]</TD> 11435<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> >> </A>]</TD> 11436<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11437<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11438<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11439<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11440</TR></TABLE> 11441<H3> 9.3.3 Modifiers </H3> 11442<!--docid::SEC121::--> 11443<P> 11444 11445After the optional word designator, you can add a sequence of one or more 11446of the following modifiers, each preceded by a <SAMP>`:'</SAMP>. 11447</P><P> 11448 11449<DL COMPACT> 11450 11451<DT><CODE>h</CODE> 11452<DD>Remove a trailing pathname component, leaving only the head. 11453<P> 11454 11455<DT><CODE>t</CODE> 11456<DD>Remove all leading pathname components, leaving the tail. 11457<P> 11458 11459<DT><CODE>r</CODE> 11460<DD>Remove a trailing suffix of the form <SAMP>`.<VAR>suffix</VAR>'</SAMP>, leaving 11461the basename. 11462<P> 11463 11464<DT><CODE>e</CODE> 11465<DD>Remove all but the trailing suffix. 11466<P> 11467 11468<DT><CODE>p</CODE> 11469<DD>Print the new command but do not execute it. 11470<P> 11471 11472<DT><CODE>q</CODE> 11473<DD>Quote the substituted words, escaping further substitutions. 11474<P> 11475 11476<DT><CODE>x</CODE> 11477<DD>Quote the substituted words as with <SAMP>`q'</SAMP>, 11478but break into words at spaces, tabs, and newlines. 11479<P> 11480 11481<DT><CODE>s/<VAR>old</VAR>/<VAR>new</VAR>/</CODE> 11482<DD>Substitute <VAR>new</VAR> for the first occurrence of <VAR>old</VAR> in the 11483event line. Any delimiter may be used in place of <SAMP>`/'</SAMP>. 11484The delimiter may be quoted in <VAR>old</VAR> and <VAR>new</VAR> 11485with a single backslash. If <SAMP>`&'</SAMP> appears in <VAR>new</VAR>, 11486it is replaced by <VAR>old</VAR>. A single backslash will quote 11487the <SAMP>`&'</SAMP>. The final delimiter is optional if it is the last 11488character on the input line. 11489<P> 11490 11491<DT><CODE>&</CODE> 11492<DD>Repeat the previous substitution. 11493<P> 11494 11495<DT><CODE>g</CODE> 11496<DD><DT><CODE>a</CODE> 11497<DD>Cause changes to be applied over the entire event line. Used in 11498conjunction with <SAMP>`s'</SAMP>, as in <CODE>gs/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>, 11499or with <SAMP>`&'</SAMP>. 11500<P> 11501 11502<DT><CODE>G</CODE> 11503<DD>Apply the following <SAMP>`s'</SAMP> modifier once to each word in the event. 11504<P> 11505 11506</DL> 11507<P> 11508 11509<A NAME="Installing Bash"></A> 11510<HR SIZE="6"> 11511<A NAME="SEC122"></A> 11512<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11513<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> < </A>]</TD> 11514<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> > </A>]</TD> 11515<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> << </A>]</TD> 11516<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 11517<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> >> </A>]</TD> 11518<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11519<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11520<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11521<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11522</TR></TABLE> 11523<H1> 10. Installing Bash </H1> 11524<!--docid::SEC122::--> 11525<P> 11526 11527This chapter provides basic instructions for installing Bash on 11528the various supported platforms. The distribution supports the 11529GNU operating systems, nearly every version of Unix, and several 11530non-Unix systems such as BeOS and Interix. 11531Other independent ports exist for 11532MS-DOS, OS/2, and Windows platforms. 11533</P><P> 11534 11535<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 11536<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC123">10.1 Basic Installation</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Installation instructions.</TD></TR> 11537<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC124">10.2 Compilers and Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to set special options for various 11538 systems.</TD></TR> 11539<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC125">10.3 Compiling For Multiple Architectures</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to compile Bash for more 11540 than one kind of system from 11541 the same source tree.</TD></TR> 11542<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC126">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> 11543<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC127">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> 11544<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC128">10.6 Sharing Defaults</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to share default configuration values among GNU 11545 programs.</TD></TR> 11546<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC129">10.7 Operation Controls</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Options recognized by the configuration program.</TD></TR> 11547<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC130">10.8 Optional Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to enable and disable optional features when 11548 building Bash.</TD></TR> 11549</TABLE></BLOCKQUOTE> 11550<P> 11551 11552<A NAME="Basic Installation"></A> 11553<HR SIZE="6"> 11554<A NAME="SEC123"></A> 11555<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11556<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> < </A>]</TD> 11557<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> > </A>]</TD> 11558<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> << </A>]</TD> 11559<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> 11560<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> >> </A>]</TD> 11561<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11562<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11563<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11564<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11565</TR></TABLE> 11566<H2> 10.1 Basic Installation </H2> 11567<!--docid::SEC123::--> 11568<P> 11569 11570These are installation instructions for Bash. 11571</P><P> 11572 11573The simplest way to compile Bash is: 11574</P><P> 11575 11576<OL> 11577<LI> 11578<CODE>cd</CODE> to the directory containing the source code and type 11579<SAMP>`/configure'</SAMP> to configure Bash for your system. If you're 11580using <CODE>csh</CODE> on an old version of System V, you might need to 11581type <SAMP>`sh /configure'</SAMP> instead to prevent <CODE>csh</CODE> from trying 11582to execute <CODE>configure</CODE> itself. 11583<P> 11584 11585Running <CODE>configure</CODE> takes some time. 11586While running, it prints messages telling which features it is 11587checking for. 11588</P><P> 11589 11590<LI> 11591Type <SAMP>`make'</SAMP> to compile Bash and build the <CODE>bashbug</CODE> bug 11592reporting script. 11593<P> 11594 11595<LI> 11596Optionally, type <SAMP>`make tests'</SAMP> to run the Bash test suite. 11597<P> 11598 11599<LI> 11600Type <SAMP>`make install'</SAMP> to install <CODE>bash</CODE> and <CODE>bashbug</CODE>. 11601This will also install the manual pages and Info file. 11602<P> 11603 11604</OL> 11605<P> 11606 11607The <CODE>configure</CODE> shell script attempts to guess correct 11608values for various system-dependent variables used during 11609compilation. It uses those values to create a <TT>`Makefile'</TT> in 11610each directory of the package (the top directory, the 11611<TT>`builtins'</TT>, <TT>`doc'</TT>, and <TT>`support'</TT> directories, 11612each directory under <TT>`lib'</TT>, and several others). It also creates a 11613<TT>`config.h'</TT> file containing system-dependent definitions. 11614Finally, it creates a shell script named <CODE>config.status</CODE> that you 11615can run in the future to recreate the current configuration, a 11616file <TT>`config.cache'</TT> that saves the results of its tests to 11617speed up reconfiguring, and a file <TT>`config.log'</TT> containing 11618compiler output (useful mainly for debugging <CODE>configure</CODE>). 11619If at some point 11620<TT>`config.cache'</TT> contains results you don't want to keep, you 11621may remove or edit it. 11622</P><P> 11623 11624To find out more about the options and arguments that the 11625<CODE>configure</CODE> script understands, type 11626</P><P> 11627 11628<TABLE><tr><td> </td><td class=example><pre>bash-2.04$ /configure --help 11629</pre></td></tr></table></P><P> 11630 11631at the Bash prompt in your Bash source directory. 11632</P><P> 11633 11634If you need to do unusual things to compile Bash, please 11635try to figure out how <CODE>configure</CODE> could check whether or not 11636to do them, and mail diffs or instructions to 11637<A HREF="mailto:bash-maintainers@gnu.org">bash-maintainers@gnu.org</A> so they can be 11638considered for the next release. 11639</P><P> 11640 11641The file <TT>`configure.in'</TT> is used to create <CODE>configure</CODE> 11642by a program called Autoconf. You only need 11643<TT>`configure.in'</TT> if you want to change it or regenerate 11644<CODE>configure</CODE> using a newer version of Autoconf. If 11645you do this, make sure you are using Autoconf version 2.50 or 11646newer. 11647</P><P> 11648 11649You can remove the program binaries and object files from the 11650source code directory by typing <SAMP>`make clean'</SAMP>. To also remove the 11651files that <CODE>configure</CODE> created (so you can compile Bash for 11652a different kind of computer), type <SAMP>`make distclean'</SAMP>. 11653</P><P> 11654 11655<A NAME="Compilers and Options"></A> 11656<HR SIZE="6"> 11657<A NAME="SEC124"></A> 11658<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11659<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> < </A>]</TD> 11660<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> > </A>]</TD> 11661<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> << </A>]</TD> 11662<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> 11663<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> >> </A>]</TD> 11664<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11665<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11666<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11667<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11668</TR></TABLE> 11669<H2> 10.2 Compilers and Options </H2> 11670<!--docid::SEC124::--> 11671<P> 11672 11673Some systems require unusual options for compilation or linking 11674that the <CODE>configure</CODE> script does not know about. You can 11675give <CODE>configure</CODE> initial values for variables by setting 11676them in the environment. Using a Bourne-compatible shell, you 11677can do that on the command line like this: 11678</P><P> 11679 11680<TABLE><tr><td> </td><td class=example><pre>CC=c89 CFLAGS=-O2 LIBS=-lposix /configure 11681</pre></td></tr></table></P><P> 11682 11683On systems that have the <CODE>env</CODE> program, you can do it like this: 11684</P><P> 11685 11686<TABLE><tr><td> </td><td class=example><pre>env CPPFLAGS=-I/usr/local/include LDFLAGS=-s /configure 11687</pre></td></tr></table></P><P> 11688 11689The configuration process uses GCC to build Bash if it 11690is available. 11691</P><P> 11692 11693<A NAME="Compiling For Multiple Architectures"></A> 11694<HR SIZE="6"> 11695<A NAME="SEC125"></A> 11696<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11697<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> < </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">[<A HREF="bashref.html#SEC126"> << </A>]</TD> 11700<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> 11701<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> >> </A>]</TD> 11702<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11703<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11704<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11705<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11706</TR></TABLE> 11707<H2> 10.3 Compiling For Multiple Architectures </H2> 11708<!--docid::SEC125::--> 11709<P> 11710 11711You can compile Bash for more than one kind of computer at the 11712same time, by placing the object files for each architecture in their 11713own directory. To do this, you must use a version of <CODE>make</CODE> that 11714supports the <CODE>VPATH</CODE> variable, such as GNU <CODE>make</CODE>. 11715<CODE>cd</CODE> to the 11716directory where you want the object files and executables to go and run 11717the <CODE>configure</CODE> script from the source directory. You may need to 11718supply the <SAMP>`--srcdir=PATH'</SAMP> argument to tell <CODE>configure</CODE> where the 11719source files are. <CODE>configure</CODE> automatically checks for the 11720source code in the directory that <CODE>configure</CODE> is in and in `..'. 11721</P><P> 11722 11723If you have to use a <CODE>make</CODE> that does not supports the <CODE>VPATH</CODE> 11724variable, you can compile Bash for one architecture at a 11725time in the source code directory. After you have installed 11726Bash for one architecture, use <SAMP>`make distclean'</SAMP> before 11727reconfiguring for another architecture. 11728</P><P> 11729 11730Alternatively, if your system supports symbolic links, you can use the 11731<TT>`support/mkclone'</TT> script to create a build tree which has 11732symbolic links back to each file in the source directory. Here's an 11733example that creates a build directory in the current directory from a 11734source directory <TT>`/usr/gnu/src/bash-2.0'</TT>: 11735</P><P> 11736 11737<TABLE><tr><td> </td><td class=example><pre>bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . 11738</pre></td></tr></table></P><P> 11739 11740The <CODE>mkclone</CODE> script requires Bash, so you must have already built 11741Bash for at least one architecture before you can create build 11742directories for other architectures. 11743</P><P> 11744 11745<A NAME="Installation Names"></A> 11746<HR SIZE="6"> 11747<A NAME="SEC126"></A> 11748<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11749<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> < </A>]</TD> 11750<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> > </A>]</TD> 11751<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> << </A>]</TD> 11752<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> 11753<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> >> </A>]</TD> 11754<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11755<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11756<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11757<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11758</TR></TABLE> 11759<H2> 10.4 Installation Names </H2> 11760<!--docid::SEC126::--> 11761<P> 11762 11763By default, <SAMP>`make install'</SAMP> will install into 11764<TT>`/usr/local/bin'</TT>, <TT>`/usr/local/man'</TT>, etc. You can 11765specify an installation prefix other than <TT>`/usr/local'</TT> by 11766giving <CODE>configure</CODE> the option <SAMP>`--prefix=<VAR>PATH</VAR>'</SAMP>, 11767or by specifying a value for the <CODE>DESTDIR</CODE> <SAMP>`make'</SAMP> 11768variable when running <SAMP>`make install'</SAMP>. 11769</P><P> 11770 11771You can specify separate installation prefixes for 11772architecture-specific files and architecture-independent files. 11773If you give <CODE>configure</CODE> the option 11774<SAMP>`--exec-prefix=<VAR>PATH</VAR>'</SAMP>, <SAMP>`make install'</SAMP> will use 11775<VAR>PATH</VAR> as the prefix for installing programs and libraries. 11776Documentation and other data files will still use the regular prefix. 11777</P><P> 11778 11779<A NAME="Specifying the System Type"></A> 11780<HR SIZE="6"> 11781<A NAME="SEC127"></A> 11782<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11783<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> < </A>]</TD> 11784<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> > </A>]</TD> 11785<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> << </A>]</TD> 11786<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> 11787<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> >> </A>]</TD> 11788<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11789<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11790<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11791<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11792</TR></TABLE> 11793<H2> 10.5 Specifying the System Type </H2> 11794<!--docid::SEC127::--> 11795<P> 11796 11797There may be some features <CODE>configure</CODE> can not figure out 11798automatically, but need to determine by the type of host Bash 11799will run on. Usually <CODE>configure</CODE> can figure that 11800out, but if it prints a message saying it can not guess the host 11801type, give it the <SAMP>`--host=TYPE'</SAMP> option. <SAMP>`TYPE'</SAMP> can 11802either be a short name for the system type, such as <SAMP>`sun4'</SAMP>, 11803or a canonical name with three fields: <SAMP>`CPU-COMPANY-SYSTEM'</SAMP> 11804(e.g., <SAMP>`i386-unknown-freebsd4.2'</SAMP>). 11805</P><P> 11806 11807See the file <TT>`support/config.sub'</TT> for the possible 11808values of each field. 11809</P><P> 11810 11811<A NAME="Sharing Defaults"></A> 11812<HR SIZE="6"> 11813<A NAME="SEC128"></A> 11814<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11815<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> < </A>]</TD> 11816<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> > </A>]</TD> 11817<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> << </A>]</TD> 11818<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> 11819<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> >> </A>]</TD> 11820<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11821<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11822<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11823<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11824</TR></TABLE> 11825<H2> 10.6 Sharing Defaults </H2> 11826<!--docid::SEC128::--> 11827<P> 11828 11829If you want to set default values for <CODE>configure</CODE> scripts to 11830share, you can create a site shell script called 11831<CODE>config.site</CODE> that gives default values for variables like 11832<CODE>CC</CODE>, <CODE>cache_file</CODE>, and <CODE>prefix</CODE>. <CODE>configure</CODE> 11833looks for <TT>`PREFIX/share/config.site'</TT> if it exists, then 11834<TT>`PREFIX/etc/config.site'</TT> if it exists. Or, you can set the 11835<CODE>CONFIG_SITE</CODE> environment variable to the location of the site 11836script. A warning: the Bash <CODE>configure</CODE> looks for a site script, 11837but not all <CODE>configure</CODE> scripts do. 11838</P><P> 11839 11840<A NAME="Operation Controls"></A> 11841<HR SIZE="6"> 11842<A NAME="SEC129"></A> 11843<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11844<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> < </A>]</TD> 11845<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> > </A>]</TD> 11846<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> << </A>]</TD> 11847<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> 11848<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> >> </A>]</TD> 11849<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11850<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11851<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11852<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11853</TR></TABLE> 11854<H2> 10.7 Operation Controls </H2> 11855<!--docid::SEC129::--> 11856<P> 11857 11858<CODE>configure</CODE> recognizes the following options to control how it 11859operates. 11860</P><P> 11861 11862<DL COMPACT> 11863 11864<DT><CODE>--cache-file=<VAR>file</VAR></CODE> 11865<DD>Use and save the results of the tests in 11866<VAR>file</VAR> instead of <TT>`/config.cache'</TT>. Set <VAR>file</VAR> to 11867<TT>`/dev/null'</TT> to disable caching, for debugging 11868<CODE>configure</CODE>. 11869<P> 11870 11871<DT><CODE>--help</CODE> 11872<DD>Print a summary of the options to <CODE>configure</CODE>, and exit. 11873<P> 11874 11875<DT><CODE>--quiet</CODE> 11876<DD><DT><CODE>--silent</CODE> 11877<DD><DT><CODE>-q</CODE> 11878<DD>Do not print messages saying which checks are being made. 11879<P> 11880 11881<DT><CODE>--srcdir=<VAR>dir</VAR></CODE> 11882<DD>Look for the Bash source code in directory <VAR>dir</VAR>. Usually 11883<CODE>configure</CODE> can determine that directory automatically. 11884<P> 11885 11886<DT><CODE>--version</CODE> 11887<DD>Print the version of Autoconf used to generate the <CODE>configure</CODE> 11888script, and exit. 11889</DL> 11890<P> 11891 11892<CODE>configure</CODE> also accepts some other, not widely used, boilerplate 11893options. <SAMP>`configure --help'</SAMP> prints the complete list. 11894</P><P> 11895 11896<A NAME="Optional Features"></A> 11897<HR SIZE="6"> 11898<A NAME="SEC130"></A> 11899<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 11900<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> < </A>]</TD> 11901<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> > </A>]</TD> 11902<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> << </A>]</TD> 11903<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD> 11904<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> >> </A>]</TD> 11905<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 11906<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 11907<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 11908<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 11909</TR></TABLE> 11910<H2> 10.8 Optional Features </H2> 11911<!--docid::SEC130::--> 11912<P> 11913 11914The Bash <CODE>configure</CODE> has a number of <SAMP>`--enable-<VAR>feature</VAR>'</SAMP> 11915options, where <VAR>feature</VAR> indicates an optional part of Bash. 11916There are also several <SAMP>`--with-<VAR>package</VAR>'</SAMP> options, 11917where <VAR>package</VAR> is something like <SAMP>`bash-malloc'</SAMP> or <SAMP>`purify'</SAMP>. 11918To turn off the default use of a package, use 11919<SAMP>`--without-<VAR>package</VAR>'</SAMP>. To configure Bash without a feature 11920that is enabled by default, use <SAMP>`--disable-<VAR>feature</VAR>'</SAMP>. 11921</P><P> 11922 11923Here is a complete list of the <SAMP>`--enable-'</SAMP> and 11924<SAMP>`--with-'</SAMP> options that the Bash <CODE>configure</CODE> recognizes. 11925</P><P> 11926 11927<DL COMPACT> 11928<DT><CODE>--with-afs</CODE> 11929<DD>Define if you are using the Andrew File System from Transarc. 11930<P> 11931 11932<DT><CODE>--with-bash-malloc</CODE> 11933<DD>Use the Bash version of 11934<CODE>malloc</CODE> in the directory <TT>`lib/malloc'</TT>. This is not the same 11935<CODE>malloc</CODE> that appears in GNU libc, but an older version 11936originally derived from the 4.2 BSD <CODE>malloc</CODE>. This <CODE>malloc</CODE> 11937is very fast, but wastes some space on each allocation. 11938This option is enabled by default. 11939The <TT>`NOTES'</TT> file contains a list of systems for 11940which this should be turned off, and <CODE>configure</CODE> disables this 11941option automatically for a number of systems. 11942<P> 11943 11944<DT><CODE>--with-curses</CODE> 11945<DD>Use the curses library instead of the termcap library. This should 11946be supplied if your system has an inadequate or incomplete termcap 11947database. 11948<P> 11949 11950<DT><CODE>--with-gnu-malloc</CODE> 11951<DD>A synonym for <CODE>--with-bash-malloc</CODE>. 11952<P> 11953 11954<DT><CODE>--with-installed-readline[=<VAR>PREFIX</VAR>]</CODE> 11955<DD>Define this to make Bash link with a locally-installed version of Readline 11956rather than the version in <TT>`lib/readline'</TT>. This works only with 11957Readline 5.0 and later versions. If <VAR>PREFIX</VAR> is <CODE>yes</CODE> or not 11958supplied, <CODE>configure</CODE> uses the values of the make variables 11959<CODE>includedir</CODE> and <CODE>libdir</CODE>, which are subdirectories of <CODE>prefix</CODE> 11960by default, to find the installed version of Readline if it is not in 11961the standard system include and library directories. 11962If <VAR>PREFIX</VAR> is <CODE>no</CODE>, Bash links with the version in 11963<TT>`lib/readline'</TT>. 11964If <VAR>PREFIX</VAR> is set to any other value, <CODE>configure</CODE> treats it as 11965a directory pathname and looks for 11966the installed version of Readline in subdirectories of that directory 11967(include files in <VAR>PREFIX</VAR>/<CODE>include</CODE> and the library in 11968<VAR>PREFIX</VAR>/<CODE>lib</CODE>). 11969<P> 11970 11971<DT><CODE>--with-purify</CODE> 11972<DD>Define this to use the Purify memory allocation checker from Rational 11973Software. 11974<P> 11975 11976<DT><CODE>--enable-minimal-config</CODE> 11977<DD>This produces a shell with minimal features, close to the historical 11978Bourne shell. 11979</DL> 11980<P> 11981 11982There are several <SAMP>`--enable-'</SAMP> options that alter how Bash is 11983compiled and linked, rather than changing run-time features. 11984</P><P> 11985 11986<DL COMPACT> 11987<DT><CODE>--enable-largefile</CODE> 11988<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 11989to build programs which can access large files. This is enabled by 11990default, if the operating system provides large file support. 11991<P> 11992 11993<DT><CODE>--enable-profiling</CODE> 11994<DD>This builds a Bash binary that produces profiling information to be 11995processed by <CODE>gprof</CODE> each time it is executed. 11996<P> 11997 11998<DT><CODE>--enable-static-link</CODE> 11999<DD>This causes Bash to be linked statically, if <CODE>gcc</CODE> is being used. 12000This could be used to build a version to use as root's shell. 12001</DL> 12002<P> 12003 12004The <SAMP>`minimal-config'</SAMP> option can be used to disable all of 12005the following options, but it is processed first, so individual 12006options may be enabled using <SAMP>`enable-<VAR>feature</VAR>'</SAMP>. 12007</P><P> 12008 12009All of the following options except for <SAMP>`disabled-builtins'</SAMP> and 12010<SAMP>`xpg-echo-default'</SAMP> are 12011enabled by default, unless the operating system does not provide the 12012necessary support. 12013</P><P> 12014 12015<DL COMPACT> 12016<DT><CODE>--enable-alias</CODE> 12017<DD>Allow alias expansion and include the <CODE>alias</CODE> and <CODE>unalias</CODE> 12018builtins (see section <A HREF="bashref.html#SEC80">6.6 Aliases</A>). 12019<P> 12020 12021<DT><CODE>--enable-arith-for-command</CODE> 12022<DD>Include support for the alternate form of the <CODE>for</CODE> command 12023that behaves like the C language <CODE>for</CODE> statement 12024(see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>). 12025<P> 12026 12027<DT><CODE>--enable-array-variables</CODE> 12028<DD>Include support for one-dimensional array shell variables 12029(see section <A HREF="bashref.html#SEC81">6.7 Arrays</A>). 12030<P> 12031 12032<DT><CODE>--enable-bang-history</CODE> 12033<DD>Include support for <CODE>csh</CODE>-like history substitution 12034(see section <A HREF="bashref.html#SEC118">9.3 History Expansion</A>). 12035<P> 12036 12037<DT><CODE>--enable-brace-expansion</CODE> 12038<DD>Include <CODE>csh</CODE>-like brace expansion 12039( <CODE>b{a,b}c</CODE> ==> <CODE>bac bbc</CODE> ). 12040See <A HREF="bashref.html#SEC28">3.5.1 Brace Expansion</A>, for a complete description. 12041<P> 12042 12043<DT><CODE>--enable-command-timing</CODE> 12044<DD>Include support for recognizing <CODE>time</CODE> as a reserved word and for 12045displaying timing statistics for the pipeline following <CODE>time</CODE> 12046(see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). 12047This allows pipelines as well as shell builtins and functions to be timed. 12048<P> 12049 12050<DT><CODE>--enable-cond-command</CODE> 12051<DD>Include support for the <CODE>[[</CODE> conditional command. 12052(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). 12053<P> 12054 12055<DT><CODE>--enable-cond-regexp</CODE> 12056<DD>Include support for matching POSIX regular expressions using the 12057<SAMP>`=~'</SAMP> binary operator in the <CODE>[[</CODE> conditional command. 12058(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). 12059<P> 12060 12061<DT><CODE>--enable-debugger</CODE> 12062<DD>Include support for the bash debugger (distributed separately). 12063<P> 12064 12065<DT><CODE>--enable-directory-stack</CODE> 12066<DD>Include support for a <CODE>csh</CODE>-like directory stack and the 12067<CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins 12068(see section <A HREF="bashref.html#SEC82">6.8 The Directory Stack</A>). 12069<P> 12070 12071<DT><CODE>--enable-disabled-builtins</CODE> 12072<DD>Allow builtin commands to be invoked via <SAMP>`builtin xxx'</SAMP> 12073even after <CODE>xxx</CODE> has been disabled using <SAMP>`enable -n xxx'</SAMP>. 12074See <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>, for details of the <CODE>builtin</CODE> and 12075<CODE>enable</CODE> builtin commands. 12076<P> 12077 12078<DT><CODE>--enable-dparen-arithmetic</CODE> 12079<DD>Include support for the <CODE>((<small>...</small>))</CODE> command 12080(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). 12081<P> 12082 12083<DT><CODE>--enable-extended-glob</CODE> 12084<DD>Include support for the extended pattern matching features described 12085above under <A HREF="bashref.html#SEC36">3.5.8.1 Pattern Matching</A>. 12086<P> 12087 12088<DT><CODE>--enable-help-builtin</CODE> 12089<DD>Include the <CODE>help</CODE> builtin, which displays help on shell builtins and 12090variables (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 12091<P> 12092 12093<DT><CODE>--enable-history</CODE> 12094<DD>Include command history and the <CODE>fc</CODE> and <CODE>history</CODE> 12095builtin commands (see section <A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A>). 12096<P> 12097 12098<DT><CODE>--enable-job-control</CODE> 12099<DD>This enables the job control features (see section <A HREF="bashref.html#SEC87">7. Job Control</A>), 12100if the operating system supports them. 12101<P> 12102 12103<DT><CODE>--enable-multibyte</CODE> 12104<DD>This enables support for multibyte characters if the operating 12105system provides the necessary support. 12106<P> 12107 12108<DT><CODE>--enable-net-redirections</CODE> 12109<DD>This enables the special handling of filenames of the form 12110<CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE> and 12111<CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE> 12112when used in redirections (see section <A HREF="bashref.html#SEC38">3.6 Redirections</A>). 12113<P> 12114 12115<DT><CODE>--enable-process-substitution</CODE> 12116<DD>This enables process substitution (see section <A HREF="bashref.html#SEC33">3.5.6 Process Substitution</A>) if 12117the operating system provides the necessary support. 12118<P> 12119 12120<DT><CODE>--enable-progcomp</CODE> 12121<DD>Enable the programmable completion facilities 12122(see section <A HREF="bashref.html#SEC113">8.6 Programmable Completion</A>). 12123If Readline is not enabled, this option has no effect. 12124<P> 12125 12126<DT><CODE>--enable-prompt-string-decoding</CODE> 12127<DD>Turn on the interpretation of a number of backslash-escaped characters 12128in the <CODE>$PS1</CODE>, <CODE>$PS2</CODE>, <CODE>$PS3</CODE>, and <CODE>$PS4</CODE> prompt 12129strings. See <A HREF="bashref.html#SEC84">6.9 Controlling the Prompt</A>, for a complete list of prompt 12130string escape sequences. 12131<P> 12132 12133<DT><CODE>--enable-readline</CODE> 12134<DD>Include support for command-line editing and history with the Bash 12135version of the Readline library (see section <A HREF="bashref.html#SEC91">8. Command Line Editing</A>). 12136<P> 12137 12138<DT><CODE>--enable-restricted</CODE> 12139<DD>Include support for a <EM>restricted shell</EM>. If this is enabled, Bash, 12140when called as <CODE>rbash</CODE>, enters a restricted mode. See 12141<A HREF="bashref.html#SEC85">6.10 The Restricted Shell</A>, for a description of restricted mode. 12142<P> 12143 12144<DT><CODE>--enable-select</CODE> 12145<DD>Include the <CODE>select</CODE> builtin, which allows the generation of simple 12146menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). 12147<P> 12148 12149<DT><CODE>--enable-separate-helpfiles</CODE> 12150<DD>Use external files for the documentation displayed by the <CODE>help</CODE> builtin 12151instead of storing the text internally. 12152<P> 12153 12154<DT><CODE>--enable-single-help-strings</CODE> 12155<DD>Store the text displayed by the <CODE>help</CODE> builtin as a single string for 12156each help topic. This aids in translating the text to different languages. 12157You may need to disable this if your compiler cannot handle very long string 12158literals. 12159<P> 12160 12161<DT><CODE>--enable-strict-posix-default</CODE> 12162<DD>Make Bash POSIX-conformant by default (see section <A HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A>). 12163<P> 12164 12165<DT><CODE>--enable-usg-echo-default</CODE> 12166<DD>A synonym for <CODE>--enable-xpg-echo-default</CODE>. 12167<P> 12168 12169<DT><CODE>--enable-xpg-echo-default</CODE> 12170<DD>Make the <CODE>echo</CODE> builtin expand backslash-escaped characters by default, 12171without requiring the <SAMP>`-e'</SAMP> option. 12172This sets the default value of the <CODE>xpg_echo</CODE> shell option to <CODE>on</CODE>, 12173which makes the Bash <CODE>echo</CODE> behave more like the version specified in 12174the Single Unix Specification, version 3. 12175See section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>, for a description of the escape sequences that 12176<CODE>echo</CODE> recognizes. 12177<P> 12178 12179</DL> 12180<P> 12181 12182The file <TT>`config-top.h'</TT> contains C Preprocessor 12183<SAMP>`#define'</SAMP> statements for options which are not settable from 12184<CODE>configure</CODE>. 12185Some of these are not meant to be changed; beware of the consequences if 12186you do. 12187Read the comments associated with each definition for more 12188information about its effect. 12189</P><P> 12190 12191<A NAME="Reporting Bugs"></A> 12192<HR SIZE="6"> 12193<A NAME="SEC131"></A> 12194<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 12195<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> < </A>]</TD> 12196<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> > </A>]</TD> 12197<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> << </A>]</TD> 12198<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 12199<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> >> </A>]</TD> 12200<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 12201<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 12202<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 12203<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 12204</TR></TABLE> 12205<H1> A. Reporting Bugs </H1> 12206<!--docid::SEC131::--> 12207<P> 12208 12209Please report all bugs you find in Bash. 12210But first, you should 12211make sure that it really is a bug, and that it appears in the latest 12212version of Bash. 12213The latest version of Bash is always available for FTP from 12214<A HREF="ftp://ftp.gnu.org/pub/bash/">ftp://ftp.gnu.org/pub/bash/</A>. 12215</P><P> 12216 12217Once you have determined that a bug actually exists, use the 12218<CODE>bashbug</CODE> command to submit a bug report. 12219If you have a fix, you are encouraged to mail that as well! 12220Suggestions and `philosophical' bug reports may be mailed 12221to <A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A> or posted to the Usenet 12222newsgroup <CODE>gnu.bash.bug</CODE>. 12223</P><P> 12224 12225All bug reports should include: 12226<UL> 12227<LI> 12228The version number of Bash. 12229<LI> 12230The hardware and operating system. 12231<LI> 12232The compiler used to compile Bash. 12233<LI> 12234A description of the bug behaviour. 12235<LI> 12236A short script or `recipe' which exercises the bug and may be used 12237to reproduce it. 12238</UL> 12239<P> 12240 12241<CODE>bashbug</CODE> inserts the first three items automatically into 12242the template it provides for filing a bug report. 12243</P><P> 12244 12245Please send all reports concerning this manual to 12246<A HREF="mailto:chet@po.CWRU.Edu">chet@po.CWRU.Edu</A>. 12247</P><P> 12248 12249<A NAME="Major Differences From The Bourne Shell"></A> 12250<HR SIZE="6"> 12251<A NAME="SEC132"></A> 12252<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 12253<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> < </A>]</TD> 12254<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> > </A>]</TD> 12255<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> << </A>]</TD> 12256<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 12257<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> >> </A>]</TD> 12258<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 12259<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 12260<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 12261<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 12262</TR></TABLE> 12263<H1> B. Major Differences From The Bourne Shell </H1> 12264<!--docid::SEC132::--> 12265<P> 12266 12267Bash implements essentially the same grammar, parameter and 12268variable expansion, redirection, and quoting as the Bourne Shell. 12269Bash uses the POSIX 1003.2 standard as the specification of 12270how these features are to be implemented. There are some 12271differences between the traditional Bourne shell and Bash; this 12272section quickly details the differences of significance. A 12273number of these differences are explained in greater depth in 12274previous sections. 12275This section uses the version of <CODE>sh</CODE> included in SVR4.2 (the 12276last version of the historical Bourne shell) as the baseline reference. 12277</P><P> 12278 12279<UL> 12280 12281<LI> 12282Bash is POSIX-conformant, even where the POSIX specification 12283differs from traditional <CODE>sh</CODE> behavior (see section <A HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A>). 12284<P> 12285 12286<LI> 12287Bash has multi-character invocation options (see section <A HREF="bashref.html#SEC65">6.1 Invoking Bash</A>). 12288<P> 12289 12290<LI> 12291Bash has command-line editing (see section <A HREF="bashref.html#SEC91">8. Command Line Editing</A>) and 12292the <CODE>bind</CODE> builtin. 12293<P> 12294 12295<LI> 12296Bash provides a programmable word completion mechanism 12297(see section <A HREF="bashref.html#SEC113">8.6 Programmable Completion</A>), and two builtin commands, 12298<CODE>complete</CODE> and <CODE>compgen</CODE>, to manipulate it. 12299<P> 12300 12301<LI> 12302Bash has command history (see section <A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A>) and the 12303<CODE>history</CODE> and <CODE>fc</CODE> builtins to manipulate it. 12304The Bash history list maintains timestamp information and uses the 12305value of the <CODE>HISTTIMEFORMAT</CODE> variable to display it. 12306<P> 12307 12308<LI> 12309Bash implements <CODE>csh</CODE>-like history expansion 12310(see section <A HREF="bashref.html#SEC118">9.3 History Expansion</A>). 12311<P> 12312 12313<LI> 12314Bash has one-dimensional array variables (see section <A HREF="bashref.html#SEC81">6.7 Arrays</A>), and the 12315appropriate variable expansions and assignment syntax to use them. 12316Several of the Bash builtins take options to act on arrays. 12317Bash provides a number of built-in array variables. 12318<P> 12319 12320<LI> 12321The <CODE>$'<small>...</small>'</CODE> quoting syntax, which expands ANSI-C 12322backslash-escaped characters in the text between the single quotes, 12323is supported (see section <A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>). 12324<P> 12325 12326<LI> 12327Bash supports the <CODE>$"<small>...</small>"</CODE> quoting syntax to do 12328locale-specific translation of the characters between the double 12329quotes. The <SAMP>`-D'</SAMP>, <SAMP>`--dump-strings'</SAMP>, and <SAMP>`--dump-po-strings'</SAMP> 12330invocation options list the translatable strings found in a script 12331(see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>). 12332<P> 12333 12334<LI> 12335Bash implements the <CODE>!</CODE> keyword to negate the return value of 12336a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). 12337Very useful when an <CODE>if</CODE> statement needs to act only if a test fails. 12338The Bash <SAMP>`-o pipefail'</SAMP> option to <CODE>set</CODE> will cause a pipeline to 12339return a failure status if any command fails. 12340<P> 12341 12342<LI> 12343Bash has the <CODE>time</CODE> reserved word and command timing (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>). 12344The display of the timing statistics may be controlled with the 12345<CODE>TIMEFORMAT</CODE> variable. 12346<P> 12347 12348<LI> 12349Bash implements the <CODE>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> ))</CODE> 12350arithmetic for command, similar to the C language (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>). 12351<P> 12352 12353<LI> 12354Bash includes the <CODE>select</CODE> compound command, which allows the 12355generation of simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>). 12356<P> 12357 12358<LI> 12359Bash includes the <CODE>[[</CODE> compound command, which makes conditional 12360testing part of the shell grammar (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), including 12361optional regular expression matching. 12362<P> 12363 12364<LI> 12365Bash provides optional case-insensitive matching for the <CODE>case</CODE> and 12366<CODE>[[</CODE> constructs. 12367<P> 12368 12369<LI> 12370Bash includes brace expansion (see section <A HREF="bashref.html#SEC28">3.5.1 Brace Expansion</A>) and tilde 12371expansion (see section <A HREF="bashref.html#SEC29">3.5.2 Tilde Expansion</A>). 12372<P> 12373 12374<LI> 12375Bash implements command aliases and the <CODE>alias</CODE> and <CODE>unalias</CODE> 12376builtins (see section <A HREF="bashref.html#SEC80">6.6 Aliases</A>). 12377<P> 12378 12379<LI> 12380Bash provides shell arithmetic, the <CODE>((</CODE> compound command 12381(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), 12382and arithmetic expansion (see section <A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A>). 12383<P> 12384 12385<LI> 12386Variables present in the shell's initial environment are automatically 12387exported to child processes. The Bourne shell does not normally do 12388this unless the variables are explicitly marked using the <CODE>export</CODE> 12389command. 12390<P> 12391 12392<LI> 12393Bash supports the <SAMP>`+='</SAMP> assignment operator, which appends to the value 12394of the variable named on the left hand side. 12395<P> 12396 12397<LI> 12398Bash includes the POSIX pattern removal <SAMP>`%'</SAMP>, <SAMP>`#'</SAMP>, <SAMP>`%%'</SAMP> 12399and <SAMP>`##'</SAMP> expansions to remove leading or trailing substrings from 12400variable values (see section <A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A>). 12401<P> 12402 12403<LI> 12404The expansion <CODE>${#xx}</CODE>, which returns the length of <CODE>${xx}</CODE>, 12405is supported (see section <A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A>). 12406<P> 12407 12408<LI> 12409The expansion <CODE>${var:</CODE><VAR>offset</VAR><CODE>[:</CODE><VAR>length</VAR><CODE>]}</CODE>, 12410which expands to the substring of <CODE>var</CODE>'s value of length 12411<VAR>length</VAR>, beginning at <VAR>offset</VAR>, is present 12412(see section <A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A>). 12413<P> 12414 12415<LI> 12416The expansion 12417<CODE>${var/[/]</CODE><VAR>pattern</VAR><CODE>[/</CODE><VAR>replacement</VAR><CODE>]}</CODE>, 12418which matches <VAR>pattern</VAR> and replaces it with <VAR>replacement</VAR> in 12419the value of <CODE>var</CODE>, is available (see section <A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A>). 12420<P> 12421 12422<LI> 12423The expansion <CODE>${!<VAR>prefix}*</VAR></CODE> expansion, which expands to 12424the names of all shell variables whose names begin with <VAR>prefix</VAR>, 12425is available (see section <A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A>). 12426<P> 12427 12428<LI> 12429Bash has <VAR>indirect</VAR> variable expansion using <CODE>${!word}</CODE> 12430(see section <A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A>). 12431<P> 12432 12433<LI> 12434Bash can expand positional parameters beyond <CODE>$9</CODE> using 12435<CODE>${<VAR>num</VAR>}</CODE>. 12436<P> 12437 12438<LI> 12439The POSIX <CODE>$()</CODE> form of command substitution 12440is implemented (see section <A HREF="bashref.html#SEC31">3.5.4 Command Substitution</A>), 12441and preferred to the Bourne shell's <CODE>"</CODE> (which 12442is also implemented for backwards compatibility). 12443<P> 12444 12445<LI> 12446Bash has process substitution (see section <A HREF="bashref.html#SEC33">3.5.6 Process Substitution</A>). 12447<P> 12448 12449<LI> 12450Bash automatically assigns variables that provide information about the 12451current user (<CODE>UID</CODE>, <CODE>EUID</CODE>, and <CODE>GROUPS</CODE>), the current host 12452(<CODE>HOSTTYPE</CODE>, <CODE>OSTYPE</CODE>, <CODE>MACHTYPE</CODE>, and <CODE>HOSTNAME</CODE>), 12453and the instance of Bash that is running (<CODE>BASH</CODE>, 12454<CODE>BASH_VERSION</CODE>, and <CODE>BASH_VERSINFO</CODE>). See section <A HREF="bashref.html#SEC63">5.2 Bash Variables</A>, 12455for details. 12456<P> 12457 12458<LI> 12459The <CODE>IFS</CODE> variable is used to split only the results of expansion, 12460not all words (see section <A HREF="bashref.html#SEC34">3.5.7 Word Splitting</A>). 12461This closes a longstanding shell security hole. 12462<P> 12463 12464<LI> 12465Bash implements the full set of POSIX 1003.2 filename expansion operators, 12466including <VAR>character classes</VAR>, <VAR>equivalence classes</VAR>, and 12467<VAR>collating symbols</VAR> (see section <A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A>). 12468<P> 12469 12470<LI> 12471Bash implements extended pattern matching features when the <CODE>extglob</CODE> 12472shell option is enabled (see section <A HREF="bashref.html#SEC36">3.5.8.1 Pattern Matching</A>). 12473<P> 12474 12475<LI> 12476It is possible to have a variable and a function with the same name; 12477<CODE>sh</CODE> does not separate the two name spaces. 12478<P> 12479 12480<LI> 12481Bash functions are permitted to have local variables using the 12482<CODE>local</CODE> builtin, and thus useful recursive functions may be written 12483(see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 12484<P> 12485 12486<LI> 12487Variable assignments preceding commands affect only that command, even 12488builtins and functions (see section <A HREF="bashref.html#SEC52">3.7.4 Environment</A>). 12489In <CODE>sh</CODE>, all variable assignments 12490preceding commands are global unless the command is executed from the 12491file system. 12492<P> 12493 12494<LI> 12495Bash performs filename expansion on filenames specified as operands 12496to input and output redirection operators (see section <A HREF="bashref.html#SEC38">3.6 Redirections</A>). 12497<P> 12498 12499<LI> 12500Bash contains the <SAMP>`<>'</SAMP> redirection operator, allowing a file to be 12501opened for both reading and writing, and the <SAMP>`&>'</SAMP> redirection 12502operator, for directing standard output and standard error to the same 12503file (see section <A HREF="bashref.html#SEC38">3.6 Redirections</A>). 12504<P> 12505 12506<LI> 12507Bash includes the <SAMP>`<<<'</SAMP> redirection operator, allowing a string to 12508be used as the standard input to a command. 12509<P> 12510 12511<LI> 12512Bash implements the <SAMP>`[n]<&<VAR>word</VAR>'</SAMP> and <SAMP>`[n]>&<VAR>word</VAR>'</SAMP> 12513redirection operators, which move one file descriptor to another. 12514<P> 12515 12516<LI> 12517Bash treats a number of filenames specially when they are 12518used in redirection operators (see section <A HREF="bashref.html#SEC38">3.6 Redirections</A>). 12519<P> 12520 12521<LI> 12522Bash can open network connections to arbitrary machines and services 12523with the redirection operators (see section <A HREF="bashref.html#SEC38">3.6 Redirections</A>). 12524<P> 12525 12526<LI> 12527The <CODE>noclobber</CODE> option is available to avoid overwriting existing 12528files with output redirection (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 12529The <SAMP>`>|'</SAMP> redirection operator may be used to override <CODE>noclobber</CODE>. 12530<P> 12531 12532<LI> 12533The Bash <CODE>cd</CODE> and <CODE>pwd</CODE> builtins (see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>) 12534each take <SAMP>`-L'</SAMP> and <SAMP>`-P'</SAMP> options to switch between logical and 12535physical modes. 12536<P> 12537 12538<LI> 12539Bash allows a function to override a builtin with the same name, and provides 12540access to that builtin's functionality within the function via the 12541<CODE>builtin</CODE> and <CODE>command</CODE> builtins (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 12542<P> 12543 12544<LI> 12545The <CODE>command</CODE> builtin allows selective disabling of functions 12546when command lookup is performed (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 12547<P> 12548 12549<LI> 12550Individual builtins may be enabled or disabled using the <CODE>enable</CODE> 12551builtin (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 12552<P> 12553 12554<LI> 12555The Bash <CODE>exec</CODE> builtin takes additional options that allow users 12556to control the contents of the environment passed to the executed 12557command, and what the zeroth argument to the command is to be 12558(see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>). 12559<P> 12560 12561<LI> 12562Shell functions may be exported to children via the environment 12563using <CODE>export -f</CODE> (see section <A HREF="bashref.html#SEC23">3.3 Shell Functions</A>). 12564<P> 12565 12566<LI> 12567The Bash <CODE>export</CODE>, <CODE>readonly</CODE>, and <CODE>declare</CODE> builtins can 12568take a <SAMP>`-f'</SAMP> option to act on shell functions, a <SAMP>`-p'</SAMP> option to 12569display variables with various attributes set in a format that can be 12570used as shell input, a <SAMP>`-n'</SAMP> option to remove various variable 12571attributes, and <SAMP>`name=value'</SAMP> arguments to set variable attributes 12572and values simultaneously. 12573<P> 12574 12575<LI> 12576The Bash <CODE>hash</CODE> builtin allows a name to be associated with 12577an arbitrary filename, even when that filename cannot be found by 12578searching the <CODE>$PATH</CODE>, using <SAMP>`hash -p'</SAMP> 12579(see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>). 12580<P> 12581 12582<LI> 12583Bash includes a <CODE>help</CODE> builtin for quick reference to shell 12584facilities (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 12585<P> 12586 12587<LI> 12588The <CODE>printf</CODE> builtin is available to display formatted output 12589(see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 12590<P> 12591 12592<LI> 12593The Bash <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>) 12594will read a line ending in <SAMP>`\'</SAMP> with 12595the <SAMP>`-r'</SAMP> option, and will use the <CODE>REPLY</CODE> variable as a 12596default if no non-option arguments are supplied. 12597The Bash <CODE>read</CODE> builtin 12598also accepts a prompt string with the <SAMP>`-p'</SAMP> option and will use 12599Readline to obtain the line when given the <SAMP>`-e'</SAMP> option. 12600The <CODE>read</CODE> builtin also has additional options to control input: 12601the <SAMP>`-s'</SAMP> option will turn off echoing of input characters as 12602they are read, the <SAMP>`-t'</SAMP> option will allow <CODE>read</CODE> to time out 12603if input does not arrive within a specified number of seconds, the 12604<SAMP>`-n'</SAMP> option will allow reading only a specified number of 12605characters rather than a full line, and the <SAMP>`-d'</SAMP> option will read 12606until a particular character rather than newline. 12607<P> 12608 12609<LI> 12610The <CODE>return</CODE> builtin may be used to abort execution of scripts 12611executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins 12612(see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>). 12613<P> 12614 12615<LI> 12616Bash includes the <CODE>shopt</CODE> builtin, for finer control of shell 12617optional capabilities (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>), and allows these options 12618to be set and unset at shell invocation (see section <A HREF="bashref.html#SEC65">6.1 Invoking Bash</A>). 12619<P> 12620 12621<LI> 12622Bash has much more optional behavior controllable with the <CODE>set</CODE> 12623builtin (see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 12624<P> 12625 12626<LI> 12627The <SAMP>`-x'</SAMP> (<CODE>xtrace</CODE>) option displays commands other than 12628simple commands when performing an execution trace 12629(see section <A HREF="bashref.html#SEC59">4.3 The Set Builtin</A>). 12630<P> 12631 12632<LI> 12633The <CODE>test</CODE> builtin (see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>) 12634is slightly different, as it implements the POSIX algorithm, 12635which specifies the behavior based on the number of arguments. 12636<P> 12637 12638<LI> 12639Bash includes the <CODE>caller</CODE> builtin, which displays the context of 12640any active subroutine call (a shell function or a script executed with 12641the <CODE>.</CODE> or <CODE>source</CODE> builtins). This supports the bash 12642debugger. 12643<P> 12644 12645<LI> 12646The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>) allows a 12647<CODE>DEBUG</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE>. 12648Commands specified with a <CODE>DEBUG</CODE> trap are executed before every 12649simple command, <CODE>for</CODE> command, <CODE>case</CODE> command, 12650<CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before 12651the first command executes in a shell function. 12652The <CODE>DEBUG</CODE> trap is not inherited by shell functions unless the 12653function has been given the <CODE>trace</CODE> attribute or the 12654<CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin. 12655The <CODE>extdebug</CODE> shell option has additional effects on the 12656<CODE>DEBUG</CODE> trap. 12657<P> 12658 12659The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>) allows an 12660<CODE>ERR</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>. 12661Commands specified with an <CODE>ERR</CODE> trap are executed after a simple 12662command fails, with a few exceptions. 12663The <CODE>ERR</CODE> trap is not inherited by shell functions unless the 12664<CODE>-o errtrace</CODE> option to the <CODE>set</CODE> builtin is enabled. 12665</P><P> 12666 12667The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>) allows a 12668<CODE>RETURN</CODE> pseudo-signal specification, similar to 12669<CODE>EXIT</CODE> and <CODE>DEBUG</CODE>. 12670Commands specified with an <CODE>RETURN</CODE> trap are executed before 12671execution resumes after a shell function or a shell script executed with 12672<CODE>.</CODE> or <CODE>source</CODE> returns. 12673The <CODE>RETURN</CODE> trap is not inherited by shell functions unless the 12674function has been given the <CODE>trace</CODE> attribute or the 12675<CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin. 12676</P><P> 12677 12678<LI> 12679The Bash <CODE>type</CODE> builtin is more extensive and gives more information 12680about the names it finds (see section <A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A>). 12681<P> 12682 12683<LI> 12684The Bash <CODE>umask</CODE> builtin permits a <SAMP>`-p'</SAMP> option to cause 12685the output to be displayed in the form of a <CODE>umask</CODE> command 12686that may be reused as input (see section <A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A>). 12687<P> 12688 12689<LI> 12690Bash implements a <CODE>csh</CODE>-like directory stack, and provides the 12691<CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins to manipulate it 12692(see section <A HREF="bashref.html#SEC82">6.8 The Directory Stack</A>). 12693Bash also makes the directory stack visible as the value of the 12694<CODE>DIRSTACK</CODE> shell variable. 12695<P> 12696 12697<LI> 12698Bash interprets special backslash-escaped characters in the prompt 12699strings when interactive (see section <A HREF="bashref.html#SEC84">6.9 Controlling the Prompt</A>). 12700<P> 12701 12702<LI> 12703The Bash restricted mode is more useful (see section <A HREF="bashref.html#SEC85">6.10 The Restricted Shell</A>); 12704the SVR4.2 shell restricted mode is too limited. 12705<P> 12706 12707<LI> 12708The <CODE>disown</CODE> builtin can remove a job from the internal shell 12709job table (see section <A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A>) or suppress the sending 12710of <CODE>SIGHUP</CODE> to a job when the shell exits as the result of a 12711<CODE>SIGHUP</CODE>. 12712<P> 12713 12714<LI> 12715Bash includes a number of features to support a separate debugger for 12716shell scripts. 12717<P> 12718 12719<LI> 12720The SVR4.2 shell has two privilege-related builtins 12721(<CODE>mldmode</CODE> and <CODE>priv</CODE>) not present in Bash. 12722<P> 12723 12724<LI> 12725Bash does not have the <CODE>stop</CODE> or <CODE>newgrp</CODE> builtins. 12726<P> 12727 12728<LI> 12729Bash does not use the <CODE>SHACCT</CODE> variable or perform shell accounting. 12730<P> 12731 12732<LI> 12733The SVR4.2 <CODE>sh</CODE> uses a <CODE>TIMEOUT</CODE> variable like Bash uses 12734<CODE>TMOUT</CODE>. 12735<P> 12736 12737</UL> 12738<P> 12739 12740More features unique to Bash may be found in <A HREF="bashref.html#SEC64">6. Bash Features</A>. 12741</P><P> 12742 12743<HR SIZE="6"> 12744<A NAME="SEC133"></A> 12745<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 12746<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> < </A>]</TD> 12747<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> > </A>]</TD> 12748<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> << </A>]</TD> 12749<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> Up </A>]</TD> 12750<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> >> </A>]</TD> 12751<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 12752<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 12753<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 12754<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 12755</TR></TABLE> 12756<H2> B.1 Implementation Differences From The SVR4.2 Shell </H2> 12757<!--docid::SEC133::--> 12758<P> 12759 12760Since Bash is a completely new implementation, it does not suffer from 12761many of the limitations of the SVR4.2 shell. For instance: 12762</P><P> 12763 12764<UL> 12765 12766<LI> 12767Bash does not fork a subshell when redirecting into or out of 12768a shell control structure such as an <CODE>if</CODE> or <CODE>while</CODE> 12769statement. 12770<P> 12771 12772<LI> 12773Bash does not allow unbalanced quotes. The SVR4.2 shell will silently 12774insert a needed closing quote at <CODE>EOF</CODE> under certain circumstances. 12775This can be the cause of some hard-to-find errors. 12776<P> 12777 12778<LI> 12779The SVR4.2 shell uses a baroque memory management scheme based on 12780trapping <CODE>SIGSEGV</CODE>. If the shell is started from a process with 12781<CODE>SIGSEGV</CODE> blocked (e.g., by using the <CODE>system()</CODE> C library 12782function call), it misbehaves badly. 12783<P> 12784 12785<LI> 12786In a questionable attempt at security, the SVR4.2 shell, 12787when invoked without the <SAMP>`-p'</SAMP> option, will alter its real 12788and effective UID and GID if they are less than some 12789magic threshold value, commonly 100. 12790This can lead to unexpected results. 12791<P> 12792 12793<LI> 12794The SVR4.2 shell does not allow users to trap <CODE>SIGSEGV</CODE>, 12795<CODE>SIGALRM</CODE>, or <CODE>SIGCHLD</CODE>. 12796<P> 12797 12798<LI> 12799The SVR4.2 shell does not allow the <CODE>IFS</CODE>, <CODE>MAILCHECK</CODE>, 12800<CODE>PATH</CODE>, <CODE>PS1</CODE>, or <CODE>PS2</CODE> variables to be unset. 12801<P> 12802 12803<LI> 12804The SVR4.2 shell treats <SAMP>`^'</SAMP> as the undocumented equivalent of 12805<SAMP>`|'</SAMP>. 12806<P> 12807 12808<LI> 12809Bash allows multiple option arguments when it is invoked (<CODE>-x -v</CODE>); 12810the SVR4.2 shell allows only one option argument (<CODE>-xv</CODE>). In 12811fact, some versions of the shell dump core if the second argument begins 12812with a <SAMP>`-'</SAMP>. 12813<P> 12814 12815<LI> 12816The SVR4.2 shell exits a script if any builtin fails; Bash exits 12817a script only if one of the POSIX 1003.2 special builtins fails, and 12818only for certain failures, as enumerated in the POSIX 1003.2 standard. 12819<P> 12820 12821<LI> 12822The SVR4.2 shell behaves differently when invoked as <CODE>jsh</CODE> 12823(it turns on job control). 12824</UL> 12825<P> 12826 12827<A NAME="Copying This Manual"></A> 12828<HR SIZE="6"> 12829<A NAME="SEC134"></A> 12830<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 12831<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> < </A>]</TD> 12832<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> > </A>]</TD> 12833<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 12834<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 12835<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> 12836<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 12837<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 12838<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 12839<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 12840</TR></TABLE> 12841<H1> C. Copying This Manual </H1> 12842<!--docid::SEC134::--> 12843<P> 12844 12845<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 12846<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC135">C.1 GNU Free Documentation License</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">License for copying this manual.</TD></TR> 12847</TABLE></BLOCKQUOTE> 12848<P> 12849 12850<A NAME="GNU Free Documentation License"></A> 12851<HR SIZE="6"> 12852<A NAME="SEC135"></A> 12853<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 12854<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> < </A>]</TD> 12855<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> > </A>]</TD> 12856<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 12857<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> Up </A>]</TD> 12858<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> 12859<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 12860<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 12861<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 12862<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 12863</TR></TABLE> 12864<H2> C.1 GNU Free Documentation License </H2> 12865<!--docid::SEC135::--> 12866<P> 12867 12868<A NAME="IDX510"></A> 12869<center> 12870 Version 1.2, November 2002 12871</center> 12872</P><P> 12873 12874<TABLE><tr><td> </td><td class=display><pre style="font-family: serif">Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 1287559 Temple Place, Suite 330, Boston, MA 02111-1307, USA 12876 12877Everyone is permitted to copy and distribute verbatim copies 12878of this license document, but changing it is not allowed. 12879</pre></td></tr></table></P><P> 12880 12881<OL> 12882<LI> 12883PREAMBLE 12884<P> 12885 12886The purpose of this License is to make a manual, textbook, or other 12887functional and useful document <EM>free</EM> in the sense of freedom: to 12888assure everyone the effective freedom to copy and redistribute it, 12889with or without modifying it, either commercially or noncommercially. 12890Secondarily, this License preserves for the author and publisher a way 12891to get credit for their work, while not being considered responsible 12892for modifications made by others. 12893</P><P> 12894 12895This License is a kind of "copyleft", which means that derivative 12896works of the document must themselves be free in the same sense. It 12897complements the GNU General Public License, which is a copyleft 12898license designed for free software. 12899</P><P> 12900 12901We have designed this License in order to use it for manuals for free 12902software, because free software needs free documentation: a free 12903program should come with manuals providing the same freedoms that the 12904software does. But this License is not limited to software manuals; 12905it can be used for any textual work, regardless of subject matter or 12906whether it is published as a printed book. We recommend this License 12907principally for works whose purpose is instruction or reference. 12908</P><P> 12909 12910<LI> 12911APPLICABILITY AND DEFINITIONS 12912<P> 12913 12914This License applies to any manual or other work, in any medium, that 12915contains a notice placed by the copyright holder saying it can be 12916distributed under the terms of this License. Such a notice grants a 12917world-wide, royalty-free license, unlimited in duration, to use that 12918work under the conditions stated herein. The "Document", below, 12919refers to any such manual or work. Any member of the public is a 12920licensee, and is addressed as "you". You accept the license if you 12921copy, modify or distribute the work in a way requiring permission 12922under copyright law. 12923</P><P> 12924 12925A "Modified Version" of the Document means any work containing the 12926Document or a portion of it, either copied verbatim, or with 12927modifications and/or translated into another language. 12928</P><P> 12929 12930A "Secondary Section" is a named appendix or a front-matter section 12931of the Document that deals exclusively with the relationship of the 12932publishers or authors of the Document to the Document's overall 12933subject (or to related matters) and contains nothing that could fall 12934directly within that overall subject. (Thus, if the Document is in 12935part a textbook of mathematics, a Secondary Section may not explain 12936any mathematics.) The relationship could be a matter of historical 12937connection with the subject or with related matters, or of legal, 12938commercial, philosophical, ethical or political position regarding 12939them. 12940</P><P> 12941 12942The "Invariant Sections" are certain Secondary Sections whose titles 12943are designated, as being those of Invariant Sections, in the notice 12944that says that the Document is released under this License. If a 12945section does not fit the above definition of Secondary then it is not 12946allowed to be designated as Invariant. The Document may contain zero 12947Invariant Sections. If the Document does not identify any Invariant 12948Sections then there are none. 12949</P><P> 12950 12951The "Cover Texts" are certain short passages of text that are listed, 12952as Front-Cover Texts or Back-Cover Texts, in the notice that says that 12953the Document is released under this License. A Front-Cover Text may 12954be at most 5 words, and a Back-Cover Text may be at most 25 words. 12955</P><P> 12956 12957A "Transparent" copy of the Document means a machine-readable copy, 12958represented in a format whose specification is available to the 12959general public, that is suitable for revising the document 12960straightforwardly with generic text editors or (for images composed of 12961pixels) generic paint programs or (for drawings) some widely available 12962drawing editor, and that is suitable for input to text formatters or 12963for automatic translation to a variety of formats suitable for input 12964to text formatters. A copy made in an otherwise Transparent file 12965format whose markup, or absence of markup, has been arranged to thwart 12966or discourage subsequent modification by readers is not Transparent. 12967An image format is not Transparent if used for any substantial amount 12968of text. A copy that is not "Transparent" is called "Opaque". 12969</P><P> 12970 12971Examples of suitable formats for Transparent copies include plain 12972ASCII without markup, Texinfo input format, LaTeX input 12973format, <FONT SIZE="-1">SGML</FONT> or <FONT SIZE="-1">XML</FONT> using a publicly available 12974<FONT SIZE="-1">DTD</FONT>, and standard-conforming simple <FONT SIZE="-1">HTML</FONT>, 12975PostScript or <FONT SIZE="-1">PDF</FONT> designed for human modification. Examples 12976of transparent image formats include <FONT SIZE="-1">PNG</FONT>, <FONT SIZE="-1">XCF</FONT> and 12977<FONT SIZE="-1">JPG</FONT>. Opaque formats include proprietary formats that can be 12978read and edited only by proprietary word processors, <FONT SIZE="-1">SGML</FONT> or 12979<FONT SIZE="-1">XML</FONT> for which the <FONT SIZE="-1">DTD</FONT> and/or processing tools are 12980not generally available, and the machine-generated <FONT SIZE="-1">HTML</FONT>, 12981PostScript or <FONT SIZE="-1">PDF</FONT> produced by some word processors for 12982output purposes only. 12983</P><P> 12984 12985The "Title Page" means, for a printed book, the title page itself, 12986plus such following pages as are needed to hold, legibly, the material 12987this License requires to appear in the title page. For works in 12988formats which do not have any title page as such, "Title Page" means 12989the text near the most prominent appearance of the work's title, 12990preceding the beginning of the body of the text. 12991</P><P> 12992 12993A section "Entitled XYZ" means a named subunit of the Document whose 12994title either is precisely XYZ or contains XYZ in parentheses following 12995text that translates XYZ in another language. (Here XYZ stands for a 12996specific section name mentioned below, such as "Acknowledgements", 12997"Dedications", "Endorsements", or "History".) To "Preserve the Title" 12998of such a section when you modify the Document means that it remains a 12999section "Entitled XYZ" according to this definition. 13000</P><P> 13001 13002The Document may include Warranty Disclaimers next to the notice which 13003states that this License applies to the Document. These Warranty 13004Disclaimers are considered to be included by reference in this 13005License, but only as regards disclaiming warranties: any other 13006implication that these Warranty Disclaimers may have is void and has 13007no effect on the meaning of this License. 13008</P><P> 13009 13010<LI> 13011VERBATIM COPYING 13012<P> 13013 13014You may copy and distribute the Document in any medium, either 13015commercially or noncommercially, provided that this License, the 13016copyright notices, and the license notice saying this License applies 13017to the Document are reproduced in all copies, and that you add no other 13018conditions whatsoever to those of this License. You may not use 13019technical measures to obstruct or control the reading or further 13020copying of the copies you make or distribute. However, you may accept 13021compensation in exchange for copies. If you distribute a large enough 13022number of copies you must also follow the conditions in section 3. 13023</P><P> 13024 13025You may also lend copies, under the same conditions stated above, and 13026you may publicly display copies. 13027</P><P> 13028 13029<LI> 13030COPYING IN QUANTITY 13031<P> 13032 13033If you publish printed copies (or copies in media that commonly have 13034printed covers) of the Document, numbering more than 100, and the 13035Document's license notice requires Cover Texts, you must enclose the 13036copies in covers that carry, clearly and legibly, all these Cover 13037Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on 13038the back cover. Both covers must also clearly and legibly identify 13039you as the publisher of these copies. The front cover must present 13040the full title with all words of the title equally prominent and 13041visible. You may add other material on the covers in addition. 13042Copying with changes limited to the covers, as long as they preserve 13043the title of the Document and satisfy these conditions, can be treated 13044as verbatim copying in other respects. 13045</P><P> 13046 13047If the required texts for either cover are too voluminous to fit 13048legibly, you should put the first ones listed (as many as fit 13049reasonably) on the actual cover, and continue the rest onto adjacent 13050pages. 13051</P><P> 13052 13053If you publish or distribute Opaque copies of the Document numbering 13054more than 100, you must either include a machine-readable Transparent 13055copy along with each Opaque copy, or state in or with each Opaque copy 13056a computer-network location from which the general network-using 13057public has access to download using public-standard network protocols 13058a complete Transparent copy of the Document, free of added material. 13059If you use the latter option, you must take reasonably prudent steps, 13060when you begin distribution of Opaque copies in quantity, to ensure 13061that this Transparent copy will remain thus accessible at the stated 13062location until at least one year after the last time you distribute an 13063Opaque copy (directly or through your agents or retailers) of that 13064edition to the public. 13065</P><P> 13066 13067It is requested, but not required, that you contact the authors of the 13068Document well before redistributing any large number of copies, to give 13069them a chance to provide you with an updated version of the Document. 13070</P><P> 13071 13072<LI> 13073MODIFICATIONS 13074<P> 13075 13076You may copy and distribute a Modified Version of the Document under 13077the conditions of sections 2 and 3 above, provided that you release 13078the Modified Version under precisely this License, with the Modified 13079Version filling the role of the Document, thus licensing distribution 13080and modification of the Modified Version to whoever possesses a copy 13081of it. In addition, you must do these things in the Modified Version: 13082</P><P> 13083 13084<OL> 13085<LI> 13086Use in the Title Page (and on the covers, if any) a title distinct 13087from that of the Document, and from those of previous versions 13088(which should, if there were any, be listed in the History section 13089of the Document). You may use the same title as a previous version 13090if the original publisher of that version gives permission. 13091<P> 13092 13093<LI> 13094List on the Title Page, as authors, one or more persons or entities 13095responsible for authorship of the modifications in the Modified 13096Version, together with at least five of the principal authors of the 13097Document (all of its principal authors, if it has fewer than five), 13098unless they release you from this requirement. 13099<P> 13100 13101<LI> 13102State on the Title page the name of the publisher of the 13103Modified Version, as the publisher. 13104<P> 13105 13106<LI> 13107Preserve all the copyright notices of the Document. 13108<P> 13109 13110<LI> 13111Add an appropriate copyright notice for your modifications 13112adjacent to the other copyright notices. 13113<P> 13114 13115<LI> 13116Include, immediately after the copyright notices, a license notice 13117giving the public permission to use the Modified Version under the 13118terms of this License, in the form shown in the Addendum below. 13119<P> 13120 13121<LI> 13122Preserve in that license notice the full lists of Invariant Sections 13123and required Cover Texts given in the Document's license notice. 13124<P> 13125 13126<LI> 13127Include an unaltered copy of this License. 13128<P> 13129 13130<LI> 13131Preserve the section Entitled "History", Preserve its Title, and add 13132to it an item stating at least the title, year, new authors, and 13133publisher of the Modified Version as given on the Title Page. If 13134there is no section Entitled "History" in the Document, create one 13135stating the title, year, authors, and publisher of the Document as 13136given on its Title Page, then add an item describing the Modified 13137Version as stated in the previous sentence. 13138<P> 13139 13140<LI> 13141Preserve the network location, if any, given in the Document for 13142public access to a Transparent copy of the Document, and likewise 13143the network locations given in the Document for previous versions 13144it was based on. These may be placed in the "History" section. 13145You may omit a network location for a work that was published at 13146least four years before the Document itself, or if the original 13147publisher of the version it refers to gives permission. 13148<P> 13149 13150<LI> 13151For any section Entitled "Acknowledgements" or "Dedications", Preserve 13152the Title of the section, and preserve in the section all the 13153substance and tone of each of the contributor acknowledgements and/or 13154dedications given therein. 13155<P> 13156 13157<LI> 13158Preserve all the Invariant Sections of the Document, 13159unaltered in their text and in their titles. Section numbers 13160or the equivalent are not considered part of the section titles. 13161<P> 13162 13163<LI> 13164Delete any section Entitled "Endorsements". Such a section 13165may not be included in the Modified Version. 13166<P> 13167 13168<LI> 13169Do not retitle any existing section to be Entitled "Endorsements" or 13170to conflict in title with any Invariant Section. 13171<P> 13172 13173<LI> 13174Preserve any Warranty Disclaimers. 13175</OL> 13176<P> 13177 13178If the Modified Version includes new front-matter sections or 13179appendices that qualify as Secondary Sections and contain no material 13180copied from the Document, you may at your option designate some or all 13181of these sections as invariant. To do this, add their titles to the 13182list of Invariant Sections in the Modified Version's license notice. 13183These titles must be distinct from any other section titles. 13184</P><P> 13185 13186You may add a section Entitled "Endorsements", provided it contains 13187nothing but endorsements of your Modified Version by various 13188parties--for example, statements of peer review or that the text has 13189been approved by an organization as the authoritative definition of a 13190standard. 13191</P><P> 13192 13193You may add a passage of up to five words as a Front-Cover Text, and a 13194passage of up to 25 words as a Back-Cover Text, to the end of the list 13195of Cover Texts in the Modified Version. Only one passage of 13196Front-Cover Text and one of Back-Cover Text may be added by (or 13197through arrangements made by) any one entity. If the Document already 13198includes a cover text for the same cover, previously added by you or 13199by arrangement made by the same entity you are acting on behalf of, 13200you may not add another; but you may replace the old one, on explicit 13201permission from the previous publisher that added the old one. 13202</P><P> 13203 13204The author(s) and publisher(s) of the Document do not by this License 13205give permission to use their names for publicity for or to assert or 13206imply endorsement of any Modified Version. 13207</P><P> 13208 13209<LI> 13210COMBINING DOCUMENTS 13211<P> 13212 13213You may combine the Document with other documents released under this 13214License, under the terms defined in section 4 above for modified 13215versions, provided that you include in the combination all of the 13216Invariant Sections of all of the original documents, unmodified, and 13217list them all as Invariant Sections of your combined work in its 13218license notice, and that you preserve all their Warranty Disclaimers. 13219</P><P> 13220 13221The combined work need only contain one copy of this License, and 13222multiple identical Invariant Sections may be replaced with a single 13223copy. If there are multiple Invariant Sections with the same name but 13224different contents, make the title of each such section unique by 13225adding at the end of it, in parentheses, the name of the original 13226author or publisher of that section if known, or else a unique number. 13227Make the same adjustment to the section titles in the list of 13228Invariant Sections in the license notice of the combined work. 13229</P><P> 13230 13231In the combination, you must combine any sections Entitled "History" 13232in the various original documents, forming one section Entitled 13233"History"; likewise combine any sections Entitled "Acknowledgements", 13234and any sections Entitled "Dedications". You must delete all 13235sections Entitled "Endorsements." 13236</P><P> 13237 13238<LI> 13239COLLECTIONS OF DOCUMENTS 13240<P> 13241 13242You may make a collection consisting of the Document and other documents 13243released under this License, and replace the individual copies of this 13244License in the various documents with a single copy that is included in 13245the collection, provided that you follow the rules of this License for 13246verbatim copying of each of the documents in all other respects. 13247</P><P> 13248 13249You may extract a single document from such a collection, and distribute 13250it individually under this License, provided you insert a copy of this 13251License into the extracted document, and follow this License in all 13252other respects regarding verbatim copying of that document. 13253</P><P> 13254 13255<LI> 13256AGGREGATION WITH INDEPENDENT WORKS 13257<P> 13258 13259A compilation of the Document or its derivatives with other separate 13260and independent documents or works, in or on a volume of a storage or 13261distribution medium, is called an "aggregate" if the copyright 13262resulting from the compilation is not used to limit the legal rights 13263of the compilation's users beyond what the individual works permit. 13264When the Document is included an aggregate, this License does not 13265apply to the other works in the aggregate which are not themselves 13266derivative works of the Document. 13267</P><P> 13268 13269If the Cover Text requirement of section 3 is applicable to these 13270copies of the Document, then if the Document is less than one half of 13271the entire aggregate, the Document's Cover Texts may be placed on 13272covers that bracket the Document within the aggregate, or the 13273electronic equivalent of covers if the Document is in electronic form. 13274Otherwise they must appear on printed covers that bracket the whole 13275aggregate. 13276</P><P> 13277 13278<LI> 13279TRANSLATION 13280<P> 13281 13282Translation is considered a kind of modification, so you may 13283distribute translations of the Document under the terms of section 4. 13284Replacing Invariant Sections with translations requires special 13285permission from their copyright holders, but you may include 13286translations of some or all Invariant Sections in addition to the 13287original versions of these Invariant Sections. You may include a 13288translation of this License, and all the license notices in the 13289Document, and any Warranty Disclaimers, provided that you also include 13290the original English version of this License and the original versions 13291of those notices and disclaimers. In case of a disagreement between 13292the translation and the original version of this License or a notice 13293or disclaimer, the original version will prevail. 13294</P><P> 13295 13296If a section in the Document is Entitled "Acknowledgements", 13297"Dedications", or "History", the requirement (section 4) to Preserve 13298its Title (section 1) will typically require changing the actual 13299title. 13300</P><P> 13301 13302<LI> 13303TERMINATION 13304<P> 13305 13306You may not copy, modify, sublicense, or distribute the Document except 13307as expressly provided for under this License. Any other attempt to 13308copy, modify, sublicense or distribute the Document is void, and will 13309automatically terminate your rights under this License. However, 13310parties who have received copies, or rights, from you under this 13311License will not have their licenses terminated so long as such 13312parties remain in full compliance. 13313</P><P> 13314 13315<LI> 13316FUTURE REVISIONS OF THIS LICENSE 13317<P> 13318 13319The Free Software Foundation may publish new, revised versions 13320of the GNU Free Documentation License from time to time. Such new 13321versions will be similar in spirit to the present version, but may 13322differ in detail to address new problems or concerns. See 13323<A HREF="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</A>. 13324</P><P> 13325 13326Each version of the License is given a distinguishing version number. 13327If the Document specifies that a particular numbered version of this 13328License "or any later version" applies to it, you have the option of 13329following the terms and conditions either of that specified version or 13330of any later version that has been published (not as a draft) by the 13331Free Software Foundation. If the Document does not specify a version 13332number of this License, you may choose any version ever published (not 13333as a draft) by the Free Software Foundation. 13334</OL> 13335<P> 13336 13337<HR SIZE="6"> 13338<A NAME="SEC136"></A> 13339<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 13340<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> < </A>]</TD> 13341<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> > </A>]</TD> 13342<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 13343<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> Up </A>]</TD> 13344<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> 13345<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 13346<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 13347<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 13348<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 13349</TR></TABLE> 13350<H3> C.1.1 ADDENDUM: How to use this License for your documents </H3> 13351<!--docid::SEC136::--> 13352<P> 13353 13354To use this License in a document you have written, include a copy of 13355the License in the document and put the following copyright and 13356license notices just after the title page: 13357</P><P> 13358 13359<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> Copyright (C) <VAR>year</VAR> <VAR>your name</VAR>. 13360 Permission is granted to copy, distribute and/or modify this document 13361 under the terms of the GNU Free Documentation License, Version 1.2 13362 or any later version published by the Free Software Foundation; 13363 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. 13364 A copy of the license is included in the section entitled ``GNU 13365 Free Documentation License''. 13366</FONT></pre></td></tr></table></P><P> 13367 13368If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, 13369replace the "with...Texts." line with this: 13370</P><P> 13371 13372<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> with the Invariant Sections being <VAR>list their titles</VAR>, with 13373 the Front-Cover Texts being <VAR>list</VAR>, and with the Back-Cover Texts 13374 being <VAR>list</VAR>. 13375</FONT></pre></td></tr></table></P><P> 13376 13377If you have Invariant Sections without Cover Texts, or some other 13378combination of the three, merge those two alternatives to suit the 13379situation. 13380</P><P> 13381 13382If your document contains nontrivial examples of program code, we 13383recommend releasing these examples in parallel under your choice of 13384free software license, such as the GNU General Public License, 13385to permit their use in free software. 13386</P><P> 13387 13388<A NAME="Builtin Index"></A> 13389<HR SIZE="6"> 13390<A NAME="SEC137"></A> 13391<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 13392<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> < </A>]</TD> 13393<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> > </A>]</TD> 13394<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 13395<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 13396<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> 13397<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 13398<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 13399<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 13400<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 13401</TR></TABLE> 13402<H1> Index of Shell Builtin Commands </H1> 13403<!--docid::SEC137::--> 13404<table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A> 13405 13406<A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A> 13407 13408<A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A> 13409 13410<BR> 13411<A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A> 13412 13413<A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A> 13414 13415<A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A> 13416 13417<A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A> 13418 13419<A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A> 13420 13421<A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A> 13422 13423<A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A> 13424 13425<A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A> 13426 13427<A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A> 13428 13429<A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A> 13430 13431<A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A> 13432 13433<A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A> 13434 13435<A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A> 13436 13437<A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A> 13438 13439<A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A> 13440 13441<A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A> 13442 13443<A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A> 13444 13445</td></tr></table><br><P></P> 13446<TABLE border=0> 13447<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> 13448<TR><TD COLSPAN=3> <HR></TD></TR> 13449<TR><TH><A NAME="bt_."></A>.</TH><TD></TD><TD></TD></TR> 13450<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX69"><CODE>.</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13451<TR><TD COLSPAN=3> <HR></TD></TR> 13452<TR><TH><A NAME="bt_:"></A>:</TH><TD></TD><TD></TD></TR> 13453<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX68"><CODE>:</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13454<TR><TD COLSPAN=3> <HR></TD></TR> 13455<TR><TH><A NAME="bt_["></A>[</TH><TD></TD><TD></TD></TR> 13456<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX84"><CODE>[</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13457<TR><TD COLSPAN=3> <HR></TD></TR> 13458<TR><TH><A NAME="bt_A"></A>A</TH><TD></TD><TD></TD></TR> 13459<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX89"><CODE>alias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13460<TR><TD COLSPAN=3> <HR></TD></TR> 13461<TR><TH><A NAME="bt_B"></A>B</TH><TD></TD><TD></TD></TR> 13462<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX275"><CODE>bg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A></TD></TR> 13463<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX90"><CODE>bind</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13464<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX70"><CODE>break</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13465<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX91"><CODE>builtin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13466<TR><TD COLSPAN=3> <HR></TD></TR> 13467<TR><TH><A NAME="bt_C"></A>C</TH><TD></TD><TD></TD></TR> 13468<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX92"><CODE>caller</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13469<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX71"><CODE>cd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13470<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX93"><CODE>command</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13471<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX504"><CODE>compgen</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.7 Programmable Completion Builtins</A></TD></TR> 13472<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX505"><CODE>complete</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.7 Programmable Completion Builtins</A></TD></TR> 13473<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX72"><CODE>continue</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13474<TR><TD COLSPAN=3> <HR></TD></TR> 13475<TR><TH><A NAME="bt_D"></A>D</TH><TD></TD><TD></TD></TR> 13476<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX94"><CODE>declare</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13477<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX272"><CODE>dirs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.8.1 Directory Stack Builtins</A></TD></TR> 13478<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX280"><CODE>disown</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A></TD></TR> 13479<TR><TD COLSPAN=3> <HR></TD></TR> 13480<TR><TH><A NAME="bt_E"></A>E</TH><TD></TD><TD></TD></TR> 13481<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX95"><CODE>echo</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13482<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX96"><CODE>enable</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13483<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX73"><CODE>eval</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13484<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX74"><CODE>exec</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13485<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX75"><CODE>exit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13486<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX76"><CODE>export</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13487<TR><TD COLSPAN=3> <HR></TD></TR> 13488<TR><TH><A NAME="bt_F"></A>F</TH><TD></TD><TD></TD></TR> 13489<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX507"><CODE>fc</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC117">9.2 Bash History Builtins</A></TD></TR> 13490<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX276"><CODE>fg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A></TD></TR> 13491<TR><TD COLSPAN=3> <HR></TD></TR> 13492<TR><TH><A NAME="bt_G"></A>G</TH><TD></TD><TD></TD></TR> 13493<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX77"><CODE>getopts</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13494<TR><TD COLSPAN=3> <HR></TD></TR> 13495<TR><TH><A NAME="bt_H"></A>H</TH><TD></TD><TD></TD></TR> 13496<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX78"><CODE>hash</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13497<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX97"><CODE>help</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13498<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX508"><CODE>history</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC117">9.2 Bash History Builtins</A></TD></TR> 13499<TR><TD COLSPAN=3> <HR></TD></TR> 13500<TR><TH><A NAME="bt_J"></A>J</TH><TD></TD><TD></TD></TR> 13501<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX277"><CODE>jobs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A></TD></TR> 13502<TR><TD COLSPAN=3> <HR></TD></TR> 13503<TR><TH><A NAME="bt_K"></A>K</TH><TD></TD><TD></TD></TR> 13504<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX278"><CODE>kill</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A></TD></TR> 13505<TR><TD COLSPAN=3> <HR></TD></TR> 13506<TR><TH><A NAME="bt_L"></A>L</TH><TD></TD><TD></TD></TR> 13507<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX98"><CODE>let</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13508<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX99"><CODE>local</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13509<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX100"><CODE>logout</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13510<TR><TD COLSPAN=3> <HR></TD></TR> 13511<TR><TH><A NAME="bt_P"></A>P</TH><TD></TD><TD></TD></TR> 13512<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX273"><CODE>popd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.8.1 Directory Stack Builtins</A></TD></TR> 13513<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX101"><CODE>printf</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13514<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX274"><CODE>pushd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.8.1 Directory Stack Builtins</A></TD></TR> 13515<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX79"><CODE>pwd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13516<TR><TD COLSPAN=3> <HR></TD></TR> 13517<TR><TH><A NAME="bt_R"></A>R</TH><TD></TD><TD></TD></TR> 13518<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX102"><CODE>read</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13519<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX80"><CODE>readonly</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13520<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX81"><CODE>return</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13521<TR><TD COLSPAN=3> <HR></TD></TR> 13522<TR><TH><A NAME="bt_S"></A>S</TH><TD></TD><TD></TD></TR> 13523<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX109"><CODE>set</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.3 The Set Builtin</A></TD></TR> 13524<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX82"><CODE>shift</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13525<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX103"><CODE>shopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13526<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX104"><CODE>source</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13527<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX281"><CODE>suspend</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A></TD></TR> 13528<TR><TD COLSPAN=3> <HR></TD></TR> 13529<TR><TH><A NAME="bt_T"></A>T</TH><TD></TD><TD></TD></TR> 13530<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX83"><CODE>test</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13531<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX85"><CODE>times</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13532<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX86"><CODE>trap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13533<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX105"><CODE>type</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13534<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX106"><CODE>typeset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13535<TR><TD COLSPAN=3> <HR></TD></TR> 13536<TR><TH><A NAME="bt_U"></A>U</TH><TD></TD><TD></TD></TR> 13537<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX107"><CODE>ulimit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13538<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX87"><CODE>umask</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13539<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX108"><CODE>unalias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A></TD></TR> 13540<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX88"><CODE>unset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A></TD></TR> 13541<TR><TD COLSPAN=3> <HR></TD></TR> 13542<TR><TH><A NAME="bt_W"></A>W</TH><TD></TD><TD></TD></TR> 13543<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX279"><CODE>wait</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC89">7.2 Job Control Builtins</A></TD></TR> 13544<TR><TD COLSPAN=3> <HR></TD></TR> 13545</TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A> 13546 13547<A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A> 13548 13549<A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A> 13550 13551<BR> 13552<A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A> 13553 13554<A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A> 13555 13556<A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A> 13557 13558<A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A> 13559 13560<A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A> 13561 13562<A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A> 13563 13564<A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A> 13565 13566<A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A> 13567 13568<A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A> 13569 13570<A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A> 13571 13572<A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A> 13573 13574<A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A> 13575 13576<A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A> 13577 13578<A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A> 13579 13580<A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A> 13581 13582<A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A> 13583 13584<A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A> 13585 13586</td></tr></table><br><P> 13587 13588<A NAME="Reserved Word Index"></A> 13589<HR SIZE="6"> 13590<A NAME="SEC138"></A> 13591<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 13592<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> < </A>]</TD> 13593<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC139"> > </A>]</TD> 13594<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 13595<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 13596<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> 13597<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 13598<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 13599<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 13600<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 13601</TR></TABLE> 13602<H1> Index of Shell Reserved Words </H1> 13603<!--docid::SEC138::--> 13604<table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A> 13605 13606<A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A> 13607 13608<A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A> 13609 13610<A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A> 13611 13612<A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A> 13613 13614<BR> 13615<A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A> 13616 13617<A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A> 13618 13619<A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A> 13620 13621<A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A> 13622 13623<A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A> 13624 13625<A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A> 13626 13627<A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A> 13628 13629<A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A> 13630 13631<A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A> 13632 13633</td></tr></table><br><P></P> 13634<TABLE border=0> 13635<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> 13636<TR><TD COLSPAN=3> <HR></TD></TR> 13637<TR><TH><A NAME="rw_!"></A>!</TH><TD></TD><TD></TD></TR> 13638<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> 13639<TR><TD COLSPAN=3> <HR></TD></TR> 13640<TR><TH><A NAME="rw_["></A>[</TH><TD></TD><TD></TD></TR> 13641<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> 13642<TR><TD COLSPAN=3> <HR></TD></TR> 13643<TR><TH><A NAME="rw_]"></A>]</TH><TD></TD><TD></TD></TR> 13644<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> 13645<TR><TD COLSPAN=3> <HR></TD></TR> 13646<TR><TH><A NAME="rw_{"></A>{</TH><TD></TD><TD></TD></TR> 13647<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> 13648<TR><TD COLSPAN=3> <HR></TD></TR> 13649<TR><TH><A NAME="rw_}"></A>}</TH><TD></TD><TD></TD></TR> 13650<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> 13651<TR><TD COLSPAN=3> <HR></TD></TR> 13652<TR><TH><A NAME="rw_C"></A>C</TH><TD></TD><TD></TD></TR> 13653<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> 13654<TR><TD COLSPAN=3> <HR></TD></TR> 13655<TR><TH><A NAME="rw_D"></A>D</TH><TD></TD><TD></TD></TR> 13656<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> 13657<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> 13658<TR><TD COLSPAN=3> <HR></TD></TR> 13659<TR><TH><A NAME="rw_E"></A>E</TH><TD></TD><TD></TD></TR> 13660<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> 13661<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> 13662<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> 13663<TR><TD COLSPAN=3> <HR></TD></TR> 13664<TR><TH><A NAME="rw_F"></A>F</TH><TD></TD><TD></TD></TR> 13665<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> 13666<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> 13667<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX45"><CODE>function</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC23">3.3 Shell Functions</A></TD></TR> 13668<TR><TD COLSPAN=3> <HR></TD></TR> 13669<TR><TH><A NAME="rw_I"></A>I</TH><TD></TD><TD></TD></TR> 13670<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> 13671<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> 13672<TR><TD COLSPAN=3> <HR></TD></TR> 13673<TR><TH><A NAME="rw_S"></A>S</TH><TD></TD><TD></TD></TR> 13674<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> 13675<TR><TD COLSPAN=3> <HR></TD></TR> 13676<TR><TH><A NAME="rw_T"></A>T</TH><TD></TD><TD></TD></TR> 13677<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> 13678<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> 13679<TR><TD COLSPAN=3> <HR></TD></TR> 13680<TR><TH><A NAME="rw_U"></A>U</TH><TD></TD><TD></TD></TR> 13681<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> 13682<TR><TD COLSPAN=3> <HR></TD></TR> 13683<TR><TH><A NAME="rw_W"></A>W</TH><TD></TD><TD></TD></TR> 13684<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> 13685<TR><TD COLSPAN=3> <HR></TD></TR> 13686</TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A> 13687 13688<A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A> 13689 13690<A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A> 13691 13692<A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A> 13693 13694<A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A> 13695 13696<BR> 13697<A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A> 13698 13699<A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A> 13700 13701<A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A> 13702 13703<A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A> 13704 13705<A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A> 13706 13707<A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A> 13708 13709<A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A> 13710 13711<A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A> 13712 13713<A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A> 13714 13715</td></tr></table><br><P> 13716 13717<A NAME="Variable Index"></A> 13718<HR SIZE="6"> 13719<A NAME="SEC139"></A> 13720<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 13721<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> < </A>]</TD> 13722<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> > </A>]</TD> 13723<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 13724<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 13725<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> 13726<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 13727<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 13728<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 13729<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 13730</TR></TABLE> 13731<H1> Parameter and Variable Index </H1> 13732<!--docid::SEC139::--> 13733<table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A> 13734 13735<A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A> 13736 13737<A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A> 13738 13739<A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A> 13740 13741<A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A> 13742 13743<A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A> 13744 13745<A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A> 13746 13747<A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A> 13748 13749<A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A> 13750 13751<BR> 13752<A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A> 13753 13754<A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A> 13755 13756<A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A> 13757 13758<A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A> 13759 13760<A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A> 13761 13762<A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A> 13763 13764<A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A> 13765 13766<A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A> 13767 13768<A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A> 13769 13770<A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A> 13771 13772<A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A> 13773 13774<A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A> 13775 13776<A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A> 13777 13778<A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A> 13779 13780<A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A> 13781 13782<A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A> 13783 13784<A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A> 13785 13786<A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A> 13787 13788<A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A> 13789 13790</td></tr></table><br><P></P> 13791<TABLE border=0> 13792<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> 13793<TR><TD COLSPAN=3> <HR></TD></TR> 13794<TR><TH><A NAME="vr_!"></A>!</TH><TD></TD><TD></TD></TR> 13795<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX58"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13796<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX59"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13797<TR><TD COLSPAN=3> <HR></TD></TR> 13798<TR><TH><A NAME="vr_#"></A>#</TH><TD></TD><TD></TD></TR> 13799<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX50"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13800<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX51"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13801<TR><TD COLSPAN=3> <HR></TD></TR> 13802<TR><TH><A NAME="vr_$"></A>$</TH><TD></TD><TD></TD></TR> 13803<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX56"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13804<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX57"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13805<TR><TD COLSPAN=3> <HR></TD></TR> 13806<TR><TH><A NAME="vr_*"></A>*</TH><TD></TD><TD></TD></TR> 13807<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX46"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13808<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX47"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13809<TR><TD COLSPAN=3> <HR></TD></TR> 13810<TR><TH><A NAME="vr_-"></A>-</TH><TD></TD><TD></TD></TR> 13811<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX54"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13812<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX55"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13813<TR><TD COLSPAN=3> <HR></TD></TR> 13814<TR><TH><A NAME="vr_0"></A>0</TH><TD></TD><TD></TD></TR> 13815<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX60"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13816<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX61"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13817<TR><TD COLSPAN=3> <HR></TD></TR> 13818<TR><TH><A NAME="vr_?"></A>?</TH><TD></TD><TD></TD></TR> 13819<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX52"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13820<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX53"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13821<TR><TD COLSPAN=3> <HR></TD></TR> 13822<TR><TH><A NAME="vr_@"></A>@</TH><TD></TD><TD></TD></TR> 13823<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX48"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13824<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX49"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13825<TR><TD COLSPAN=3> <HR></TD></TR> 13826<TR><TH><A NAME="vr__"></A>_</TH><TD></TD><TD></TD></TR> 13827<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX62"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13828<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX63"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 13829<TR><TD COLSPAN=3> <HR></TD></TR> 13830<TR><TH><A NAME="vr_A"></A>A</TH><TD></TD><TD></TD></TR> 13831<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX282"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC90">7.3 Job Control Variables</A></TD></TR> 13832<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX283"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC90">7.3 Job Control Variables</A></TD></TR> 13833<TR><TD COLSPAN=3> <HR></TD></TR> 13834<TR><TH><A NAME="vr_B"></A>B</TH><TD></TD><TD></TD></TR> 13835<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX130"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13836<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX131"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13837<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX132"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13838<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX133"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13839<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX134"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13840<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX135"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13841<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX136"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13842<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX137"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13843<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX138"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13844<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX139"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13845<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX140"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13846<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX141"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13847<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX142"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13848<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX143"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13849<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX144"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13850<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX145"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13851<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX146"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13852<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX147"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13853<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX148"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13854<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX149"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13855<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX150"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13856<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX151"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13857<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX152"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13858<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX153"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13859<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX289"><CODE>bell-style</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13860<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX290"><CODE>bind-tty-special-chars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13861<TR><TD COLSPAN=3> <HR></TD></TR> 13862<TR><TH><A NAME="vr_C"></A>C</TH><TD></TD><TD></TD></TR> 13863<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX110"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13864<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX111"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13865<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX154"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13866<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX155"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13867<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX291"><CODE>comment-begin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13868<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX156"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13869<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX157"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13870<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX158"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13871<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX159"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13872<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX160"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13873<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX161"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13874<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX162"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13875<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX163"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13876<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX164"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13877<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX165"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13878<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX292"><CODE>completion-query-items</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13879<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX166"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13880<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX167"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13881<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX293"><CODE>convert-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13882<TR><TD COLSPAN=3> <HR></TD></TR> 13883<TR><TH><A NAME="vr_D"></A>D</TH><TD></TD><TD></TD></TR> 13884<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX168"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13885<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX169"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13886<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX294"><CODE>disable-completion</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13887<TR><TD COLSPAN=3> <HR></TD></TR> 13888<TR><TH><A NAME="vr_E"></A>E</TH><TD></TD><TD></TD></TR> 13889<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX295"><CODE>editing-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13890<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX170"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13891<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX171"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13892<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX296"><CODE>enable-keypad</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13893<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX172"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13894<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX173"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13895<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX297"><CODE>expand-tilde</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13896<TR><TD COLSPAN=3> <HR></TD></TR> 13897<TR><TH><A NAME="vr_F"></A>F</TH><TD></TD><TD></TD></TR> 13898<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX174"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13899<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX175"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13900<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX176"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13901<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX177"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13902<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX178"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13903<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX179"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13904<TR><TD COLSPAN=3> <HR></TD></TR> 13905<TR><TH><A NAME="vr_G"></A>G</TH><TD></TD><TD></TD></TR> 13906<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX180"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13907<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX181"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13908<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX182"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13909<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX183"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13910<TR><TD COLSPAN=3> <HR></TD></TR> 13911<TR><TH><A NAME="vr_H"></A>H</TH><TD></TD><TD></TD></TR> 13912<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX184"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13913<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX185"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13914<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX186"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13915<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX187"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13916<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX188"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13917<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX189"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13918<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX190"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13919<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX191"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13920<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX192"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13921<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX193"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13922<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX194"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13923<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX195"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13924<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX298"><CODE>history-preserve-point</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13925<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX196"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13926<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX197"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13927<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX198"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13928<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX199"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13929<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX112"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13930<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX113"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13931<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX299"><CODE>horizontal-scroll-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13932<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX200"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13933<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX201"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13934<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX202"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13935<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX203"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13936<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX204"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13937<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX205"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13938<TR><TD COLSPAN=3> <HR></TD></TR> 13939<TR><TH><A NAME="vr_I"></A>I</TH><TD></TD><TD></TD></TR> 13940<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX114"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13941<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX115"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13942<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX206"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13943<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX207"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13944<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX300"><CODE>input-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13945<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX208"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13946<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX209"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13947<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX302"><CODE>isearch-terminators</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13948<TR><TD COLSPAN=3> <HR></TD></TR> 13949<TR><TH><A NAME="vr_K"></A>K</TH><TD></TD><TD></TD></TR> 13950<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX303"><CODE>keymap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13951<TR><TD COLSPAN=3> <HR></TD></TR> 13952<TR><TH><A NAME="vr_L"></A>L</TH><TD></TD><TD></TD></TR> 13953<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX210"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13954<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX211"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13955<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX212"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13956<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX213"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13957<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX214"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13958<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX215"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13959<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX216"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13960<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX217"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13961<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> 13962<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX218"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13963<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX219"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13964<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX220"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13965<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX221"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13966<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX222"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13967<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX223"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13968<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX224"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13969<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX225"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13970<TR><TD COLSPAN=3> <HR></TD></TR> 13971<TR><TH><A NAME="vr_M"></A>M</TH><TD></TD><TD></TD></TR> 13972<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX226"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13973<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX227"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13974<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX116"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13975<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX117"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13976<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX228"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13977<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX229"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13978<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX118"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13979<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX119"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13980<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX304"><CODE>mark-modified-lines</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13981<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX305"><CODE>mark-symlinked-directories</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13982<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX306"><CODE>match-hidden-files</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13983<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX301"><CODE>meta-flag</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13984<TR><TD COLSPAN=3> <HR></TD></TR> 13985<TR><TH><A NAME="vr_O"></A>O</TH><TD></TD><TD></TD></TR> 13986<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX230"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13987<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX231"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13988<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX120"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13989<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX121"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13990<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX232"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13991<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX233"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13992<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX122"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13993<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX123"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 13994<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX234"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13995<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX235"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 13996<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX307"><CODE>output-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 13997<TR><TD COLSPAN=3> <HR></TD></TR> 13998<TR><TH><A NAME="vr_P"></A>P</TH><TD></TD><TD></TD></TR> 13999<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX308"><CODE>page-completions</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 14000<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX124"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 14001<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX125"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 14002<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX236"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14003<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX237"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14004<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX238"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14005<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX239"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14006<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX240"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14007<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX241"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14008<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX242"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14009<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX243"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14010<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX126"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 14011<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX127"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 14012<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX128"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 14013<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX129"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A></TD></TR> 14014<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX244"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14015<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX245"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14016<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX246"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14017<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX247"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14018<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX248"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14019<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX249"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14020<TR><TD COLSPAN=3> <HR></TD></TR> 14021<TR><TH><A NAME="vr_R"></A>R</TH><TD></TD><TD></TD></TR> 14022<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX250"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14023<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX251"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14024<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX252"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14025<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX253"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14026<TR><TD COLSPAN=3> <HR></TD></TR> 14027<TR><TH><A NAME="vr_S"></A>S</TH><TD></TD><TD></TD></TR> 14028<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX254"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14029<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX255"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14030<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX256"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14031<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX257"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14032<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX258"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14033<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX259"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14034<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX260"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14035<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX261"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14036<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX309"><CODE>show-all-if-ambiguous</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 14037<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX310"><CODE>show-all-if-unmodified</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 14038<TR><TD COLSPAN=3> <HR></TD></TR> 14039<TR><TH><A NAME="vr_T"></A>T</TH><TD></TD><TD></TD></TR> 14040<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> 14041<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> 14042<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX262"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14043<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX263"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14044<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX264"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14045<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX265"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14046<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX266"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14047<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX267"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14048<TR><TD COLSPAN=3> <HR></TD></TR> 14049<TR><TH><A NAME="vr_U"></A>U</TH><TD></TD><TD></TD></TR> 14050<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX268"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14051<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX269"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">5.2 Bash Variables</A></TD></TR> 14052<TR><TD COLSPAN=3> <HR></TD></TR> 14053<TR><TH><A NAME="vr_V"></A>V</TH><TD></TD><TD></TD></TR> 14054<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX311"><CODE>visible-stats</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 14055<TR><TD COLSPAN=3> <HR></TD></TR> 14056</TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A> 14057 14058<A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A> 14059 14060<A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A> 14061 14062<A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A> 14063 14064<A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A> 14065 14066<A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A> 14067 14068<A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A> 14069 14070<A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A> 14071 14072<A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A> 14073 14074<BR> 14075<A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A> 14076 14077<A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A> 14078 14079<A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A> 14080 14081<A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A> 14082 14083<A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A> 14084 14085<A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A> 14086 14087<A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A> 14088 14089<A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A> 14090 14091<A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A> 14092 14093<A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A> 14094 14095<A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A> 14096 14097<A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A> 14098 14099<A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A> 14100 14101<A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A> 14102 14103<A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A> 14104 14105<A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A> 14106 14107<A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A> 14108 14109<A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A> 14110 14111<A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A> 14112 14113</td></tr></table><br><P> 14114 14115<A NAME="Function Index"></A> 14116<HR SIZE="6"> 14117<A NAME="SEC140"></A> 14118<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 14119<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC139"> < </A>]</TD> 14120<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> > </A>]</TD> 14121<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 14122<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 14123<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> 14124<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 14125<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 14126<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 14127<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 14128</TR></TABLE> 14129<H1> Function Index </H1> 14130<!--docid::SEC140::--> 14131<table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A> 14132 14133<A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A> 14134 14135<A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A> 14136 14137<A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A> 14138 14139<A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A> 14140 14141<A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A> 14142 14143<A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A> 14144 14145<A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A> 14146 14147<A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A> 14148 14149<A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A> 14150 14151<A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A> 14152 14153<A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A> 14154 14155<A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A> 14156 14157<A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A> 14158 14159<A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A> 14160 14161<A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A> 14162 14163<A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A> 14164 14165<A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A> 14166 14167<A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A> 14168 14169<A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A> 14170 14171</td></tr></table><br><P></P> 14172<TABLE border=0> 14173<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> 14174<TR><TD COLSPAN=3> <HR></TD></TR> 14175<TR><TH><A NAME="fn_A"></A>A</TH><TD></TD><TD></TD></TR> 14176<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX452"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14177<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX453"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14178<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX328"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14179<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX329"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14180<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX494"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14181<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX495"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14182<TR><TD COLSPAN=3> <HR></TD></TR> 14183<TR><TH><A NAME="fn_B"></A>B</TH><TD></TD><TD></TD></TR> 14184<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX318"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14185<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX319"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14186<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX356"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14187<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX357"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14188<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX378"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14189<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX379"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14190<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX386"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14191<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX387"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14192<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX322"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14193<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX323"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14194<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX334"><CODE>beginning-of-history (M-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14195<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX335"><CODE>beginning-of-history (M-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14196<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX312"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14197<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX313"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14198<TR><TD COLSPAN=3> <HR></TD></TR> 14199<TR><TH><A NAME="fn_C"></A>C</TH><TD></TD><TD></TD></TR> 14200<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX448"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.7 Keyboard Macros</A></TD></TR> 14201<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX449"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.7 Keyboard Macros</A></TD></TR> 14202<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX372"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14203<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX373"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14204<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX468"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14205<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX469"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14206<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX470"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14207<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX471"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14208<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX324"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14209<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX325"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14210<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX410"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14211<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX411"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14212<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX436"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14213<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX437"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14214<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX420"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14215<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX421"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14216<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX432"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14217<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX433"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14218<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX442"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14219<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX443"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14220<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX424"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14221<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX425"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14222<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX428"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14223<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX429"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14224<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX398"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14225<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX399"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14226<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX400"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14227<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX401"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14228<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX396"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14229<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX397"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14230<TR><TD COLSPAN=3> <HR></TD></TR> 14231<TR><TH><A NAME="fn_D"></A>D</TH><TD></TD><TD></TD></TR> 14232<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX354"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14233<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX355"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14234<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX418"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14235<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX419"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14236<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX392"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14237<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX393"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14238<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX406"><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#SEC108">8.4.5 Specifying Numeric Arguments</A></TD></TR> 14239<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX407"><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#SEC108">8.4.5 Specifying Numeric Arguments</A></TD></TR> 14240<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX486"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14241<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX487"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14242<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX454"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14243<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX455"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14244<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX370"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14245<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX371"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14246<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX474"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14247<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX475"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14248<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX478"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14249<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX479"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14250<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX476"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14251<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX477"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14252<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX440"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14253<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX441"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14254<TR><TD COLSPAN=3> <HR></TD></TR> 14255<TR><TH><A NAME="fn_E"></A>E</TH><TD></TD><TD></TD></TR> 14256<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX502"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14257<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX503"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14258<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX446"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.7 Keyboard Macros</A></TD></TR> 14259<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX447"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.7 Keyboard Macros</A></TD></TR> 14260<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX336"><CODE>end-of-history (M-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14261<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX337"><CODE>end-of-history (M-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14262<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX314"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14263<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX315"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14264<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX466"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14265<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX467"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14266<TR><TD COLSPAN=3> <HR></TD></TR> 14267<TR><TH><A NAME="fn_F"></A>F</TH><TD></TD><TD></TD></TR> 14268<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX358"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14269<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX359"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14270<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX316"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14271<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX317"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14272<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX340"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14273<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX341"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14274<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX320"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14275<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX321"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14276<TR><TD COLSPAN=3> <HR></TD></TR> 14277<TR><TH><A NAME="fn_G"></A>G</TH><TD></TD><TD></TD></TR> 14278<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX480"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14279<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX481"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14280<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX482"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14281<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX483"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14282<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX484"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14283<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX485"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14284<TR><TD COLSPAN=3> <HR></TD></TR> 14285<TR><TH><A NAME="fn_H"></A>H</TH><TD></TD><TD></TD></TR> 14286<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX496"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14287<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX497"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14288<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX490"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14289<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX491"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14290<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX348"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14291<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX349"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14292<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX346"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14293<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX347"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14294<TR><TD COLSPAN=3> <HR></TD></TR> 14295<TR><TH><A NAME="fn_I"></A>I</TH><TD></TD><TD></TD></TR> 14296<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX472"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14297<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX473"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14298<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX414"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14299<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX415"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14300<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX498"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14301<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX499"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14302<TR><TD COLSPAN=3> <HR></TD></TR> 14303<TR><TH><A NAME="fn_K"></A>K</TH><TD></TD><TD></TD></TR> 14304<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX376"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14305<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX377"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14306<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX394"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14307<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX395"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14308<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX382"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14309<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX383"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14310<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX384"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14311<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX385"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14312<TR><TD COLSPAN=3> <HR></TD></TR> 14313<TR><TH><A NAME="fn_M"></A>M</TH><TD></TD><TD></TD></TR> 14314<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX492"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14315<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX493"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14316<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX416"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14317<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX417"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14318<TR><TD COLSPAN=3> <HR></TD></TR> 14319<TR><TH><A NAME="fn_N"></A>N</TH><TD></TD><TD></TD></TR> 14320<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX332"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14321<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX333"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14322<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX344"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14323<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX345"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14324<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX342"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14325<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX343"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14326<TR><TD COLSPAN=3> <HR></TD></TR> 14327<TR><TH><A NAME="fn_O"></A>O</TH><TD></TD><TD></TD></TR> 14328<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX500"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14329<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX501"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14330<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX374"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14331<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX375"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14332<TR><TD COLSPAN=3> <HR></TD></TR> 14333<TR><TH><A NAME="fn_P"></A>P</TH><TD></TD><TD></TD></TR> 14334<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX438"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14335<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX439"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14336<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX412"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14337<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX413"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14338<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX422"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14339<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX423"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14340<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX434"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14341<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX435"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14342<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX426"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14343<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX427"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14344<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX430"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14345<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX431"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A></TD></TR> 14346<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX456"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14347<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX457"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14348<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX330"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14349<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX331"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14350<TR><TD COLSPAN=3> <HR></TD></TR> 14351<TR><TH><A NAME="fn_Q"></A>Q</TH><TD></TD><TD></TD></TR> 14352<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX360"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14353<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX361"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14354<TR><TD COLSPAN=3> <HR></TD></TR> 14355<TR><TH><A NAME="fn_R"></A>R</TH><TD></TD><TD></TD></TR> 14356<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX450"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14357<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX451"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14358<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX326"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14359<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX327"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A></TD></TR> 14360<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX338"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14361<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX339"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14362<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX460"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14363<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX461"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14364<TR><TD COLSPAN=3> <HR></TD></TR> 14365<TR><TH><A NAME="fn_S"></A>S</TH><TD></TD><TD></TD></TR> 14366<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX362"><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14367<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX363"><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14368<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX464"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14369<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX465"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14370<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX488"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14371<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX489"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14372<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX444"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.7 Keyboard Macros</A></TD></TR> 14373<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX445"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.7 Keyboard Macros</A></TD></TR> 14374<TR><TD COLSPAN=3> <HR></TD></TR> 14375<TR><TH><A NAME="fn_T"></A>T</TH><TD></TD><TD></TD></TR> 14376<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX462"><CODE>tilde-expand (M-&#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14377<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX463"><CODE>tilde-expand (M-&#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14378<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX364"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14379<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX365"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14380<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX366"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14381<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX367"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14382<TR><TD COLSPAN=3> <HR></TD></TR> 14383<TR><TH><A NAME="fn_U"></A>U</TH><TD></TD><TD></TD></TR> 14384<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX458"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14385<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX459"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A></TD></TR> 14386<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX408"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.5 Specifying Numeric Arguments</A></TD></TR> 14387<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX409"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.5 Specifying Numeric Arguments</A></TD></TR> 14388<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX390"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14389<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX391"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14390<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX380"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14391<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX381"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14392<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX388"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14393<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX389"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14394<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX368"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14395<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX369"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A></TD></TR> 14396<TR><TD COLSPAN=3> <HR></TD></TR> 14397<TR><TH><A NAME="fn_Y"></A>Y</TH><TD></TD><TD></TD></TR> 14398<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX402"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14399<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX403"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14400<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX352"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14401<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX353"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14402<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX350"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14403<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX351"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A></TD></TR> 14404<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX404"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14405<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX405"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A></TD></TR> 14406<TR><TD COLSPAN=3> <HR></TD></TR> 14407</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> 14408 14409<A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A> 14410 14411<A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A> 14412 14413<A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A> 14414 14415<A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A> 14416 14417<A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A> 14418 14419<A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A> 14420 14421<A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A> 14422 14423<A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A> 14424 14425<A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A> 14426 14427<A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A> 14428 14429<A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A> 14430 14431<A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A> 14432 14433<A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A> 14434 14435<A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A> 14436 14437<A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A> 14438 14439<A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A> 14440 14441<A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A> 14442 14443<A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A> 14444 14445<A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A> 14446 14447</td></tr></table><br><P> 14448 14449<A NAME="Concept Index"></A> 14450<HR SIZE="6"> 14451<A NAME="SEC141"></A> 14452<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 14453<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> < </A>]</TD> 14454<TD VALIGN="MIDDLE" ALIGN="LEFT">[ > ]</TD> 14455<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD> 14456<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD> 14457<TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD> 14458<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 14459<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 14460<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 14461<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 14462</TR></TABLE> 14463<H1> Concept Index </H1> 14464<!--docid::SEC141::--> 14465<table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A> 14466 14467<A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A> 14468 14469<A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A> 14470 14471<A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A> 14472 14473<A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A> 14474 14475<A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A> 14476 14477<A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A> 14478 14479<A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A> 14480 14481<A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A> 14482 14483<A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A> 14484 14485<A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A> 14486 14487<A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A> 14488 14489<A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A> 14490 14491<A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A> 14492 14493<A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A> 14494 14495<A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A> 14496 14497<A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A> 14498 14499<A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A> 14500 14501<A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A> 14502 14503<A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A> 14504 14505<A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A> 14506 14507<A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A> 14508 14509</td></tr></table><br><P></P> 14510<TABLE border=0> 14511<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR> 14512<TR><TD COLSPAN=3> <HR></TD></TR> 14513<TR><TH><A NAME="cp_A"></A>A</TH><TD></TD><TD></TD></TR> 14514<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC80">alias expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC80">6.6 Aliases</A></TD></TR> 14515<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC79">arithmetic evaluation</A></TD><TD valign=top><A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A></TD></TR> 14516<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC32">arithmetic expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC32">3.5.5 Arithmetic Expansion</A></TD></TR> 14517<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC79">arithmetic, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A></TD></TR> 14518<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC81">arrays</A></TD><TD valign=top><A HREF="bashref.html#SEC81">6.7 Arrays</A></TD></TR> 14519<TR><TD COLSPAN=3> <HR></TD></TR> 14520<TR><TH><A NAME="cp_B"></A>B</TH><TD></TD><TD></TD></TR> 14521<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC88">background</A></TD><TD valign=top><A HREF="bashref.html#SEC88">7.1 Job Control Basics</A></TD></TR> 14522<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC123">Bash configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC123">10.1 Basic Installation</A></TD></TR> 14523<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC123">Bash installation</A></TD><TD valign=top><A HREF="bashref.html#SEC123">10.1 Basic Installation</A></TD></TR> 14524<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> 14525<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC28">brace expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.5.1 Brace Expansion</A></TD></TR> 14526<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> 14527<TR><TD COLSPAN=3> <HR></TD></TR> 14528<TR><TH><A NAME="cp_C"></A>C</TH><TD></TD><TD></TD></TR> 14529<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC94">command editing</A></TD><TD valign=top><A HREF="bashref.html#SEC94">8.2.1 Readline Bare Essentials</A></TD></TR> 14530<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC50">command execution</A></TD><TD valign=top><A HREF="bashref.html#SEC50">3.7.2 Command Search and Execution</A></TD></TR> 14531<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC49">command expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC49">3.7.1 Simple Command Expansion</A></TD></TR> 14532<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC116">command history</A></TD><TD valign=top><A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A></TD></TR> 14533<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC50">command search</A></TD><TD valign=top><A HREF="bashref.html#SEC50">3.7.2 Command Search and Execution</A></TD></TR> 14534<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC31">command substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC31">3.5.4 Command Substitution</A></TD></TR> 14535<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> 14536<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> 14537<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> 14538<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> 14539<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> 14540<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> 14541<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> 14542<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> 14543<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> 14544<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> 14545<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC114">completion builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.7 Programmable Completion Builtins</A></TD></TR> 14546<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC123">configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC123">10.1 Basic Installation</A></TD></TR> 14547<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> 14548<TR><TD COLSPAN=3> <HR></TD></TR> 14549<TR><TH><A NAME="cp_D"></A>D</TH><TD></TD><TD></TD></TR> 14550<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC82">directory stack</A></TD><TD valign=top><A HREF="bashref.html#SEC82">6.8 The Directory Stack</A></TD></TR> 14551<TR><TD COLSPAN=3> <HR></TD></TR> 14552<TR><TH><A NAME="cp_E"></A>E</TH><TD></TD><TD></TD></TR> 14553<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC94">editing command lines</A></TD><TD valign=top><A HREF="bashref.html#SEC94">8.2.1 Readline Bare Essentials</A></TD></TR> 14554<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC52">environment</A></TD><TD valign=top><A HREF="bashref.html#SEC52">3.7.4 Environment</A></TD></TR> 14555<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC79">evaluation, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A></TD></TR> 14556<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC119">event designators</A></TD><TD valign=top><A HREF="bashref.html#SEC119">9.3.1 Event Designators</A></TD></TR> 14557<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC51">execution environment</A></TD><TD valign=top><A HREF="bashref.html#SEC51">3.7.3 Command Execution Environment</A></TD></TR> 14558<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> 14559<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC53">exit status</A></TD><TD valign=top><A HREF="bashref.html#SEC53">3.7.5 Exit Status</A></TD></TR> 14560<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC27">expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.5 Shell Expansions</A></TD></TR> 14561<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC32">expansion, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC32">3.5.5 Arithmetic Expansion</A></TD></TR> 14562<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC28">expansion, brace</A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.5.1 Brace Expansion</A></TD></TR> 14563<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX64">expansion, filename</A></TD><TD valign=top><A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A></TD></TR> 14564<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">expansion, parameter</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A></TD></TR> 14565<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX65">expansion, pathname</A></TD><TD valign=top><A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A></TD></TR> 14566<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC29">expansion, tilde</A></TD><TD valign=top><A HREF="bashref.html#SEC29">3.5.2 Tilde Expansion</A></TD></TR> 14567<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC79">expressions, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A></TD></TR> 14568<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC78">expressions, conditional</A></TD><TD valign=top><A HREF="bashref.html#SEC78">6.4 Bash Conditional Expressions</A></TD></TR> 14569<TR><TD COLSPAN=3> <HR></TD></TR> 14570<TR><TH><A NAME="cp_F"></A>F</TH><TD></TD><TD></TD></TR> 14571<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX510">FDL, GNU Free Documentation License</A></TD><TD valign=top><A HREF="bashref.html#SEC135">C.1 GNU Free Documentation License</A></TD></TR> 14572<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> 14573<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> 14574<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX66">filename expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A></TD></TR> 14575<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC88">foreground</A></TD><TD valign=top><A HREF="bashref.html#SEC88">7.1 Job Control Basics</A></TD></TR> 14576<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC23">functions, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC23">3.3 Shell Functions</A></TD></TR> 14577<TR><TD COLSPAN=3> <HR></TD></TR> 14578<TR><TH><A NAME="cp_H"></A>H</TH><TD></TD><TD></TD></TR> 14579<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC117">history builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC117">9.2 Bash History Builtins</A></TD></TR> 14580<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX509">history events</A></TD><TD valign=top><A HREF="bashref.html#SEC119">9.3.1 Event Designators</A></TD></TR> 14581<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC118">history expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC118">9.3 History Expansion</A></TD></TR> 14582<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC116">history list</A></TD><TD valign=top><A HREF="bashref.html#SEC116">9.1 Bash History Facilities</A></TD></TR> 14583<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX506">History, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.7 Programmable Completion Builtins</A></TD></TR> 14584<TR><TD COLSPAN=3> <HR></TD></TR> 14585<TR><TH><A NAME="cp_I"></A>I</TH><TD></TD><TD></TD></TR> 14586<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> 14587<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC99">initialization file, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC99">8.3 Readline Init File</A></TD></TR> 14588<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC123">installation</A></TD><TD valign=top><A HREF="bashref.html#SEC123">10.1 Basic Installation</A></TD></TR> 14589<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC93">interaction, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC93">8.2 Readline Interaction</A></TD></TR> 14590<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX271">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC65">6.1 Invoking Bash</A></TD></TR> 14591<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC74">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC74">6.3 Interactive Shells</A></TD></TR> 14592<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> 14593<TR><TD COLSPAN=3> <HR></TD></TR> 14594<TR><TH><A NAME="cp_J"></A>J</TH><TD></TD><TD></TD></TR> 14595<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> 14596<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> 14597<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC88">job control</A></TD><TD valign=top><A HREF="bashref.html#SEC88">7.1 Job Control Basics</A></TD></TR> 14598<TR><TD COLSPAN=3> <HR></TD></TR> 14599<TR><TH><A NAME="cp_K"></A>K</TH><TD></TD><TD></TD></TR> 14600<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX287">kill ring</A></TD><TD valign=top><A HREF="bashref.html#SEC96">8.2.3 Readline Killing Commands</A></TD></TR> 14601<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX285">killing text</A></TD><TD valign=top><A HREF="bashref.html#SEC96">8.2.3 Readline Killing Commands</A></TD></TR> 14602<TR><TD COLSPAN=3> <HR></TD></TR> 14603<TR><TH><A NAME="cp_L"></A>L</TH><TD></TD><TD></TD></TR> 14604<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> 14605<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX270">login shell</A></TD><TD valign=top><A HREF="bashref.html#SEC65">6.1 Invoking Bash</A></TD></TR> 14606<TR><TD COLSPAN=3> <HR></TD></TR> 14607<TR><TH><A NAME="cp_M"></A>M</TH><TD></TD><TD></TD></TR> 14608<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC36">matching, pattern</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8.1 Pattern Matching</A></TD></TR> 14609<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> 14610<TR><TD COLSPAN=3> <HR></TD></TR> 14611<TR><TH><A NAME="cp_N"></A>N</TH><TD></TD><TD></TD></TR> 14612<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> 14613<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> 14614<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC94">notation, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC94">8.2.1 Readline Bare Essentials</A></TD></TR> 14615<TR><TD COLSPAN=3> <HR></TD></TR> 14616<TR><TH><A NAME="cp_O"></A>O</TH><TD></TD><TD></TD></TR> 14617<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> 14618<TR><TD COLSPAN=3> <HR></TD></TR> 14619<TR><TH><A NAME="cp_P"></A>P</TH><TD></TD><TD></TD></TR> 14620<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">parameter expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A></TD></TR> 14621<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC24">parameters</A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.4 Shell Parameters</A></TD></TR> 14622<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">parameters, positional</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4.1 Positional Parameters</A></TD></TR> 14623<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC26">parameters, special</A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.2 Special Parameters</A></TD></TR> 14624<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX67">pathname expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A></TD></TR> 14625<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC36">pattern matching</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8.1 Pattern Matching</A></TD></TR> 14626<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> 14627<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> 14628<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC86">POSIX Mode</A></TD><TD valign=top><A HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A></TD></TR> 14629<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> 14630<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> 14631<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC33">process substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC33">3.5.6 Process Substitution</A></TD></TR> 14632<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC113">programmable completion</A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.6 Programmable Completion</A></TD></TR> 14633<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC84">prompting</A></TD><TD valign=top><A HREF="bashref.html#SEC84">6.9 Controlling the Prompt</A></TD></TR> 14634<TR><TD COLSPAN=3> <HR></TD></TR> 14635<TR><TH><A NAME="cp_Q"></A>Q</TH><TD></TD><TD></TD></TR> 14636<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> 14637<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> 14638<TR><TD COLSPAN=3> <HR></TD></TR> 14639<TR><TH><A NAME="cp_R"></A>R</TH><TD></TD><TD></TD></TR> 14640<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX284">Readline, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC90">7.3 Job Control Variables</A></TD></TR> 14641<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC38">redirection</A></TD><TD valign=top><A HREF="bashref.html#SEC38">3.6 Redirections</A></TD></TR> 14642<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> 14643<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC85">restricted shell</A></TD><TD valign=top><A HREF="bashref.html#SEC85">6.10 The Restricted Shell</A></TD></TR> 14644<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> 14645<TR><TD COLSPAN=3> <HR></TD></TR> 14646<TR><TH><A NAME="cp_S"></A>S</TH><TD></TD><TD></TD></TR> 14647<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC79">shell arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A></TD></TR> 14648<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC23">shell function</A></TD><TD valign=top><A HREF="bashref.html#SEC23">3.3 Shell Functions</A></TD></TR> 14649<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC55">shell script</A></TD><TD valign=top><A HREF="bashref.html#SEC55">3.8 Shell Scripts</A></TD></TR> 14650<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC24">shell variable</A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.4 Shell Parameters</A></TD></TR> 14651<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC74">shell, interactive</A></TD><TD valign=top><A HREF="bashref.html#SEC74">6.3 Interactive Shells</A></TD></TR> 14652<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> 14653<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC54">signal handling</A></TD><TD valign=top><A HREF="bashref.html#SEC54">3.7.6 Signals</A></TD></TR> 14654<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> 14655<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC60">special builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.4 Special Builtins</A></TD></TR> 14656<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC66">startup files</A></TD><TD valign=top><A HREF="bashref.html#SEC66">6.2 Bash Startup Files</A></TD></TR> 14657<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC88">suspending jobs</A></TD><TD valign=top><A HREF="bashref.html#SEC88">7.1 Job Control Basics</A></TD></TR> 14658<TR><TD COLSPAN=3> <HR></TD></TR> 14659<TR><TH><A NAME="cp_T"></A>T</TH><TD></TD><TD></TD></TR> 14660<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC29">tilde expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC29">3.5.2 Tilde Expansion</A></TD></TR> 14661<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> 14662<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> 14663<TR><TD COLSPAN=3> <HR></TD></TR> 14664<TR><TH><A NAME="cp_V"></A>V</TH><TD></TD><TD></TD></TR> 14665<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC24">variable, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.4 Shell Parameters</A></TD></TR> 14666<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX288">variables, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A></TD></TR> 14667<TR><TD COLSPAN=3> <HR></TD></TR> 14668<TR><TH><A NAME="cp_W"></A>W</TH><TD></TD><TD></TD></TR> 14669<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> 14670<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC34">word splitting</A></TD><TD valign=top><A HREF="bashref.html#SEC34">3.5.7 Word Splitting</A></TD></TR> 14671<TR><TD COLSPAN=3> <HR></TD></TR> 14672<TR><TH><A NAME="cp_Y"></A>Y</TH><TD></TD><TD></TD></TR> 14673<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX286">yanking text</A></TD><TD valign=top><A HREF="bashref.html#SEC96">8.2.3 Readline Killing Commands</A></TD></TR> 14674<TR><TD COLSPAN=3> <HR></TD></TR> 14675</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> 14676 14677<A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A> 14678 14679<A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A> 14680 14681<A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A> 14682 14683<A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A> 14684 14685<A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A> 14686 14687<A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A> 14688 14689<A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A> 14690 14691<A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A> 14692 14693<A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A> 14694 14695<A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A> 14696 14697<A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A> 14698 14699<A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A> 14700 14701<A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A> 14702 14703<A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A> 14704 14705<A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A> 14706 14707<A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A> 14708 14709<A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A> 14710 14711<A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A> 14712 14713<A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A> 14714 14715<A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A> 14716 14717<A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A> 14718 14719</td></tr></table><br><P> 14720 14721<HR SIZE="6"> 14722<A NAME="SEC_Contents"></A> 14723<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 14724<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 14725<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 14726<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 14727<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 14728</TR></TABLE> 14729<H1>Table of Contents</H1> 14730<UL> 14731<A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A> 14732<BR> 14733<UL> 14734<A NAME="TOC2" HREF="bashref.html#SEC2">1.1 What is Bash?</A> 14735<BR> 14736<A NAME="TOC3" HREF="bashref.html#SEC3">1.2 What is a shell?</A> 14737<BR> 14738</UL> 14739<A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A> 14740<BR> 14741<A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A> 14742<BR> 14743<UL> 14744<A NAME="TOC6" HREF="bashref.html#SEC6">3.1 Shell Syntax</A> 14745<BR> 14746<UL> 14747<A NAME="TOC7" HREF="bashref.html#SEC7">3.1.1 Shell Operation</A> 14748<BR> 14749<A NAME="TOC8" HREF="bashref.html#SEC8">3.1.2 Quoting</A> 14750<BR> 14751<UL> 14752<A NAME="TOC9" HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A> 14753<BR> 14754<A NAME="TOC10" HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A> 14755<BR> 14756<A NAME="TOC11" HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A> 14757<BR> 14758<A NAME="TOC12" HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A> 14759<BR> 14760<A NAME="TOC13" HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A> 14761<BR> 14762</UL> 14763<A NAME="TOC14" HREF="bashref.html#SEC14">3.1.3 Comments</A> 14764<BR> 14765</UL> 14766<A NAME="TOC15" HREF="bashref.html#SEC15">3.2 Shell Commands</A> 14767<BR> 14768<UL> 14769<A NAME="TOC16" HREF="bashref.html#SEC16">3.2.1 Simple Commands</A> 14770<BR> 14771<A NAME="TOC17" HREF="bashref.html#SEC17">3.2.2 Pipelines</A> 14772<BR> 14773<A NAME="TOC18" HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A> 14774<BR> 14775<A NAME="TOC19" HREF="bashref.html#SEC19">3.2.4 Compound Commands</A> 14776<BR> 14777<UL> 14778<A NAME="TOC20" HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A> 14779<BR> 14780<A NAME="TOC21" HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A> 14781<BR> 14782<A NAME="TOC22" HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A> 14783<BR> 14784</UL> 14785</UL> 14786<A NAME="TOC23" HREF="bashref.html#SEC23">3.3 Shell Functions</A> 14787<BR> 14788<A NAME="TOC24" HREF="bashref.html#SEC24">3.4 Shell Parameters</A> 14789<BR> 14790<UL> 14791<A NAME="TOC25" HREF="bashref.html#SEC25">3.4.1 Positional Parameters</A> 14792<BR> 14793<A NAME="TOC26" HREF="bashref.html#SEC26">3.4.2 Special Parameters</A> 14794<BR> 14795</UL> 14796<A NAME="TOC27" HREF="bashref.html#SEC27">3.5 Shell Expansions</A> 14797<BR> 14798<UL> 14799<A NAME="TOC28" HREF="bashref.html#SEC28">3.5.1 Brace Expansion</A> 14800<BR> 14801<A NAME="TOC29" HREF="bashref.html#SEC29">3.5.2 Tilde Expansion</A> 14802<BR> 14803<A NAME="TOC30" HREF="bashref.html#SEC30">3.5.3 Shell Parameter Expansion</A> 14804<BR> 14805<A NAME="TOC31" HREF="bashref.html#SEC31">3.5.4 Command Substitution</A> 14806<BR> 14807<A NAME="TOC32" HREF="bashref.html#SEC32">3.5.5 Arithmetic Expansion</A> 14808<BR> 14809<A NAME="TOC33" HREF="bashref.html#SEC33">3.5.6 Process Substitution</A> 14810<BR> 14811<A NAME="TOC34" HREF="bashref.html#SEC34">3.5.7 Word Splitting</A> 14812<BR> 14813<A NAME="TOC35" HREF="bashref.html#SEC35">3.5.8 Filename Expansion</A> 14814<BR> 14815<UL> 14816<A NAME="TOC36" HREF="bashref.html#SEC36">3.5.8.1 Pattern Matching</A> 14817<BR> 14818</UL> 14819<A NAME="TOC37" HREF="bashref.html#SEC37">3.5.9 Quote Removal</A> 14820<BR> 14821</UL> 14822<A NAME="TOC38" HREF="bashref.html#SEC38">3.6 Redirections</A> 14823<BR> 14824<UL> 14825<A NAME="TOC39" HREF="bashref.html#SEC39">3.6.1 Redirecting Input</A> 14826<BR> 14827<A NAME="TOC40" HREF="bashref.html#SEC40">3.6.2 Redirecting Output</A> 14828<BR> 14829<A NAME="TOC41" HREF="bashref.html#SEC41">3.6.3 Appending Redirected Output</A> 14830<BR> 14831<A NAME="TOC42" HREF="bashref.html#SEC42">3.6.4 Redirecting Standard Output and Standard Error</A> 14832<BR> 14833<A NAME="TOC43" HREF="bashref.html#SEC43">3.6.5 Here Documents</A> 14834<BR> 14835<A NAME="TOC44" HREF="bashref.html#SEC44">3.6.6 Here Strings</A> 14836<BR> 14837<A NAME="TOC45" HREF="bashref.html#SEC45">3.6.7 Duplicating File Descriptors</A> 14838<BR> 14839<A NAME="TOC46" HREF="bashref.html#SEC46">3.6.8 Moving File Descriptors</A> 14840<BR> 14841<A NAME="TOC47" HREF="bashref.html#SEC47">3.6.9 Opening File Descriptors for Reading and Writing</A> 14842<BR> 14843</UL> 14844<A NAME="TOC48" HREF="bashref.html#SEC48">3.7 Executing Commands</A> 14845<BR> 14846<UL> 14847<A NAME="TOC49" HREF="bashref.html#SEC49">3.7.1 Simple Command Expansion</A> 14848<BR> 14849<A NAME="TOC50" HREF="bashref.html#SEC50">3.7.2 Command Search and Execution</A> 14850<BR> 14851<A NAME="TOC51" HREF="bashref.html#SEC51">3.7.3 Command Execution Environment</A> 14852<BR> 14853<A NAME="TOC52" HREF="bashref.html#SEC52">3.7.4 Environment</A> 14854<BR> 14855<A NAME="TOC53" HREF="bashref.html#SEC53">3.7.5 Exit Status</A> 14856<BR> 14857<A NAME="TOC54" HREF="bashref.html#SEC54">3.7.6 Signals</A> 14858<BR> 14859</UL> 14860<A NAME="TOC55" HREF="bashref.html#SEC55">3.8 Shell Scripts</A> 14861<BR> 14862</UL> 14863<A NAME="TOC56" HREF="bashref.html#SEC56">4. Shell Builtin Commands</A> 14864<BR> 14865<UL> 14866<A NAME="TOC57" HREF="bashref.html#SEC57">4.1 Bourne Shell Builtins</A> 14867<BR> 14868<A NAME="TOC58" HREF="bashref.html#SEC58">4.2 Bash Builtin Commands</A> 14869<BR> 14870<A NAME="TOC59" HREF="bashref.html#SEC59">4.3 The Set Builtin</A> 14871<BR> 14872<A NAME="TOC60" HREF="bashref.html#SEC60">4.4 Special Builtins</A> 14873<BR> 14874</UL> 14875<A NAME="TOC61" HREF="bashref.html#SEC61">5. Shell Variables</A> 14876<BR> 14877<UL> 14878<A NAME="TOC62" HREF="bashref.html#SEC62">5.1 Bourne Shell Variables</A> 14879<BR> 14880<A NAME="TOC63" HREF="bashref.html#SEC63">5.2 Bash Variables</A> 14881<BR> 14882</UL> 14883<A NAME="TOC64" HREF="bashref.html#SEC64">6. Bash Features</A> 14884<BR> 14885<UL> 14886<A NAME="TOC65" HREF="bashref.html#SEC65">6.1 Invoking Bash</A> 14887<BR> 14888<A NAME="TOC66" HREF="bashref.html#SEC66">6.2 Bash Startup Files</A> 14889<BR> 14890<A NAME="TOC74" HREF="bashref.html#SEC74">6.3 Interactive Shells</A> 14891<BR> 14892<UL> 14893<A NAME="TOC75" HREF="bashref.html#SEC75">6.3.1 What is an Interactive Shell?</A> 14894<BR> 14895<A NAME="TOC76" HREF="bashref.html#SEC76">6.3.2 Is this Shell Interactive?</A> 14896<BR> 14897<A NAME="TOC77" HREF="bashref.html#SEC77">6.3.3 Interactive Shell Behavior</A> 14898<BR> 14899</UL> 14900<A NAME="TOC78" HREF="bashref.html#SEC78">6.4 Bash Conditional Expressions</A> 14901<BR> 14902<A NAME="TOC79" HREF="bashref.html#SEC79">6.5 Shell Arithmetic</A> 14903<BR> 14904<A NAME="TOC80" HREF="bashref.html#SEC80">6.6 Aliases</A> 14905<BR> 14906<A NAME="TOC81" HREF="bashref.html#SEC81">6.7 Arrays</A> 14907<BR> 14908<A NAME="TOC82" HREF="bashref.html#SEC82">6.8 The Directory Stack</A> 14909<BR> 14910<UL> 14911<A NAME="TOC83" HREF="bashref.html#SEC83">6.8.1 Directory Stack Builtins</A> 14912<BR> 14913</UL> 14914<A NAME="TOC84" HREF="bashref.html#SEC84">6.9 Controlling the Prompt</A> 14915<BR> 14916<A NAME="TOC85" HREF="bashref.html#SEC85">6.10 The Restricted Shell</A> 14917<BR> 14918<A NAME="TOC86" HREF="bashref.html#SEC86">6.11 Bash POSIX Mode</A> 14919<BR> 14920</UL> 14921<A NAME="TOC87" HREF="bashref.html#SEC87">7. Job Control</A> 14922<BR> 14923<UL> 14924<A NAME="TOC88" HREF="bashref.html#SEC88">7.1 Job Control Basics</A> 14925<BR> 14926<A NAME="TOC89" HREF="bashref.html#SEC89">7.2 Job Control Builtins</A> 14927<BR> 14928<A NAME="TOC90" HREF="bashref.html#SEC90">7.3 Job Control Variables</A> 14929<BR> 14930</UL> 14931<A NAME="TOC91" HREF="bashref.html#SEC91">8. Command Line Editing</A> 14932<BR> 14933<UL> 14934<A NAME="TOC92" HREF="bashref.html#SEC92">8.1 Introduction to Line Editing</A> 14935<BR> 14936<A NAME="TOC93" HREF="bashref.html#SEC93">8.2 Readline Interaction</A> 14937<BR> 14938<UL> 14939<A NAME="TOC94" HREF="bashref.html#SEC94">8.2.1 Readline Bare Essentials</A> 14940<BR> 14941<A NAME="TOC95" HREF="bashref.html#SEC95">8.2.2 Readline Movement Commands</A> 14942<BR> 14943<A NAME="TOC96" HREF="bashref.html#SEC96">8.2.3 Readline Killing Commands</A> 14944<BR> 14945<A NAME="TOC97" HREF="bashref.html#SEC97">8.2.4 Readline Arguments</A> 14946<BR> 14947<A NAME="TOC98" HREF="bashref.html#SEC98">8.2.5 Searching for Commands in the History</A> 14948<BR> 14949</UL> 14950<A NAME="TOC99" HREF="bashref.html#SEC99">8.3 Readline Init File</A> 14951<BR> 14952<UL> 14953<A NAME="TOC100" HREF="bashref.html#SEC100">8.3.1 Readline Init File Syntax</A> 14954<BR> 14955<A NAME="TOC101" HREF="bashref.html#SEC101">8.3.2 Conditional Init Constructs</A> 14956<BR> 14957<A NAME="TOC102" HREF="bashref.html#SEC102">8.3.3 Sample Init File</A> 14958<BR> 14959</UL> 14960<A NAME="TOC103" HREF="bashref.html#SEC103">8.4 Bindable Readline Commands</A> 14961<BR> 14962<UL> 14963<A NAME="TOC104" HREF="bashref.html#SEC104">8.4.1 Commands For Moving</A> 14964<BR> 14965<A NAME="TOC105" HREF="bashref.html#SEC105">8.4.2 Commands For Manipulating The History</A> 14966<BR> 14967<A NAME="TOC106" HREF="bashref.html#SEC106">8.4.3 Commands For Changing Text</A> 14968<BR> 14969<A NAME="TOC107" HREF="bashref.html#SEC107">8.4.4 Killing And Yanking</A> 14970<BR> 14971<A NAME="TOC108" HREF="bashref.html#SEC108">8.4.5 Specifying Numeric Arguments</A> 14972<BR> 14973<A NAME="TOC109" HREF="bashref.html#SEC109">8.4.6 Letting Readline Type For You</A> 14974<BR> 14975<A NAME="TOC110" HREF="bashref.html#SEC110">8.4.7 Keyboard Macros</A> 14976<BR> 14977<A NAME="TOC111" HREF="bashref.html#SEC111">8.4.8 Some Miscellaneous Commands</A> 14978<BR> 14979</UL> 14980<A NAME="TOC112" HREF="bashref.html#SEC112">8.5 Readline vi Mode</A> 14981<BR> 14982<A NAME="TOC113" HREF="bashref.html#SEC113">8.6 Programmable Completion</A> 14983<BR> 14984<A NAME="TOC114" HREF="bashref.html#SEC114">8.7 Programmable Completion Builtins</A> 14985<BR> 14986</UL> 14987<A NAME="TOC115" HREF="bashref.html#SEC115">9. Using History Interactively</A> 14988<BR> 14989<UL> 14990<A NAME="TOC116" HREF="bashref.html#SEC116">9.1 Bash History Facilities</A> 14991<BR> 14992<A NAME="TOC117" HREF="bashref.html#SEC117">9.2 Bash History Builtins</A> 14993<BR> 14994<A NAME="TOC118" HREF="bashref.html#SEC118">9.3 History Expansion</A> 14995<BR> 14996<UL> 14997<A NAME="TOC119" HREF="bashref.html#SEC119">9.3.1 Event Designators</A> 14998<BR> 14999<A NAME="TOC120" HREF="bashref.html#SEC120">9.3.2 Word Designators</A> 15000<BR> 15001<A NAME="TOC121" HREF="bashref.html#SEC121">9.3.3 Modifiers</A> 15002<BR> 15003</UL> 15004</UL> 15005<A NAME="TOC122" HREF="bashref.html#SEC122">10. Installing Bash</A> 15006<BR> 15007<UL> 15008<A NAME="TOC123" HREF="bashref.html#SEC123">10.1 Basic Installation</A> 15009<BR> 15010<A NAME="TOC124" HREF="bashref.html#SEC124">10.2 Compilers and Options</A> 15011<BR> 15012<A NAME="TOC125" HREF="bashref.html#SEC125">10.3 Compiling For Multiple Architectures</A> 15013<BR> 15014<A NAME="TOC126" HREF="bashref.html#SEC126">10.4 Installation Names</A> 15015<BR> 15016<A NAME="TOC127" HREF="bashref.html#SEC127">10.5 Specifying the System Type</A> 15017<BR> 15018<A NAME="TOC128" HREF="bashref.html#SEC128">10.6 Sharing Defaults</A> 15019<BR> 15020<A NAME="TOC129" HREF="bashref.html#SEC129">10.7 Operation Controls</A> 15021<BR> 15022<A NAME="TOC130" HREF="bashref.html#SEC130">10.8 Optional Features</A> 15023<BR> 15024</UL> 15025<A NAME="TOC131" HREF="bashref.html#SEC131">A. Reporting Bugs</A> 15026<BR> 15027<A NAME="TOC132" HREF="bashref.html#SEC132">B. Major Differences From The Bourne Shell</A> 15028<BR> 15029<UL> 15030<A NAME="TOC133" HREF="bashref.html#SEC133">B.1 Implementation Differences From The SVR4.2 Shell</A> 15031<BR> 15032</UL> 15033<A NAME="TOC134" HREF="bashref.html#SEC134">C. Copying This Manual</A> 15034<BR> 15035<UL> 15036<A NAME="TOC135" HREF="bashref.html#SEC135">C.1 GNU Free Documentation License</A> 15037<BR> 15038<UL> 15039<A NAME="TOC136" HREF="bashref.html#SEC136">C.1.1 ADDENDUM: How to use this License for your documents</A> 15040<BR> 15041</UL> 15042</UL> 15043<A NAME="TOC137" HREF="bashref.html#SEC137">Index of Shell Builtin Commands</A> 15044<BR> 15045<A NAME="TOC138" HREF="bashref.html#SEC138">Index of Shell Reserved Words</A> 15046<BR> 15047<A NAME="TOC139" HREF="bashref.html#SEC139">Parameter and Variable Index</A> 15048<BR> 15049<A NAME="TOC140" HREF="bashref.html#SEC140">Function Index</A> 15050<BR> 15051<A NAME="TOC141" HREF="bashref.html#SEC141">Concept Index</A> 15052<BR> 15053</UL> 15054<HR SIZE=1> 15055<A NAME="SEC_OVERVIEW"></A> 15056<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 15057<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 15058<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 15059<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 15060<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 15061</TR></TABLE> 15062<H1>Short Table of Contents</H1> 15063<BLOCKQUOTE> 15064<A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A> 15065<BR> 15066<A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A> 15067<BR> 15068<A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A> 15069<BR> 15070<A NAME="TOC56" HREF="bashref.html#SEC56">4. Shell Builtin Commands</A> 15071<BR> 15072<A NAME="TOC61" HREF="bashref.html#SEC61">5. Shell Variables</A> 15073<BR> 15074<A NAME="TOC64" HREF="bashref.html#SEC64">6. Bash Features</A> 15075<BR> 15076<A NAME="TOC87" HREF="bashref.html#SEC87">7. Job Control</A> 15077<BR> 15078<A NAME="TOC91" HREF="bashref.html#SEC91">8. Command Line Editing</A> 15079<BR> 15080<A NAME="TOC115" HREF="bashref.html#SEC115">9. Using History Interactively</A> 15081<BR> 15082<A NAME="TOC122" HREF="bashref.html#SEC122">10. Installing Bash</A> 15083<BR> 15084<A NAME="TOC131" HREF="bashref.html#SEC131">A. Reporting Bugs</A> 15085<BR> 15086<A NAME="TOC132" HREF="bashref.html#SEC132">B. Major Differences From The Bourne Shell</A> 15087<BR> 15088<A NAME="TOC134" HREF="bashref.html#SEC134">C. Copying This Manual</A> 15089<BR> 15090<A NAME="TOC137" HREF="bashref.html#SEC137">Index of Shell Builtin Commands</A> 15091<BR> 15092<A NAME="TOC138" HREF="bashref.html#SEC138">Index of Shell Reserved Words</A> 15093<BR> 15094<A NAME="TOC139" HREF="bashref.html#SEC139">Parameter and Variable Index</A> 15095<BR> 15096<A NAME="TOC140" HREF="bashref.html#SEC140">Function Index</A> 15097<BR> 15098<A NAME="TOC141" HREF="bashref.html#SEC141">Concept Index</A> 15099<BR> 15100 15101</BLOCKQUOTE> 15102<HR SIZE=1> 15103<A NAME="SEC_About"></A> 15104<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> 15105<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD> 15106<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD> 15107<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> 15108<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD> 15109</TR></TABLE> 15110<H1>About this document</H1> 15111This document was generated by <I>Chet Ramey</I> on <I>October, 3 2005</I> 15112using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html 15113"><I>texi2html</I></A> 15114<P></P> 15115The buttons in the navigation panels have the following meaning: 15116<P></P> 15117<table border = "1"> 15118<TR> 15119<TH> Button </TH> 15120<TH> Name </TH> 15121<TH> Go to </TH> 15122<TH> From 1.2.3 go to</TH> 15123</TR> 15124<TR> 15125<TD ALIGN="CENTER"> 15126 [ < ] </TD> 15127<TD ALIGN="CENTER"> 15128Back 15129</TD> 15130<TD> 15131previous section in reading order 15132</TD> 15133<TD> 151341.2.2 15135</TD> 15136</TR> 15137<TR> 15138<TD ALIGN="CENTER"> 15139 [ > ] </TD> 15140<TD ALIGN="CENTER"> 15141Forward 15142</TD> 15143<TD> 15144next section in reading order 15145</TD> 15146<TD> 151471.2.4 15148</TD> 15149</TR> 15150<TR> 15151<TD ALIGN="CENTER"> 15152 [ << ] </TD> 15153<TD ALIGN="CENTER"> 15154FastBack 15155</TD> 15156<TD> 15157previous or up-and-previous section 15158</TD> 15159<TD> 151601.1 15161</TD> 15162</TR> 15163<TR> 15164<TD ALIGN="CENTER"> 15165 [ Up ] </TD> 15166<TD ALIGN="CENTER"> 15167Up 15168</TD> 15169<TD> 15170up section 15171</TD> 15172<TD> 151731.2 15174</TD> 15175</TR> 15176<TR> 15177<TD ALIGN="CENTER"> 15178 [ >> ] </TD> 15179<TD ALIGN="CENTER"> 15180FastForward 15181</TD> 15182<TD> 15183next or up-and-next section 15184</TD> 15185<TD> 151861.3 15187</TD> 15188</TR> 15189<TR> 15190<TD ALIGN="CENTER"> 15191 [Top] </TD> 15192<TD ALIGN="CENTER"> 15193Top 15194</TD> 15195<TD> 15196cover (top) of document 15197</TD> 15198<TD> 15199 15200</TD> 15201</TR> 15202<TR> 15203<TD ALIGN="CENTER"> 15204 [Contents] </TD> 15205<TD ALIGN="CENTER"> 15206Contents 15207</TD> 15208<TD> 15209table of contents 15210</TD> 15211<TD> 15212 15213</TD> 15214</TR> 15215<TR> 15216<TD ALIGN="CENTER"> 15217 [Index] </TD> 15218<TD ALIGN="CENTER"> 15219Index 15220</TD> 15221<TD> 15222concept index 15223</TD> 15224<TD> 15225 15226</TD> 15227</TR> 15228<TR> 15229<TD ALIGN="CENTER"> 15230 [ ? ] </TD> 15231<TD ALIGN="CENTER"> 15232About 15233</TD> 15234<TD> 15235this page 15236</TD> 15237<TD> 15238 15239</TD> 15240</TR> 15241</TABLE> 15242<P></P> 15243where the <STRONG> Example </STRONG> assumes that the current position 15244is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of 15245the following structure: 15246<UL> 15247<LI> 1. Section One </LI> 15248<UL> 15249<LI>1.1 Subsection One-One</LI> 15250<UL> 15251<LI> ... </LI> 15252</UL> 15253<LI>1.2 Subsection One-Two</LI> 15254<UL> 15255<LI>1.2.1 Subsubsection One-Two-One 15256</LI><LI>1.2.2 Subsubsection One-Two-Two 15257</LI><LI>1.2.3 Subsubsection One-Two-Three <STRONG> 15258<== Current Position </STRONG> 15259</LI><LI>1.2.4 Subsubsection One-Two-Four 15260</LI></UL> 15261<LI>1.3 Subsection One-Three</LI> 15262<UL> 15263<LI> ... </LI> 15264</UL> 15265<LI>1.4 Subsection One-Four</LI> 15266</UL> 15267</UL> 15268 15269<HR SIZE=1> 15270<BR> 15271<FONT SIZE="-1"> 15272This document was generated 15273by <I>Chet Ramey</I> on <I>October, 3 2005</I> 15274using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html 15275"><I>texi2html</I></A> 15276 15277</BODY> 15278</HTML> 15279