ch00_13.htm:(who wrote <a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a> and <a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a> in the early 1980s, by the way) led the first
ch01_01.htm:Window System</b> (<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>), and
ch01_02.htm:enough, saving them for later execution in a <b class="emphasis-bold">file</b> (<a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>), <b class="emphasis-bold">alias</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>), or
ch01_02.htm:<b class="emphasis-bold">function</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>). Gradually, if the user has the right
ch01_02.htm:(<a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a>) to apply the same editing script to a
ch01_03.htm:worked with a Unix box that doesn't have <b class="emphasis-bold">vi</b> (<a href="ch21_07.htm#upt3-CHP-21-SECT-7">Section 21.7</a>) installed.
ch01_03.htm:(<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>) or getting additional help with
ch01_03.htm:<b class="emphasis-bold">man</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>).
ch01_03.htm:utility such as <b class="emphasis-bold">make</b> (<a href="ch40_03.htm#upt3-CHP-40-SECT-3">Section 40.3</a>) and another installation has a GNU version of
ch01_04.htm:the <b class="emphasis-bold">shell</b> (<a href="ch27_01.htm#upt3-CHP-27-SECT-1">Section 27.1</a>). A shell is a <em class="emphasis">command
ch01_04.htm:(<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>).
ch01_04.htm:kernel</b> (<a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>). Usually, only
ch01_04.htm:<p><tt class="literal">???</tt> <a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a></p>
ch01_04.htm:filenames, makes a complete list of them, and calls the <b class="emphasis-bold">cat</b> (<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>) command to
ch01_04.htm:<p>Why is this important? First of all, you can choose between <b class="emphasis-bold">several different shells</b> (<a href="ch01_06.htm#upt3-CHP-1-SECT-6">Section 1.6</a>), each of which may have different rules for
ch01_04.htm:For example, if you are calling <b class="emphasis-bold">grep</b><a name="IXT-1-1152" /><a name="IXT-1-1153" /> (<a href="ch13_01.htm#upt3-CHP-13-SECT-1">Section 13.1</a>), a program for searching through files for a
ch01_04.htm:single argument. The shell lets you do this by <b class="emphasis-bold">quoting</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>)
ch01_04.htm:cases, especially when dealing with <b class="emphasis-bold">wildcards</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>), like
ch01_04.htm:commands</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>) that run directly
ch01_05.htm:file</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>).
ch01_05.htm:together in this way. An interactive program like the <b class="emphasis-bold">Emacs editor</b> (<a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>)
ch01_05.htm:independently of the shell</b> (<a href="ch01_04.htm#upt3-CHP-1-SECT-4">Section 1.4</a>),
ch01_05.htm:are even exceptions to this exception. A program like <b class="emphasis-bold">less</b><a name="IXT-1-1172" /> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) can read
ch01_05.htm:keyboard. It does that by reading directly from your <b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>).<a name="IXTR3-1372" />
ch01_06.htm:<b class="emphasis-bold">Bourne shell</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) (named after its creator, Steve Bourne) came
ch01_06.htm:programming</b> (<a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>). But many Unix
ch01_06.htm:(<a href="ch23_01.htm#upt3-CHP-23-SECT-1">Section 23.1</a>) and <b class="emphasis-bold">history</b> (<a href="ch30_02.htm#upt3-CHP-30-SECT-2">Section 30.2</a>).
ch01_06.htm:<b class="emphasis-bold">history editing</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>), often called <em class="emphasis">command-line
ch01_07.htm:<p>If your shell has <b class="emphasis-bold">superuser</b> (<a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>) privileges, though, the prompt typically ends
ch01_08.htm:the Unix <b class="emphasis-bold">tr</b> (<a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>) command can convert every occurrence of one
ch01_08.htm:<b class="emphasis-bold">directory</b> (<a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>): 
ch01_08.htm:with <b class="emphasis-bold">chmod</b> (<a href="ch50_05.htm#upt3-CHP-50-SECT-5">Section 50.5</a>): 
ch01_08.htm:<p><tt class="literal">for</tt> <a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>, <tt class="literal">$x</tt> <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch01_08.htm:<b class="emphasis-bold">variable substitution</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>, <a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>).<a href="#FOOTNOTE-1">[1]</a>
ch01_08.htm:wanted to repeat. <a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a> has more about
ch01_08.htm:a <b class="emphasis-bold">filter</b> (<a href="ch01_05.htm#upt3-CHP-1-SECT-5">Section 1.5</a>) by adding four or five more lines of code: a
ch01_08.htm:<i class="command">case</i> (<a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) or
ch01_08.htm:<i class="command">if</i> (<a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>) statement that
ch01_09.htm:(<a href="ch27_02.htm#upt3-CHP-27-SECT-2">Section 27.2</a>) a new <b class="emphasis-bold">subprocess</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>);
ch01_09.htm:(<a name="IXT-1-1252" /><a name="IXT-1-1253" /><a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>) beginning with<a name="IXT-1-1254" /> <em class="emphasis">/</em>, like
ch01_09.htm:check for <b class="emphasis-bold">aliases</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) or <b class="emphasis-bold">shell
ch01_09.htm:functions</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>), which may have
ch01_09.htm:file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) that was read when the
ch01_09.htm:<b class="emphasis-bold">external commands</b> (<a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a>); this saves a long hunt down the search path.
ch01_09.htm:System</b> (<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>) are stored in
ch01_09.htm:variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) called <b class="emphasis-bold">PATH</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>). A typical
ch01_10.htm:the <b class="emphasis-bold">ps x</b><a name="IXT-1-1264" /><a name="IXT-1-1265" /> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>)
ch01_10.htm:output!) The user logged into his Linux system on <b class="emphasis-bold">virtual console</b> (<a href="ch23_12.htm#upt3-CHP-23-SECT-12">Section 23.12</a>)
ch01_10.htm:including the <b class="emphasis-bold">X Window System</b> (<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>) (which actually runs itself as another
ch01_11.htm:files</b> (<a href="ch01_19.htm#upt3-CHP-1-SECT-19">Section 1.19</a>).) The names are words
ch01_11.htm:extensions</b> (<a href="ch01_12.htm#upt3-CHP-1-SECT-12">Section 1.12</a>). Extensions are
ch01_11.htm:match</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>) them unless you
ch01_11.htm:(<b class="emphasis-bold">ls -a</b> (<a href="ch08_09.htm#upt3-CHP-8-SECT-9">Section 8.9</a>)). Special configuration files are often
ch01_11.htm:weird names</b> (<a href="ch14_11.htm#upt3-CHP-14-SECT-11">Section 14.11</a>), though, in
ch01_11.htm:<em class="emphasis">version</em>. There are some <b class="emphasis-bold">revision control programs</b> (<a href="ch39_04.htm#upt3-CHP-39-SECT-4">Section 39.4</a>) that implement their own notion of a version,
ch01_11.htm:on Unix to save your previous versions -- you can <b class="emphasis-bold">program this</b> (<a href="ch35_16.htm#upt3-CHP-35-SECT-16">Section 35.16</a>,
ch01_11.htm:<a href="ch18_14.htm#upt3-CHP-18-SECT-14">Section 18.14</a>) though, if you want to; the GNU Emacs
ch01_11.htm:editor also <b class="emphasis-bold">makes backups</b> (<a href="ch19_04.htm#upt3-CHP-19-SECT-4">Section 19.4</a>). 
ch01_11.htm:forever</b> (<a href="ch14_03.htm#upt3-CHP-14-SECT-3">Section 14.3</a>). You
ch01_12.htm:(<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>)
ch01_12.htm:<p><b class="emphasis-bold">Compressed file</b> <a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>) 
ch01_12.htm:<p><b class="emphasis-bold">Online manual</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>) source file
ch01_12.htm:<p><b class="emphasis-bold">Emacs editor backup file</b> (<a href="ch19_04.htm#upt3-CHP-19-SECT-4">Section 19.4</a>) 
ch01_12.htm:(<a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>)
ch01_12.htm:<p><i class="command">gzip</i> <b class="emphasis-bold">ped</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>) <i class="command">tar</i> <b class="emphasis-bold">archive</b> (<a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>)
ch01_12.htm:<p><b class="emphasis-bold">Bourne shell script</b> (<a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>) 
ch01_13.htm:directory</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>). You could delete
ch01_13.htm:root</b> (<a href="ch01_14.htm#upt3-CHP-1-SECT-14">Section 1.14</a>) and the character used
ch01_13.htm:to separate directory names in a <b class="emphasis-bold">path</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>). The only
ch01_13.htm:files unless you <b class="emphasis-bold">ask</b> (<a href="ch08_09.htm#upt3-CHP-8-SECT-9">Section 8.9</a>) for them. If a file's name
ch01_13.htm:files</b> (<a href="ch28_03.htm#upt3-CHP-28-SECT-3">Section 28.3</a>) -- though many
ch01_13.htm:braces (<tt class="literal">{}</tt>) for doing that. <a href="ch33_03.htm#upt3-CHP-33-SECT-3">Section 33.3</a> explains how wildcards are handled, and
ch01_13.htm:<a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a> has more about wildcards,
ch01_14.htm:<a href="ch10_02.htm#upt3-CHP-10-SECT-2">Section 10.2</a>). A directory can contain any
ch01_14.htm:paths</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>).
ch01_15.htm:filesystems</b> (<a href="ch01_14.htm#upt3-CHP-1-SECT-14">Section 1.14</a>), much like
ch01_15.htm:very own, to store your files (especially the <b class="emphasis-bold">shell setup files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) and <b class="emphasis-bold">rc files</b>
ch01_15.htm:(<a href="ch03_20.htm#upt3-CHP-3-SECT-20">Section 3.20</a>) that you use to customize the rest of
ch01_15.htm:(<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>) to your home, type
ch01_16.htm:pathname</b> (<a href="ch01_14.htm#upt3-CHP-1-SECT-14">Section 1.14</a>) (starting from the
ch01_16.htm:first log in, your current directory is your <b class="emphasis-bold">home directory</b> (<a href="ch01_15.htm#upt3-CHP-1-SECT-15">Section 1.15</a>),
ch01_16.htm:the home directory of the user <em class="emphasis">name</em>. See <a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a>.
ch01_16.htm:<p><a href="ch10_02.htm#upt3-CHP-10-SECT-2">Section 10.2</a> explains where
ch01_17.htm:unique account with a unique login name and a unique <b class="emphasis-bold">UID</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) (user ID
ch01_17.htm:(<a href="ch22_03.htm#upt3-CHP-22-SECT-3">Section 22.3</a>)) defines his "primary
ch01_17.htm:group membership." The <b class="emphasis-bold">/etc/group</b> (<a href="ch49_06.htm#upt3-CHP-49-SECT-6">Section 49.6</a>) file
ch01_17.htm:use a command like <i class="command">newgrp</i> (<a href="ch48_06.htm#upt3-CHP-48-SECT-6">Section 48.6</a>) to change the group to which you currently
ch01_17.htm:(<a href="ch15_11.htm#upt3-CHP-15-SECT-11">Section 15.11</a>), I can also use the
ch01_17.htm:quotas, see <a href="ch50_15.htm#upt3-CHP-50-SECT-15">Section 50.15</a>.) For example, to
ch01_18.htm:<p>In general, a <b class="emphasis-bold">process</b> (<a href="ch24_01.htm#upt3-CHP-24-SECT-1">Section 24.1</a>) is a program that's running:
ch01_18.htm:process</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>), <b class="emphasis-bold">change its priority</b> (<a href="ch26_05.htm#upt3-CHP-26-SECT-5">Section 26.5</a>), or manipulate it in any other way, you have
ch01_18.htm:queue</b> (<a href="ch45_01.htm#upt3-CHP-45-SECT-1">Section 45.1</a>), you must be the user
ch01_18.htm:<em class="emphasis">root</em> or use the <b class="emphasis-bold">su</b> (<a href="ch49_09.htm#upt3-CHP-49-SECT-9">Section 49.9</a>) command. In
ch01_19.htm:pipes</b> (<span class="acronym">FIFO</span>s) (<a href="ch43_11.htm#upt3-CHP-43-SECT-11">Section 43.11</a>) and <b class="emphasis-bold">processes are
ch01_19.htm:files</b> (<a href="ch24_09.htm#upt3-CHP-24-SECT-9">Section 24.9</a>). Like waves and
ch01_21.htm:<b class="emphasis-bold">X Window System</b> (<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>) programs whose display opens on your local
ch01_21.htm:system. <a href="ch06_10.htm#upt3-CHP-6-SECT-10">Section 6.10</a> has examples -- as
ch01_21.htm:(<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>) connections, as well as other types of
ch01_22.htm:still a simple terminal emulator (<b class="emphasis-bold">xterm</b> (<a href="ch05_09.htm#upt3-CHP-5-SECT-9">Section 5.9</a>)).
ch02_01.htm:<i class="command">man</i> command may understand the <b class="emphasis-bold">MANPATH</b><a name="IXT-2-7210" /> <a name="IXT-2-7211" /> (<a href="ch03_21.htm#upt3-CHP-3-SECT-21">Section 3.21</a>) environment variable, a list of where
ch02_01.htm:<p>Your system may also have a different manual page system: <b class="emphasis-bold">info</b> (<a href="ch02_09.htm#upt3-CHP-2-SECT-9">Section 2.9</a>).
ch02_02.htm:-k</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>), but it requires a
ch02_02.htm:<b class="emphasis-bold">cat</b> (<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>)
ch02_03.htm:(<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>) from the system, or my <b class="emphasis-bold">PATH</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>)
ch02_04.htm:(<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>) files. You'll
ch02_04.htm:usually be able to narrow your search to one or two <b class="emphasis-bold">manual page sections</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>); here, you know that user commands are in
ch02_04.htm:<b class="emphasis-bold">find</b> (<a href="ch09_04.htm#upt3-CHP-9-SECT-4">Section 9.4</a>)
ch02_04.htm:(<a href="ch09_18.htm#upt3-CHP-9-SECT-18">Section 9.18</a>), try searching for
ch02_04.htm:<p><a name="IXT-2-7235" /> <a name="IXT-2-7236" />Your manpage files may be <b class="emphasis-bold">compressed</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>). In
ch02_04.htm:that case, use <b class="emphasis-bold">grep</b> (<a href="ch13_02.htm#upt3-CHP-13-SECT-2">Section 13.2</a>) with the <span class="option">-Z</span> option,
ch02_04.htm:unformatted (shown in <a href="ch03_22.htm#upt3-CHP-3-SECT-22">Section 3.22</a>) and
ch02_04.htm:loop</b> (<a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a>) applies a series of
ch02_04.htm:<p><tt class="literal">*</tt> <a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a></p>
ch02_04.htm:(<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>)) to see the output a screenful at a
ch02_06.htm:own</b> <b class="emphasis-bold">bin</b> <b class="emphasis-bold">directory</b> (<a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>)).
ch02_06.htm:Which command you'll get depends on your <b class="emphasis-bold">PATH</b><a name="IXT-2-7254" /> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>)
ch02_06.htm:<i class="command">which</i> command is usually <b class="emphasis-bold">external</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>), so it
ch02_07.htm:<a name="IXT-2-7259" />login session has its own <b class="emphasis-bold">tty</b> (<a href="ch24_06.htm#upt3-CHP-24-SECT-6">Section 24.6</a>) -- a
ch02_07.htm:to <b class="emphasis-bold">write</b><a name="IXT-2-7260" /> <a name="IXT-2-7261" /> or <b class="emphasis-bold">talk</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) to you,
ch02_07.htm:<b class="emphasis-bold">telnet</b>, etc. (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>). A system file like
ch02_07.htm:test in my <b class="emphasis-bold">.logout</b> <b class="emphasis-bold">file</b> (<a href="ch04_17.htm#upt3-CHP-4-SECT-17">Section 4.17</a>) that
ch02_07.htm:<p><tt class="literal">` `</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch02_08.htm:<b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>)
ch02_08.htm:number, the login time, and, if the user is coming in via a <b class="emphasis-bold">network</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>),
ch02_08.htm:(<a href="ch13_01.htm#upt3-CHP-13-SECT-1">Section 13.1</a>) -- especially on systems with a lot
ch02_08.htm:<p><tt class="literal">-v</tt> <a href="ch13_03.htm#upt3-CHP-13-SECT-3">Section 13.3</a></p>
ch03_01.htm:<b class="emphasis-bold">interactive</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>), you may well be denied a command line. This
ch03_03.htm:a</b> <b class="emphasis-bold">nonlogin shell</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>). There are different setup files for nonlogin
ch03_03.htm:you. The <i class="command">login</i> program sets <b class="emphasis-bold">a special flag</b> (<a href="ch03_19.htm#upt3-CHP-3-SECT-19">Section 3.19</a>)
ch03_03.htm:an <b class="emphasis-bold">xterm</b> <b class="emphasis-bold">window</b> (<a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>);
ch03_03.htm:starts a nonlogin shell. And a <b class="emphasis-bold">subshell</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) is
ch03_03.htm:want a login shell that sets things like the <b class="emphasis-bold">terminal type</b> (<a href="ch05_02.htm#upt3-CHP-5-SECT-2">Section 5.2</a>,
ch03_03.htm:<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>). Other shells on the same terminal
ch03_03.htm:operators</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>)
ch03_03.htm:(<a name="IXT-3-6985" /><a name="IXT-3-6986" /> <a name="IXT-3-6987" /><a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) like HOME, PATH, SHELL, TERM, MAIL, and
ch03_03.htm:process to child process</b> (<a href="ch35_04.htm#upt3-CHP-35-SECT-4">Section 35.4</a>),
ch03_03.htm:shell) on startup of a shell. On Mac OS X, when you use <b class="emphasis-bold">Terminal</b> (<a href="ch03_02.htm#upt3-CHP-3-SECT-2">Section 3.2</a>), your
ch03_03.htm:variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) (but only for
ch03_03.htm:<b class="emphasis-bold">subshell</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>), though. Subshells are set up through
ch03_03.htm:(<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) that were set when you first logged in
ch03_03.htm:time you start a shell. For instance, shell variables like <b class="emphasis-bold">cdpath</b> (<a href="ch31_05.htm#upt3-CHP-31-SECT-5">Section 31.5</a>) and
ch03_03.htm:(<a name="IXT-3-7000" /><a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) should,
ch03_03.htm:(<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) (which Unix will pass to subshells
ch03_03.htm:automatically). Run commands like <b class="emphasis-bold">tset</b> (<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>) and
ch03_03.htm:<b class="emphasis-bold">stty</b> (<a href="ch05_07.htm#upt3-CHP-5-SECT-7">Section 5.7</a>,
ch03_03.htm:<a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>) that set up your terminal. Finally,
ch03_03.htm:for <b class="emphasis-bold">mail and news</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>), running <i class="command">fortune</i>, checking
ch03_03.htm:<a href="ch03_08.htm#upt3-CHP-3-SECT-8">Section 3.8</a> has tips for reading
ch03_03.htm:shell. A <b class="emphasis-bold">login Korn shell</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>) will read the
ch03_03.htm:present. The <em class="filename">.profile</em> can set the <b class="emphasis-bold">ENV</b><a name="IXT-3-7014" /> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>)
ch03_03.htm:set a <b class="emphasis-bold">trap</b> (<a href="ch04_18.htm#upt3-CHP-4-SECT-18">Section 4.18</a>) to handle nonlogin shells.
ch03_04.htm:a</b> <b class="emphasis-bold">login shell</b>. (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>) A login shell is typcally the top-level shell
ch03_04.htm:starts with the <b class="emphasis-bold">init</b> (<a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>) process. Many characteristics of processes
ch03_04.htm:"tree" -- especially <b class="emphasis-bold">environment variables</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>), such as the <b class="emphasis-bold">search
ch03_04.htm:path</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>). The changes you make
ch03_04.htm:top-level shell starts -- including any <b class="emphasis-bold">subshells</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>).
ch03_04.htm:(<a href="ch03_19.htm#upt3-CHP-3-SECT-19">Section 3.19</a>) when it's a login
ch03_04.htm:shell -- and, if it is, the shell reads special <b class="emphasis-bold">setup files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) for
ch03_04.htm:by your window system</b> (<a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>), or
ch03_04.htm:<b class="emphasis-bold">at</b> (<a href="ch25_05.htm#upt3-CHP-25-SECT-5">Section 25.5</a>),
ch03_04.htm:<b class="emphasis-bold">rsh</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>),
ch03_04.htm:manual page for details. <a href="ch04_12.htm#upt3-CHP-4-SECT-12">Section 4.12</a> shows
ch03_04.htm:that's only read by login shells</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>). The line sets a <b class="emphasis-bold">shell
ch03_04.htm:variable</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) named
ch03_04.htm:<p><tt class="literal">if</tt> <a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a></p>
ch03_04.htm:script</b> (<a name="IXT-3-7062" /><a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>). In this case, the shell
ch03_05.htm:<p><a name="IXT-3-7069" />Setup files for <b class="emphasis-bold">login shells</b> (<a name="IXT-3-7070" /> <a name="IXT-3-7071" /><a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>) -- such as
ch03_05.htm:(<a name="IXT-3-7072" /><a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a>) if the system default path
ch03_05.htm:(<a name="IXT-3-7073" /><a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>) and <b class="emphasis-bold">make various
ch03_05.htm:terminal settings</b> (<a href="ch05_07.htm#upt3-CHP-5-SECT-7">Section 5.7</a>, <a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>) if the system might not know your terminal
ch03_05.htm:(<a name="IXT-3-7074" /><a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) that might
ch03_05.htm:<b class="emphasis-bold">who</b> (<a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a>)
ch03_05.htm:or <b class="emphasis-bold">uptime</b> (<a href="ch26_04.htm#upt3-CHP-26-SECT-4">Section 26.4</a>) or <i class="command">w</i> (a combination of the
ch03_05.htm:want <b class="emphasis-bold">aliases</b> (<a href="ch28_02.htm#upt3-CHP-28-SECT-2">Section 28.2</a>) available in every interactive shell you
ch03_05.htm:<p>Coordinating custom setup files on different machines (<a href="ch03_18.htm#upt3-CHP-3-SECT-18">Section 3.18</a>). 
ch03_05.htm:you're using (<a href="ch03_10.htm#upt3-CHP-3-SECT-10">Section 3.10</a>
ch03_06.htm:<b class="emphasis-bold">setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) or your password, it can be tough to log in
ch03_06.htm:(<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) to log in to your host again from the
ch03_07.htm:<b class="emphasis-bold">shell setup files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) is lines like these:
ch03_07.htm:<p><tt class="literal">$$</tt> <a href="ch27_17.htm#upt3-CHP-27-SECT-17">Section 27.17</a>, <tt class="literal">`...`</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section
ch03_07.htm:<p>What's wrong with those lines? Both use <b class="emphasis-bold">relative pathnames</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>) for the files (<em class="emphasis">.aliases</em>,
ch03_07.htm:<b class="emphasis-bold">subshell</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) from somewhere besides your home directory
ch03_07.htm:ever use the <b class="emphasis-bold">source</b> <b class="emphasis-bold">or . commands</b> (<a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>)
ch03_07.htm:<p>Use absolute pathnames instead. As <a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a> explains, the pathname of your
ch03_08.htm:particular times</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>). Only
ch03_08.htm:shells</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>) will read the
ch03_08.htm:systems (like <b class="emphasis-bold">xterm</b> (<a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>)), <a name="IXT-3-7098" /><a name="IXT-3-7099" />remote shells (like
ch03_08.htm:<b class="emphasis-bold">rsh</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>)
ch03_08.htm:because all <b class="emphasis-bold">subshells</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) read it . . . you definitely
ch03_08.htm:don't want to run <b class="emphasis-bold">terminal-setting commands like</b> <b class="emphasis-bold">tset</b> (<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>) during
ch03_08.htm:variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) as a flag.
ch03_08.htm:<b class="emphasis-bold">exit</b> <b class="emphasis-bold">command</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>) to log
ch03_08.htm:<p><tt class="literal">case</tt> <a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section
ch03_08.htm:35.10</a>, <tt class="literal">/</tt> <a href="ch36_25.htm#upt3-CHP-36-SECT-25">Section 36.25</a>,
ch03_08.htm:<tt class="literal">function</tt> <a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>,
ch03_08.htm:<tt class="literal">.</tt> <a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a></p>
ch03_08.htm:<p>The <tt class="literal">builtin exit</tt> (<a href="ch27_09.htm#upt3-CHP-27-SECT-9">Section 27.9</a>)
ch03_08.htm:(<a href="ch27_10.htm#upt3-CHP-27-SECT-10">Section 27.10</a>) instead. This isn't
ch03_08.htm:shell</b> (<a href="ch03_06.htm#upt3-CHP-3-SECT-6">Section 3.6</a>) and be ready to
ch03_08.htm:<b class="emphasis-bold">kill</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>)
ch03_09.htm:<b class="emphasis-bold">command</b> (<a href="ch02_06.htm#upt3-CHP-2-SECT-6">Section 2.6</a>) set the <em class="emphasis">prompt</em> variable
ch03_09.htm:<b class="emphasis-bold">environment variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>). The variable will be copied into all
ch03_09.htm:(<a name="IXT-3-7117" /><a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) (like the one that <i class="command">which</i>
ch03_09.htm:(<a href="ch25_05.htm#upt3-CHP-25-SECT-5">Section 25.5</a>) that runs jobs from interactive
ch03_09.htm:<b class="emphasis-bold">at</b> (<a href="ch29_01.htm#upt3-CHP-29-SECT-1">Section 29.1</a>)
ch03_09.htm:<p><tt class="literal">( )</tt> <a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>, <tt class="literal">\at</tt> <a href="ch29_08.htm#upt3-CHP-29-SECT-8">Section 29.8</a></p>
ch03_10.htm:(<a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>) to set the correct
ch03_10.htm:<a name="IXT-3-7124" /> <a name="IXT-3-7125" />Bourne-type shells use <b class="emphasis-bold">case</b> (<a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) and
ch03_10.htm:<b class="emphasis-bold">if</b> (<a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>).
ch03_10.htm:<em class="emphasis">TERM</em><a name="IXT-3-7126" /> <a name="IXT-3-7127" /> <b class="emphasis-bold">environment variable</b> (<a href="ch03_11.htm#upt3-CHP-3-SECT-11">Section 3.11</a>). <b class="emphasis-bold">Testing other
ch03_10.htm:environment variables</b> (<a href="ch03_14.htm#upt3-CHP-3-SECT-14">Section 3.14</a>) can
ch03_10.htm:<p><b class="emphasis-bold">Test the output of</b> <b class="emphasis-bold">who am i</b> (<a href="ch03_12.htm#upt3-CHP-3-SECT-12">Section 3.12</a>) to
ch03_10.htm:type</b> (<a href="ch03_15.htm#upt3-CHP-3-SECT-15">Section 3.15</a>) in a table like
ch03_10.htm:<em class="filename">/etc/inittab</em> (in some other variants). <b class="emphasis-bold">Testing the port name</b> (<a href="ch03_13.htm#upt3-CHP-3-SECT-13">Section 3.13</a>) may also work.
ch03_10.htm:<p>In the <a name="IXT-3-7128" />X Window System, you can <b class="emphasis-bold">test the window size</b> (<a href="ch03_16.htm#upt3-CHP-3-SECT-16">Section 3.16</a>) and make various settings based on that.
ch03_10.htm:<b class="emphasis-bold">Naming windows</b> (<a href="ch03_17.htm#upt3-CHP-3-SECT-17">Section 3.17</a>) lets you identify a particular window by
ch03_10.htm:obscure <b class="emphasis-bold">tset</b><a name="IXT-3-7129" /> (<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>) program
ch03_10.htm:that sets the terminal type is <b class="emphasis-bold">qterm</b><a name="IXT-3-7130" /> (<a href="ch05_04.htm#upt3-CHP-5-SECT-4">Section 5.4</a>).
ch03_10.htm:<em class="filename">.cshrc</em>. <a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a> can
ch03_11.htm:<b class="emphasis-bold">statement</b> (<a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) in your <em class="filename">.profile</em>
ch03_12.htm:other hosts</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) or from hosts
ch03_12.htm:running the <b class="emphasis-bold">X Window System</b> (<a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>), the <i class="command">who am i</i><a href="#FOOTNOTE-8">[8]</a> command will probably show a
ch03_12.htm:<p><tt class="literal">case</tt> <a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a></p>
ch03_12.htm:<a href="ch34_11.htm#upt3-CHP-34-SECT-11">Section 34.11</a></p>
ch03_12.htm:<b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>)
ch03_13.htm:<b class="emphasis-bold">and</b> <b class="emphasis-bold">ssh</b><a name="IXT-3-7144" /> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>),
ch03_13.htm:<p><tt class="literal">tty</tt> <a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a></p>
ch03_14.htm:variable</b> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>). If
ch03_14.htm:<b class="emphasis-bold">ssh</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>),
ch03_14.htm:<b class="emphasis-bold">or</b> <b class="emphasis-bold">printenv</b> <b class="emphasis-bold">command</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) to look
ch03_14.htm:<p>Your <b class="emphasis-bold">shell setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) makes decisions based on the environment
ch03_14.htm:<p><tt class="literal">[ ]</tt> <a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a></p>
ch03_15.htm:file that lists the type of each terminal port (<b class="emphasis-bold">tty</b> (<a href="ch24_06.htm#upt3-CHP-24-SECT-6">Section 24.6</a>)).<a href="#FOOTNOTE-9">[9]</a> Here are lines from <em class="emphasis">/etc/ttys</em> on a
ch03_15.htm:<em class="emphasis">network</em>, the type used by <b class="emphasis-bold">xterm</b> (<a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>),
ch03_15.htm:<b class="emphasis-bold">telnet</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>), etc.
ch03_15.htm:match the first column of that file to the output of the <b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>) command,
ch03_15.htm:<p><tt class="literal">awk</tt> <a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a></p>
ch03_15.htm:<p>Then you can test the value with <b class="emphasis-bold">case</b> (<a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) or
ch03_15.htm:<b class="emphasis-bold">if</b> (<a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>).
ch03_15.htm:<b class="emphasis-bold">:t string modifier</b> (<a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a>) and test its value with
ch03_16.htm:excerpt from my <b class="emphasis-bold">X setup file</b> (<a href="ch03_20.htm#upt3-CHP-3-SECT-20">Section 3.20</a>) that opens the windows:
ch03_16.htm:<p><tt class="literal">-e</tt> <a href="ch05_22.htm#upt3-CHP-5-SECT-22">Section 5.22</a></p>
ch03_16.htm:<b class="emphasis-bold">less</b> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>)
ch03_16.htm:(<a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>) command puts the number of rows into
ch03_16.htm:easier.) Then a series of <b class="emphasis-bold">if</b> (<a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>)<b class="emphasis-bold">/then</b> (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>) tests handle different window sizes:
ch03_17.htm:windows. Here's an excerpt from my <b class="emphasis-bold">X setup file</b> (<a href="ch03_20.htm#upt3-CHP-3-SECT-20">Section 3.20</a>):
ch03_17.htm:<p><tt class="literal">-f</tt><a href="ch11_10.htm#upt3-CHP-11-SECT-10">Section 11.10</a>, <tt class="literal">{ }</tt><a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a></p>
ch03_17.htm:(<a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a>) to watch log files. On the work
ch03_18.htm:<p><tt class="literal">setenv</tt> <a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a></p>
ch03_18.htm:<p><tt class="literal">~</tt> <a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a></p>
ch03_18.htm:(<a href="ch02_05.htm#upt3-CHP-2-SECT-5">Section 2.5</a>) <em class="emphasis">bosco</em>, and I have
ch03_18.htm:can <b class="emphasis-bold">source</b> (<a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>) it to customize my environment for that one
ch03_18.htm:<dt><i><b class="emphasis-bold">Search path</b> (<a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a>)</i></dt>
ch03_18.htm:<em class="filename">/opt</em></tt>. The same goes for <b class="emphasis-bold">cdpath</b> (<a href="ch31_05.htm#upt3-CHP-31-SECT-5">Section 31.5</a>).
ch03_18.htm:<dt><i><b class="emphasis-bold">Terminal settings</b> (<a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>)</i></dt>
ch03_18.htm:<a name="IXT-3-7183" /><a name="IXT-3-7184" /><dt><i>Other <b class="emphasis-bold">shell variables</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) and <b class="emphasis-bold">environment variables</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>)</i></dt>
ch03_19.htm:shell</em>. When a shell is a login shell, it <b class="emphasis-bold">acts differently</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>). 
ch03_19.htm:<b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>)
ch03_19.htm:<p>A more general solution is to make a <b class="emphasis-bold">link</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) to the
ch03_19.htm:<p><tt class="literal">bin</tt> <a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>, <tt class="literal">./-</tt> <a href="ch14_13.htm#upt3-CHP-14-SECT-13">Section 14.13</a></p>
ch03_20.htm:<p>One way to set defaults for your applications is with <b class="emphasis-bold">environment variables</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) that the applications might read. This can
ch03_20.htm:files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>). Most of these
ch03_20.htm:<b class="emphasis-bold">hidden</b> (<a href="ch08_09.htm#upt3-CHP-8-SECT-9">Section 8.9</a>) in your home directory;
ch03_20.htm:It's one of those acronyms, like <b class="emphasis-bold">spool</b> (<a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>),
ch03_20.htm:For the Emacs editor. See <a href="ch19_03.htm#upt3-CHP-19-SECT-3">Section 19.3</a>.</p>
ch03_20.htm:editor. See <a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>.
ch03_20.htm:For the <b class="emphasis-bold">mail</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) program and others like it. This can be handy
ch03_20.htm:<i class="command">ftp</i> and some other programs. Should have <b class="emphasis-bold">file access mode</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>) 600 or 400 for security, but this may not be
ch03_20.htm:For <b class="emphasis-bold">news readers</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>). (Some newer news readers have more complex
ch03_20.htm:<b class="emphasis-bold">and</b> <b class="emphasis-bold">rlogin</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>). Remote
ch03_20.htm:mode</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>) 600 or 400. We suggest
ch03_20.htm:A <b class="emphasis-bold">resource file</b> (<a href="ch06_05.htm#upt3-CHP-6-SECT-5">Section 6.5</a>) for the X Window System. Sometimes also
ch03_20.htm:A <b class="emphasis-bold">shell script</b> (<a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>) that runs as you log in to an X Window System
ch03_20.htm:<p><tt class="literal">$Id</tt> <a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section
ch03_20.htm:39.5</a>, <tt class="literal">exec &gt;</tt> <a href="ch36_05.htm#upt3-CHP-36-SECT-5">Section
ch03_20.htm:36.5</a>, <tt class="literal">-v</tt> <a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>, <tt class="literal">uname</tt> <tt class="literal">-n</tt> <a href="ch02_05.htm#upt3-CHP-2-SECT-5">Section 2.5</a> 
ch03_20.htm:, <tt class="literal">${..:=..}</tt> <a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section
ch03_20.htm:36.7</a>, <tt class="literal">export</tt> <a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section
ch03_20.htm:35.3</a>, <tt class="literal">xrdb</tt> <a href="ch06_08.htm#upt3-CHP-6-SECT-8">Section
ch03_20.htm:<a href="ch24_21.htm#upt3-CHP-24-SECT-21">Section 24.21</a>, <tt class="literal">exec</tt> <a href="ch36_05.htm#upt3-CHP-36-SECT-5">Section 36.5</a></p>
ch03_20.htm:script</b> (<a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>), but it can be any
ch03_20.htm:<b class="emphasis-bold">shell scripts</b> (<a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>). If you know a little about shell
ch03_21.htm:use the <b class="emphasis-bold">nroff -man</b> <b class="emphasis-bold">macros</b> (<a href="ch03_22.htm#upt3-CHP-3-SECT-22">Section 3.22</a>) if you
ch03_21.htm:<p>The <b class="emphasis-bold">man</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>) command is essentially the same as this:
ch03_21.htm:<p><tt class="literal">-s</tt> <a href="ch11_07.htm#upt3-CHP-11-SECT-7">Section 11.7</a></p>
ch03_21.htm:<p><tt class="literal">~</tt> <a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a></p>
ch03_21.htm:systems have a <b class="emphasis-bold">MANPATH</b> <b class="emphasis-bold">environment variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>), a colon-separated list of directories where
ch03_21.htm:following <b class="emphasis-bold">C shell alias</b> (<a href="ch29_03.htm#upt3-CHP-29-SECT-3">Section 29.3</a>): 
ch03_21.htm:<p><tt class="literal">less</tt> <a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a></p>
ch03_21.htm:<p>or <b class="emphasis-bold">shell function</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>): 
ch03_21.htm:want to save space in your filesystem, you can use the <b class="emphasis-bold">gzip</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>) utility on
ch03_22.htm:we discussed in <a href="ch03_21.htm#upt3-CHP-3-SECT-21">Section 3.21</a>,
ch03_22.htm:<p><tt class="literal">1</tt> <a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a></p>
ch03_22.htm:<p>Section heading; one for each section.</p>
ch04_01.htm:variable</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) called
ch04_01.htm:<p>There are two or three ways to set a prompt. One is a <b class="emphasis-bold">static prompt</b> (<a href="ch04_02.htm#upt3-CHP-4-SECT-2">Section 4.2</a>)
ch04_01.htm:(<a href="ch04_03.htm#upt3-CHP-4-SECT-3">Section 4.3</a>) string that is interpreted by the
ch04_01.htm:<b class="emphasis-bold">simulate a dynamic prompt</b> (<a href="ch04_04.htm#upt3-CHP-4-SECT-4">Section 4.4</a>) by changing the prompt string
ch04_01.htm:prompt on the command line, store it in the correct <b class="emphasis-bold">shell setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>): use the file that's read by
ch04_01.htm:pointless -- and it can even cause <b class="emphasis-bold">problems</b> (<a href="ch04_05.htm#upt3-CHP-4-SECT-5">Section 4.5</a>).)
ch04_02.htm:<p><a name="IXT-4-6706" /><a name="IXT-4-6707" />As <a href="ch04_01.htm#upt3-CHP-4-SECT-1">Section 4.1</a> explains, the simplest
ch04_02.htm:<p><a name="IXT-4-6709" />Notice the <b class="emphasis-bold">single quotes</b> (<a href="ch11_03.htm#upt3-CHP-11-SECT-3">Section 11.3</a>)
ch04_02.htm:<b class="emphasis-bold">double quotes</b> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) around the values, which lets the shell
ch04_02.htm:runs the <b class="emphasis-bold">command substitution</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) that gives the hostname -- <em class="emphasis">once,
ch04_03.htm:printed</em>. As <a href="ch04_01.htm#upt3-CHP-4-SECT-1">Section 4.1</a> explains,
ch04_03.htm:don't have these special sequences. <a href="ch04_04.htm#upt3-CHP-4-SECT-4">Section 4.4</a> has a technique that should work for you.)
ch04_03.htm:(<a href="ch27_01.htm#upt3-CHP-27-SECT-1">Section 27.1</a>) as the prompt is stored. For example,
ch04_03.htm:<a href="ch04_14.htm#upt3-CHP-4-SECT-14">Section 4.14</a> shows, makes it easy to use
ch04_03.htm:<b class="emphasis-bold">history</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>) to repeat or modify a previous command. You
ch04_04.htm:shown in <a href="ch04_03.htm#upt3-CHP-4-SECT-3">Section 4.3</a>. If you still want a
ch04_04.htm:prompt_subst</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) in your
ch04_04.htm:<b class="emphasis-bold">.zshrc</b> <b class="emphasis-bold">file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>).)
ch04_04.htm:a <b class="emphasis-bold">multiline prompt</b> (<a href="ch04_07.htm#upt3-CHP-4-SECT-7">Section 4.7</a>). Or you could write a simple <b class="emphasis-bold">shell function</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>)
ch04_04.htm:writing a shell <b class="emphasis-bold">alias</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) named something like <b class="emphasis-bold">setprompt</b> <b class="emphasis-bold">(</b><a href="ch04_14.htm#upt3-CHP-4-SECT-14">Section 4.14</a>) that resets the
ch04_04.htm:see <a href="ch04_15.htm#upt3-CHP-4-SECT-15">Section 4.15</a> for a similar trick.)
ch04_05.htm:already set (<a href="ch04_01.htm#upt3-CHP-4-SECT-1">Section 4.1</a>), many older versions of
ch04_05.htm:(<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>) and the <b class="emphasis-bold">tilde</b> (<tt class="literal">~</tt>) (<a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a>). 
ch04_06.htm:external</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>). Built-in commands
ch04_06.htm:<p><a name="IXT-4-6746" /><a name="IXT-4-6747" /><a href="ch04_03.htm#upt3-CHP-4-SECT-3">Section 4.3</a> has examples of some shells'
ch04_06.htm:way an external command in <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>),
ch04_06.htm:<b class="emphasis-bold">basename</b> (<a href="ch36_13.htm#upt3-CHP-36-SECT-13">Section 36.13</a>) or <b class="emphasis-bold">sed</b>
ch04_06.htm:(<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) with the current directory from
ch04_06.htm:following code listing, and probably in an alias like <b class="emphasis-bold">setprompt</b> (<a href="ch04_07.htm#upt3-CHP-4-SECT-7">Section 4.7</a>) to
ch04_06.htm:<p><tt class="literal">{}</tt> <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch04_06.htm:(<a name="IXT-4-6750" /><a name="IXT-4-6751" /><a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a>) like <tt class="literal">:t</tt>; the Korn Shell,
ch04_06.htm:(<a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a>).
ch04_06.htm:<p>If your prompt gets complex, you can use a <b class="emphasis-bold">shell function</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>)
ch04_06.htm:<p><tt class="literal">${+}</tt> <a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a>, <tt class="literal">$(...)</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch04_06.htm:variable named <em class="emphasis">SCRIPT</em> while the <b class="emphasis-bold">script</b> (<a href="ch37_07.htm#upt3-CHP-37-SECT-7">Section 37.7</a>) program
ch04_06.htm:visualize, <a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a> and <a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a> have some background.)
ch04_06.htm:is a <b class="emphasis-bold">case</b><a name="IXT-4-6755" /> <b class="emphasis-bold">statement</b> (<a href="ch35_11.htm#upt3-CHP-35-SECT-11">Section 35.11</a>) that
ch04_06.htm:tests <em class="emphasis">$TTY</em>, the name of the <b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>)
ch04_06.htm:consoles</b> (<a href="ch23_12.htm#upt3-CHP-23-SECT-12">Section 23.12</a>). In that case, I
ch04_06.htm:(<a href="ch31_07.htm#upt3-CHP-31-SECT-7">Section 31.7</a>)). The second line has the
ch04_06.htm:<a name="IXT-4-6756" />prompt string is inside <b class="emphasis-bold">double quotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>)
ch04_06.htm:<p>As another example, <a href="ch04_14.htm#upt3-CHP-4-SECT-14">Section 4.14</a> shows more
ch04_07.htm:quoting</b> (<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>) is
ch04_07.htm:<p><tt class="literal">uname -n</tt> <a href="ch02_05.htm#upt3-CHP-2-SECT-5">Section 2.5</a>, <tt class="literal">{..}</tt> <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch04_07.htm:newline; <a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a> explains.
ch04_08.htm:Bourne-type shells with a shell function and <b class="emphasis-bold">case</b> (<a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) statement;
ch04_08.htm:<p><tt class="literal">:h</tt> <a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section
ch04_08.htm:28.5</a>, <tt class="literal">&amp;&amp;</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a></p>
ch04_08.htm:<p>(<a href="ch05_15.htm#upt3-CHP-5-SECT-15">Section 5.15</a> has more about how this works
ch04_08.htm:set until after the alias has been read. There are <b class="emphasis-bold">workarounds</b> (<a href="ch03_08.htm#upt3-CHP-3-SECT-8">Section 3.8</a>).
ch04_08.htm:(<a name="IXT-4-6789" /><a name="IXT-4-6790" /><a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>),
ch04_08.htm:<b class="emphasis-bold">subshells</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>), etc. These might make a new status line or
ch04_09.htm:<p>Next, a <b class="emphasis-bold">multiline prompt</b> (<a href="ch04_07.htm#upt3-CHP-4-SECT-7">Section 4.7</a>) for the C shell <em class="filename">.cshrc</em>
ch04_10.htm:later. (The <a name="IXT-4-6802" /> <a name="IXT-4-6803" />GNU <b class="emphasis-bold">dircolors</b> (<a href="ch08_06.htm#upt3-CHP-8-SECT-6">Section 8.6</a>)
ch04_10.htm:<p><tt class="literal">uname -n</tt> <a href="ch02_05.htm#upt3-CHP-2-SECT-5">Section 2.5</a></p>
ch04_10.htm:it's very handy.) <a href="ch04_06.htm#upt3-CHP-4-SECT-6">Section 4.6</a> and <a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a> have more
ch04_10.htm:<b class="emphasis-bold">shell variables</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>). 
ch04_12.htm:escape</b> (<a href="ch17_21.htm#upt3-CHP-17-SECT-21">Section 17.21</a>) or any <b class="emphasis-bold">subshell</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>), you
ch04_12.htm:shell <b class="emphasis-bold">history</b> (<a href="ch30_01.htm#upt3-CHP-30-SECT-1">Section 30.1</a>) might get confused, <b class="emphasis-bold">shell variables</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>)
ch04_12.htm:<b class="emphasis-bold">environment variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) that lets you track how many subshells deep
ch04_12.htm:bit of arithmetic in the <b class="emphasis-bold">ENV</b> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>) file or the <em class="filename">.cshrc</em> file,
ch04_12.htm:consoles</b> (<a href="ch23_12.htm#upt3-CHP-23-SECT-12">Section 23.12</a>)) and that the
ch04_12.htm:check <b class="emphasis-bold">who</b> (<a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a>).) You may need to adapt this. The trick is to
ch04_12.htm:<p>Getting this to work right in every situation (<b class="emphasis-bold">rsh</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>), <b class="emphasis-bold">ssh</b>, <b class="emphasis-bold">su</b>,
ch04_12.htm:<b class="emphasis-bold">shell escapes</b> (<a href="ch17_21.htm#upt3-CHP-17-SECT-21">Section 17.21</a>) -- both <b class="emphasis-bold">interactive
ch04_12.htm:and noninteractive</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>) -- subshells, window systems, <b class="emphasis-bold">at</b> <b class="emphasis-bold">jobs</b>
ch04_12.htm:(<a href="ch25_05.htm#upt3-CHP-25-SECT-5">Section 25.5</a>), and so on) <b class="emphasis-bold">can
ch04_12.htm:be a challenge</b> (<a href="ch03_08.htm#upt3-CHP-3-SECT-8">Section 3.8</a>)! It takes a
ch04_12.htm:<b class="emphasis-bold">printenv</b> <b class="emphasis-bold">command</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>).) Then
ch04_13.htm:editing</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>) that modern Unix
ch04_13.htm:<p>If you want some information in your prompt, too, make a <b class="emphasis-bold">multiline prompt</b> (<a href="ch04_07.htm#upt3-CHP-4-SECT-7">Section 4.7</a>) with four spaces in the last line.
ch04_14.htm:<b class="emphasis-bold">popd</b> (<a href="ch30_07.htm#upt3-CHP-30-SECT-7">Section 30.7</a>)
ch04_14.htm:<em class="filename">.tcshrc</em><a name="IXT-4-6851" /> to make a <b class="emphasis-bold">multiline prompt</b> (<a href="ch04_07.htm#upt3-CHP-4-SECT-7">Section 4.7</a>) that shows the directory stack:
ch04_14.htm:<p><tt class="literal">uname -n</tt> <a href="ch02_05.htm#upt3-CHP-2-SECT-5">Section 2.5</a>, <tt class="literal">expr</tt> <a href="ch36_21.htm#upt3-CHP-36-SECT-21">Section 36.21</a></p>
ch04_14.htm:<b class="emphasis-bold">built-in prompt operators</b> (<a href="ch04_03.htm#upt3-CHP-4-SECT-3">Section 4.3</a>) like <tt class="literal">\u</tt>, the
ch04_14.htm:<p><tt class="literal">$(...)</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch04_14.htm:<b class="emphasis-bold">string editing</b> (<a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a>). 
ch04_15.htm:<b class="emphasis-bold">trap</b> (<a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>)
ch04_15.htm:will run one or more commands when the shell gets a <b class="emphasis-bold">signal</b> (<a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>)
ch04_15.htm:instance, the shell could reread a configuration file; <a href="ch24_13.htm#upt3-CHP-24-SECT-13">Section 24.13</a> shows that. Or it could set a new
ch04_15.htm:<b class="emphasis-bold">cron</b> <b class="emphasis-bold">job</b> (<a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>)) sends the
ch04_15.htm:(<a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a>) job springs this trap once a minute.
ch04_15.htm:(possibly with some editing, probably with <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) or
ch04_15.htm:<b class="emphasis-bold">expr</b> (<a href="ch36_21.htm#upt3-CHP-36-SECT-21">Section 36.21</a>)): count the number of users, show the
ch04_15.htm:<b class="emphasis-bold">load average</b> (<a href="ch26_04.htm#upt3-CHP-26-SECT-4">Section 26.4</a>), whatever. Newer shells, like
ch04_15.htm:backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) each time the
ch04_15.htm:prompt is displayed -- <a href="ch04_10.htm#upt3-CHP-4-SECT-10">Section 4.10</a> has an
ch04_15.htm:<p><tt class="literal">:</tt> <a href="ch36_06.htm#upt3-CHP-36-SECT-6">Section 36.6</a></p>
ch04_15.htm:<p>The prompt format is up to you. This example makes a <b class="emphasis-bold">two-line prompt</b> (<a href="ch03_07.htm#upt3-CHP-3-SECT-7">Section 3.7</a>)
ch04_15.htm:<p>This setup starts a <b class="emphasis-bold">while</b> <b class="emphasis-bold">loop</b> (<a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>) in the
ch04_15.htm:(<a name="IXT-4-6870" /><a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) of the background shell. Before you log out,
ch04_15.htm:you should <b class="emphasis-bold">kill</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) the loop. You can type the command:
ch04_15.htm:<p>at a prompt or put it in a file that's <b class="emphasis-bold">executed when you log out</b> (<a href="ch04_18.htm#upt3-CHP-4-SECT-18">Section 4.18</a>). 
ch04_16.htm:prompt comes next. (<a href="ch04_15.htm#upt3-CHP-4-SECT-15">Section 4.15</a> shows how to
ch04_16.htm:use <b class="emphasis-bold">history substitution</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>) inside the alias or function.
ch04_16.htm:article</b> (<a href="ch04_08.htm#upt3-CHP-4-SECT-8">Section 4.8</a>). The
ch04_16.htm:<b class="emphasis-bold">uptime</b><a name="IXT-4-6882" /> (<a href="ch26_04.htm#upt3-CHP-26-SECT-4">Section 26.4</a>) every
ch04_16.htm:<b class="emphasis-bold">file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>)
ch04_16.htm:file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>):
ch04_16.htm:<p><tt class="literal">IFS</tt> <a href="ch36_23.htm#upt3-CHP-36-SECT-23">Section
ch04_16.htm:36.23</a>, <tt class="literal">set</tt> <a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>, <tt class="literal">shift
ch04_16.htm:$#</tt> <a href="ch36_10.htm#upt3-CHP-36-SECT-10">Section 36.10</a></p>
ch04_16.htm:<p>(It was even more useless than <b class="emphasis-bold">psychoanalyze-pinhead</b> (<a href="ch19_13.htm#upt3-CHP-19-SECT-13">Section 19.13</a>), but it was fun while it lasted.) Seriously
ch04_17.htm:<b class="emphasis-bold">.logout</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) in your home directory and put the commands
ch04_17.htm:your logout-type file, too. <a href="ch03_18.htm#upt3-CHP-3-SECT-18">Section 3.18</a>
ch04_17.htm:shows a fix for the Bourne and Korn shells; <a href="ch03_08.htm#upt3-CHP-3-SECT-8">Section 3.8</a> and <a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a> have
ch04_17.htm:command <b class="emphasis-bold">sleep 2</b> (<a href="ch25_09.htm#upt3-CHP-25-SECT-9">Section 25.9</a>) <a name="IXT-4-6899" />at the end of the file. That makes the
ch04_18.htm:<p><a name="IXT-4-6900" /> <a name="IXT-4-6901" /><a name="IXT-4-6902" /><a name="IXT-4-6903" /><a href="ch04_17.htm#upt3-CHP-4-SECT-17">Section 4.17</a>
ch04_18.htm:<p><tt class="literal">trap</tt> <a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>, <tt class="literal">.</tt> <a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a></p>
ch04_18.htm:<p><tt class="literal">if</tt><a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section
ch04_18.htm:35.13</a>, <tt class="literal">[</tt> <tt class="literal">-f</tt> <a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a></p>
ch04_19.htm:your Bourne shell exits (<a href="ch04_18.htm#upt3-CHP-4-SECT-18">Section 4.18</a>). Save your
ch04_19.htm:<b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>)
ch04_19.htm:(<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>), too -- you'll
ch04_19.htm:<p><tt class="literal">trap</tt> <a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a></p>
ch04_19.htm:<p><tt class="literal">exec &lt;</tt> <a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>,
ch04_19.htm:<tt class="literal">case</tt> <a href="ch35_11.htm#upt3-CHP-35-SECT-11">Section 35.11</a>,
ch04_19.htm:<tt class="literal">exec</tt> <a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>,
ch04_19.htm:<tt class="literal">-sh</tt> <a href="ch03_19.htm#upt3-CHP-3-SECT-19">Section 3.19</a></p>
ch04_19.htm:<p>The last line uses some trickery to start a new <b class="emphasis-bold">login shell</b> (<a href="ch03_19.htm#upt3-CHP-3-SECT-19">Section 3.19</a>).
ch04_19.htm:The shell <b class="emphasis-bold">closes your tty</b> (<a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>) before reading your
ch05_01.htm:files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>).
ch05_02.htm:<b class="emphasis-bold">cat</b> (<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>)
ch05_02.htm:or <b class="emphasis-bold">who</b> (<a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a>) that use the terminal screen as a sort of
ch05_02.htm:the late 1970s, Bill Joy created the <b class="emphasis-bold">vi</b> (<a href="ch17_02.htm#upt3-CHP-17-SECT-2">Section 17.2</a>) text editor
ch05_02.htm:<b class="emphasis-bold">and</b> <b class="emphasis-bold">emacs</b> (<a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>), which
ch05_02.htm:(<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>), <i class="command">ul</i>, and
ch05_03.htm:file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) -- like
ch05_03.htm:variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>):
ch05_03.htm:<b class="emphasis-bold">/etc/ttytype</b> (<a href="ch03_15.htm#upt3-CHP-3-SECT-15">Section 3.15</a>). But if, like many Unix users, you might log
ch05_03.htm:set up various <b class="emphasis-bold">tests</b> (<a href="ch03_10.htm#upt3-CHP-3-SECT-10">Section 3.10</a>) in your shell setup files to do this.
ch05_03.htm:<p>If no <b class="emphasis-bold">arguments</b> (<a href="ch01_04.htm#upt3-CHP-1-SECT-4">Section 1.4</a>) are specified and <em class="emphasis">TERM</em>
ch05_03.htm:the value determined for the terminal type to <b class="emphasis-bold">standard output</b> (<a name="IXT-5-7298" /><a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>).
ch05_03.htm:terminal</b> (<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>), but keeps the
ch05_03.htm:(<a name="IXT-5-7300" /><a name="IXT-5-7301" /><a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) surrounding
ch05_03.htm:<b class="emphasis-bold">eval</b> (<a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a>)
ch05_03.htm:also allow you to <b class="emphasis-bold">set the</b> <b class="emphasis-bold">TERMCAP</b><a name="IXT-5-7304" /> <b class="emphasis-bold">variable</b> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>). (You
ch05_04.htm:<p><b class="emphasis-bold">tset</b> (<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>)
ch05_04.htm:<p><tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch05_04.htm:<tt class="literal">as</tt> <tt class="literal">...</tt> is sent to <b class="emphasis-bold">standard error</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>);
ch05_04.htm:only the terminal type itself is sent to <b class="emphasis-bold">standard output</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>). So if you use the following command line:
ch05_04.htm:currently using an <b class="emphasis-bold">xterm</b> (<a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>) window, but <i class="command">qterm</i> thinks
ch05_05.htm:with the shell commands <i class="command">source</i> or <b class="emphasis-bold">.</b> (<a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>), or
ch05_05.htm:(<a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a>). For example, after resizing a window,
ch05_05.htm:<p><tt class="literal">`...`</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch05_06.htm:<p>Have another user look at your shell's <b class="emphasis-bold">setup files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>).
ch05_06.htm:won't see them as you log in. (If you have <b class="emphasis-bold">superuser access</b> (<a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>), you also can use it to rename the
ch05_06.htm:(<a name="IXT-5-7340" /><a name="IXT-5-7341" /><a href="ch27_15.htm#upt3-CHP-27-SECT-15">Section 27.15</a>) on the stuck account's setup
ch05_06.htm:You might use <a name="IXT-5-7348" /><b class="emphasis-bold">ls -l</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>) to check.
ch05_06.htm:<b class="emphasis-bold">file</b> (<a href="ch22_03.htm#upt3-CHP-22-SECT-3">Section 22.3</a>)
ch05_06.htm:(by NFS)</b> (<a name="IXT-5-7353" /><a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>)?
ch05_06.htm:(<a href="ch23_01.htm#upt3-CHP-23-SECT-1">Section 23.1</a>); if the job is stopped, restart it.
ch05_06.htm:<b class="emphasis-bold">or</b> <b class="emphasis-bold">ssh</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>), the
ch05_06.htm:<p><a name="IXT-5-7386" />Enter the command <b class="emphasis-bold">kill PID</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>), where
ch05_06.htm:<p>The <b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>) command, which lists some or all of the
ch05_08.htm:<b class="emphasis-bold">xmodmap</b> (<a href="ch05_01.htm#upt3-CHP-5-SECT-1">Section 5.1</a>) command. Newer shells, like
ch05_08.htm:(<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>). Check your shell's
ch05_08.htm:<b class="emphasis-bold">stty</b><a name="IXT-5-7399" /> (<a href="ch05_07.htm#upt3-CHP-5-SECT-7">Section 5.7</a>)
ch05_08.htm:character so the shell won't treat it as a <b class="emphasis-bold">wildcard</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>):
ch05_08.htm:<p><a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a></p>
ch05_08.htm:<p><a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a></p>
ch05_08.htm:<p><a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a></p>
ch05_08.htm:<p><a href="ch24_11.htm#upt3-CHP-24-SECT-11">Section 24.11</a></p>
ch05_08.htm:<p><a href="ch24_11.htm#upt3-CHP-24-SECT-11">Section 24.11</a></p>
ch05_08.htm:<p><a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a></p>
ch05_08.htm:<p><a href="ch28_02.htm#upt3-CHP-28-SECT-2">Section 28.2</a></p>
ch05_08.htm:everything</b> (<a href="ch41_03.htm#upt3-CHP-41-SECT-3">Section 41.3</a>) will tell you
ch05_08.htm:which. <a href="ch05_07.htm#upt3-CHP-5-SECT-7">Section 5.7</a> shows how to change
ch05_08.htm:<b class="emphasis-bold">shell prompt</b> (<a href="ch04_01.htm#upt3-CHP-4-SECT-1">Section 4.1</a>)) and in other places where the terminal is
ch05_08.htm:also <b class="emphasis-bold">fools around</b> (<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>) with key settings. Therefore, in your
ch05_08.htm:<b class="emphasis-bold">shell setup files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>), put <i class="command">stty</i> after
ch05_09.htm:<p>Specifying and using a scrollbar (<a href="ch05_11.htm#upt3-CHP-5-SECT-11">Section 5.11</a>). 
ch05_09.htm:<p>Copying and pasting text selections (<a href="ch05_13.htm#upt3-CHP-5-SECT-13">Section 5.13</a>). 
ch05_09.htm:<p>Modifying text-selection behavior (<a href="ch05_14.htm#upt3-CHP-5-SECT-14">Section 5.14</a>). 
ch05_09.htm:titlebar (<a href="ch05_15.htm#upt3-CHP-5-SECT-15">Section 5.15</a>).
ch05_09.htm:<p>Dynamically changing fonts and other features (<a href="ch05_17.htm#upt3-CHP-5-SECT-17">Section 5.17</a>, <a href="ch05_18.htm#upt3-CHP-5-SECT-18">Section 5.18</a>).
ch05_09.htm:<i class="command">xmodmap</i> (<a href="ch06_01.htm#upt3-CHP-6-SECT-1">Section 6.1</a>) lets
ch05_10.htm:<b class="emphasis-bold">login shell</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>), give it the
ch05_10.htm:(<a href="ch06_05.htm#upt3-CHP-6-SECT-5">Section 6.5</a>):
ch05_11.htm:<b class="emphasis-bold">resource</b> (<a href="ch06_05.htm#upt3-CHP-6-SECT-5">Section 6.5</a>) to <tt class="literal">true</tt>:
ch05_11.htm:Options</b><a name="IXT-5-7431" /> <b class="emphasis-bold">menu</b> (<a href="ch05_17.htm#upt3-CHP-5-SECT-17">Section 5.17</a>) by holding
ch05_12.htm:use the <b class="emphasis-bold">scrollbar in</b> <b class="emphasis-bold">xterm</b> (<a href="ch05_11.htm#upt3-CHP-5-SECT-11">Section 5.11</a>),
ch05_14.htm:(<a href="ch05_13.htm#upt3-CHP-5-SECT-13">Section 5.13</a>) in an <i class="command">xterm</i>, and
ch05_14.htm:you've probably discovered that <b class="emphasis-bold">double-clicking</b> <a href="ch05_13.htm#upt3-CHP-5-SECT-13">Section 5.13</a>
ch05_14.htm:<a name="IXT-5-7454" /><tt class="literal">charClass</tt> <b class="emphasis-bold">resource variable</b> (<a href="ch06_03.htm#upt3-CHP-6-SECT-3">Section 6.3</a>). The value this resource accepts is a
ch05_15.htm:unobtrusive. I do this by adding a few lines to my <b class="emphasis-bold">shell setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>). <a href="ch04_08.htm#upt3-CHP-4-SECT-8">Section 4.8</a>
ch05_16.htm:<b class="emphasis-bold">shell aliases</b> (<a href="ch29_01.htm#upt3-CHP-29-SECT-1">Section 29.1</a>). Also note that terminals should use
ch05_16.htm:variable</b> (<a href="ch06_03.htm#upt3-CHP-6-SECT-3">Section 6.3</a>):
ch05_17.htm:<a href="ch05_18.htm#upt3-CHP-5-SECT-18">Section 5.18</a> for information on using the
ch05_17.htm:a <b class="emphasis-bold">resource file</b> (<a href="ch06_05.htm#upt3-CHP-6-SECT-5">Section 6.5</a>). See the <i class="command">xterm</i> manpage for
ch05_17.htm:<p><a name="IXT-5-7479" />Note that a Release 5 <b class="emphasis-bold">patch</b> (<a href="ch20_09.htm#upt3-CHP-20-SECT-9">Section 20.9</a>) has
ch05_18.htm:prefer, including the display font. I use the very large <b class="emphasis-bold">10&#215;20-pixel font</b> (<a href="ch05_16.htm#upt3-CHP-5-SECT-16">Section 5.16</a>) for all my <i class="command">xterm</i> windows
ch05_18.htm:variable</b> (<a href="ch06_03.htm#upt3-CHP-6-SECT-3">Section 6.3</a>):
ch05_18.htm:<p><a name="IXT-5-7481" /><a name="IXT-5-7482" />The <i class="command">xterm</i> <b class="emphasis-bold">VT Fonts menu</b> (<a href="ch05_17.htm#upt3-CHP-5-SECT-17">Section 5.17</a>)
ch05_18.htm:selection</b> (<a href="ch05_13.htm#upt3-CHP-5-SECT-13">Section 5.13</a>). However,
ch05_18.htm:alias</b> (<a href="ch05_16.htm#upt3-CHP-5-SECT-16">Section 5.16</a>), but you could use a
ch05_19.htm:multiple <b class="emphasis-bold">text selections</b> (<a href="ch05_13.htm#upt3-CHP-5-SECT-13">Section 5.13</a>) and <a name="upt3-IDXTERM-1048" /> <a name="upt3-IDXTERM-1049" />copy them to other windows. Text you copy
ch05_19.htm:selection. You set this up to happen by specifying a few <b class="emphasis-bold">translations</b> (<a href="ch05_04.htm#upt3-CHP-5-SECT-4">Section 6.4</a>)
ch05_19.htm:horizontally, vertically, or both), <b class="emphasis-bold">scrollbars</b> (<a href="ch05_11.htm#upt3-CHP-5-SECT-11">Section 5.11</a>) will
ch05_21.htm:usually a text editor (like <i class="command">vi</i>, with its <b class="emphasis-bold">keymaps for pasting text</b> (<a href="ch18_05.htm#upt3-CHP-18-SECT-5">Section 18.5</a>)). 
ch05_21.htm:<i class="command">vi</i><a name="IXT-5-7505" /> <b class="emphasis-bold">filter-through</b> (<a href="ch17_18.htm#upt3-CHP-17-SECT-18">Section 17.18</a>):
ch05_21.htm:<p><tt class="literal">${1+"$@"}</tt> <a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch05_21.htm:output is piped to <b class="emphasis-bold">fmt</b> (<a href="ch21_02.htm#upt3-CHP-21-SECT-2">Section 21.2</a>) to make the lines neat. (Without
ch05_21.htm:whitespace, then <b class="emphasis-bold">emails</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) the text to <em class="emphasis">ali</em>.
ch05_22.htm:other command-line options</b> (<a href="ch05_15.htm#upt3-CHP-5-SECT-15">Section 5.15</a>)). 
ch05_22.htm:<b class="emphasis-bold">file</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>),
ch05_22.htm:<p><tt class="literal">tail</tt> <tt class="literal">-f</tt> <a href="ch12_10.htm#upt3-CHP-12-SECT-10">Section 12.10</a> 
ch05_22.htm:<p><a href="ch24_21.htm#upt3-CHP-24-SECT-21">Section 24.21</a> has more about how this works.</p>
ch06_02.htm:(<a href="ch06_01.htm#upt3-CHP-6-SECT-1">Section 6.1</a>). When you start up
ch06_02.htm:-pk</tt> (<a href="ch05_01.htm#upt3-CHP-5-SECT-1">Section 5.1</a>), you should see a line
ch06_03.htm:function</b> (<a href="ch29_01.htm#upt3-CHP-29-SECT-1">Section 29.1</a>), for instance) to
ch06_04.htm:control actions of things like mouse clicks. <a href="ch06_03.htm#upt3-CHP-6-SECT-3">Section 6.3</a> introduces X resources and shows their syntax.
ch06_04.htm:<a href="ch06_05.htm#upt3-CHP-6-SECT-5">Section 6.5</a> through <a href="ch06_09.htm#upt3-CHP-6-SECT-9">Section 6.9</a> explain how to set and check
ch06_05.htm:server by the <b class="emphasis-bold">xrdb</b> (<a href="ch06_08.htm#upt3-CHP-6-SECT-8">Section 56.8</a>) client, which is normally run from your
ch06_05.htm:<p><a href="ch06_06.htm#upt3-CHP-6-SECT-6">Section 6.6</a> takes a look at the use of the
ch06_05.htm:<a href="ch06_07.htm#upt3-CHP-6-SECT-7">Section 6.7</a> covers <span class="option">-name</span>.
ch06_05.htm:<a href="ch06_08.htm#upt3-CHP-6-SECT-8">Section 6.8</a> discusses various ways you can
ch06_05.htm:load resources using the <i class="command">xrdb</i> program. <a href="ch06_09.htm#upt3-CHP-6-SECT-9">Section 6.9</a> shows how to list the resources for a
ch06_06.htm:any specification that you would otherwise put into a <b class="emphasis-bold">resources file</b> (<a href="ch06_05.htm#upt3-CHP-6-SECT-5">Section 6.5</a>).
ch06_10.htm:(<a name="IXT-6-927" /><a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>), its X
ch06_10.htm:are using the wrong <i class="command">rsh</i> command. Use the <b class="emphasis-bold">which</b> (<a name="IXT-6-941" /> <a name="IXT-6-942" /><a href="ch01_06.htm#upt3-CHP-1-SECT-6">Section 1.6</a>) or <b class="emphasis-bold">whereis</b> (<a href="ch01_03.htm#upt3-CHP-1-SECT-3">Section 1.3</a>) command
ch06_10.htm:file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) on the remote system.
ch06_10.htm:setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) on the remote
ch06_10.htm:<a href="ch35_08.htm#upt3-CHP-35-SECT-8">Section 35.8</a> for more information on setting
ch07_01.htm:<p>When you look at a new computer user's <b class="emphasis-bold">home directory</b> (<a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a>)
ch07_01.htm:we'll show some scripts that use the <b class="emphasis-bold">find</b> (<a href="ch08_03.htm#upt3-CHP-8-SECT-3">Section 8.3</a>) and
ch07_01.htm:<b class="emphasis-bold">grep</b> (<a href="ch09_21.htm#upt3-CHP-9-SECT-21">Section 9.21</a>)
ch07_03.htm:(<a name="IXT-7-6920" /><a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>) for
ch07_03.htm:<p>The <b class="emphasis-bold">SUID bit</b> (<a href="ch50_04.htm#upt3-CHP-50-SECT-4">Section 50.4</a>) is meaningless for directories, but the
ch07_05.htm:created a private directory, you should set its <b class="emphasis-bold">file access mode</b> (<a name="IXT-7-6945" /> <a name="IXT-7-6946" /><a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>) to <tt class="literal">700</tt>; this means that
ch07_05.htm:(<a name="IXT-7-6947" /><a href="ch49_09.htm#upt3-CHP-49-SECT-9">Section 49.9</a>) and read any files he wants. So a private
ch08_01.htm:excluding the <b class="emphasis-bold">find</b> (<a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a>) utility itself because it's
ch08_03.htm:<a href="ch08_02.htm#upt3-CHP-8-SECT-2">Section 8.2</a>.)
ch08_03.htm:<p>In this example, I'll show you my <b class="emphasis-bold">bin</b> (<a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>) directory
ch08_03.htm:<a name="IXT-8-6546" />file-time comparisons <b class="emphasis-bold">in a script</b> (<a href="ch08_15.htm#upt3-CHP-8-SECT-15">Section 8.15</a>).
ch08_04.htm:might want to pipe the output to a pager program such as <b class="emphasis-bold">less</b> (<a name="IXT-8-6562" /><a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>). The
ch08_06.htm:described later in this section. You may also want to look at <a href="ch08_06.htm#upt3-CHP-8-SECT-6.4">Section 8.6.4</a> for another
ch08_06.htm:(<a name="IXT-8-6573" /><a href="ch21_04.htm#upt3-CHP-21-SECT-4">Section 12.4</a>) command
ch08_06.htm:<b class="emphasis-bold">termcap or terminfo entry</b> (<a href="ch05_02.htm#upt3-CHP-5-SECT-2">Section 5.2</a>) (which should define the sequences) and the
ch08_06.htm:at <a href="ch08_06.htm#upt3-CHP-8-SECT-6.4">Section 8.6.4</a> for another way to configure color
ch08_06.htm:<i class="command">dircolors</i> command -- typically in a <b class="emphasis-bold">shell setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>): 
ch08_06.htm:<p><tt class="literal">eval</tt> <a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section
ch08_06.htm:27.8</a><tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a> 
ch08_06.htm:type</b> (<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a>) names that understand
ch08_06.htm:in</b> (<a href="ch03_10.htm#upt3-CHP-3-SECT-10">Section 3.10</a>).) The second section has
ch08_06.htm:users need to make an <b class="emphasis-bold">alias</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>, <a href="ch29_04.htm#upt3-CHP-29-SECT-4">Section 29.4</a>) for
ch08_07.htm:as its <b class="emphasis-bold">info page</b> (<a href="ch02_09.htm#upt3-CHP-2-SECT-9">Section 2.9</a>) says, "Because
ch08_07.htm:file</b> (<a href="ch19_04.htm#upt3-CHP-19-SECT-4">Section 19.4</a>) has a name ending in
ch08_07.htm:expand it first -- you need to <b class="emphasis-bold">quote</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) the
ch08_07.htm:<b class="emphasis-bold">sort -n</b> (<a href="ch22_05.htm#upt3-CHP-22-SECT-5">Section 22.5</a>) and sort on the size field, then strip off
ch08_08.htm:option</b> (<a href="ch08_03.htm#upt3-CHP-8-SECT-3">Section 8.3</a>) to
ch08_08.htm:keep it from being interpreted when we set the alias.) <b class="emphasis-bold">head</b> (<a href="ch12_12.htm#upt3-CHP-12-SECT-12">Section 12.12</a>) shows just
ch08_09.htm:entries</b> (<a href="ch10_02.htm#upt3-CHP-10-SECT-2">Section 10.2</a>).
ch08_10.htm:or -A option</b> (<a name="IXT-8-6624" /><a href="ch08_09.htm#upt3-CHP-8-SECT-9">Section 8.9</a>)
ch08_10.htm:<p>The file is a <b class="emphasis-bold">symbolic link</b><a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>). 
ch08_10.htm:<a href="ch43_11.htm#upt3-CHP-43-SECT-11">Section 43.11</a>).
ch08_10.htm:prints this extra information, but also supports <b class="emphasis-bold">color</b> (<a href="ch08_06.htm#upt3-CHP-8-SECT-6">Section 8.6</a>) and
ch08_11.htm:<p><tt class="literal">-v</tt> <a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section
ch08_11.htm:12.4</a>, <tt class="literal">-t</tt> <tt class="literal">-e</tt> <a href="ch12_05.htm#upt3-CHP-12-SECT-5">Section 1125</a> 
ch08_11.htm:default <b class="emphasis-bold">ls -q</b> (<a href="ch08_12.htm#upt3-CHP-8-SECT-12">Section 8.12</a>) option (on many Unix versions) shows them as
ch08_11.htm:<p>The <b class="emphasis-bold">quotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) tell the shell to include the space as part
ch08_12.htm:<a href="ch14_03.htm#upt3-CHP-14-SECT-3">Section 14.3</a> for the rest of the gruesome
ch08_12.htm:<b class="emphasis-bold">(</b><a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>) to
ch08_13.htm:<p><a name="IXT-8-6666" /><a name="IXT-8-6667" /> <a name="IXT-8-6668" /><a name="IXT-8-6669" />I use <b class="emphasis-bold">awk</b> (<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>) a lot. One
ch08_13.htm:<b class="emphasis-bold">file</b> (<a href="ch12_06.htm#upt3-CHP-12-SECT-6">Section 12.6</a>)
ch08_13.htm:<p><tt class="literal">xargs</tt> <a href="ch28_17.htm#upt3-CHP-28-SECT-17">Section 28.17</a></p>
ch08_14.htm:<p><tt class="literal">xargs</tt> <a href="ch28_17.htm#upt3-CHP-28-SECT-17">Section 28.17</a></p>
ch08_15.htm:<p><tt class="literal">-d</tt> <a href="ch08_05.htm#upt3-CHP-8-SECT-5">Section 8.5</a></p>
ch08_15.htm:<p>If your system doesn't have a <b class="emphasis-bold">head</b> (<a name="IXT-8-6682" /> <a name="IXT-8-6683" /><a href="ch12_12.htm#upt3-CHP-12-SECT-12">Section 12.12</a>) command, use <em class="emphasis">sed 1q</em>
ch08_15.htm:substitution</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) to handle this
ch08_16.htm:(<a href="ch10_06.htm#upt3-CHP-10-SECT-6">Section 10.6</a>). The link and the file itself are
ch08_16.htm:automatically), you can use the output of the script in <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>). For
ch08_17.htm:number</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>), available in the
ch08_17.htm:<p>Use a <tt class="literal">+</tt> parameter and <b class="emphasis-bold">backquotes</b> (<a name="IXT-8-6698" /><tt class="literal">``</tt>) (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) to get a temp file named for the current date
ch09_02.htm:(<a href="ch38_03.htm#upt3-CHP-38-SECT-3">Section 38.3</a>), <em class="filename">du</em>, and
ch09_02.htm:<em class="filename">diff</em> do this. Some versions of <b class="emphasis-bold">chmod</b> (<a href="ch50_05.htm#upt3-CHP-50-SECT-5">Section 50.5</a>),
ch09_04.htm:can look for particular files by using an expression with <b class="emphasis-bold">wildcards</b> (<a href="ch28_03.htm#upt3-CHP-28-SECT-3">Section 28.3</a>) as an
ch09_04.htm:<p><a href="ch09_27.htm#upt3-CHP-9-SECT-27">Section 9.27</a> shows a way to match directories
ch09_05.htm:<p><a href="ch08_02.htm#upt3-CHP-8-SECT-2">Section 8.2</a> has more information about these
ch09_05.htm:three times, and <a href="ch09_07.htm#upt3-CHP-9-SECT-7">Section 9.7</a> explains how
ch09_07.htm:with <b class="emphasis-bold">touch</b> <a href="ch09_08.htm#upt3-CHP-9-SECT-8">Section 9.8</a>).
ch09_09.htm:something, like <b class="emphasis-bold">grep</b> (<a href="ch13_02.htm#upt3-CHP-13-SECT-2">Section 13.2</a>) for a text string. To do this, use the
ch09_09.htm:the output of <em class="filename">find</em> to <b class="emphasis-bold">xargs</b> (<a href="ch28_17.htm#upt3-CHP-28-SECT-17">Section 28.17</a>). However,
ch09_09.htm:<p>The <b class="emphasis-bold">C shell</b> (<a name="IXT-9-52" /><a href="ch29_01.htm#upt3-CHP-29-SECT-1">Section 29.1</a>) uses
ch09_09.htm:<p><a href="ch09_12.htm#upt3-CHP-9-SECT-12">Section 9.12</a> and <a href="ch09_27.htm#upt3-CHP-9-SECT-27">Section 9.27</a> have more examples of
ch09_12.htm:<p>As we said in <a href="ch09_06.htm#upt3-CHP-9-SECT-6">Section 9.6</a>,
ch09_15.htm:<a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a> is good background reading.
ch09_18.htm:your own private <i class="command">locate</i> database, or see <a href="ch09_20.htm#upt3-CHP-9-SECT-20">Section 9.20</a>.)
ch09_18.htm:limit searches. <a href="ch09_19.htm#upt3-CHP-9-SECT-19">Section 9.19</a> explains this in
ch09_19.htm:(<a name="IXT-9-126" /><a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>) (<tt class="literal">*</tt><a name="IXT-9-127" /> <a name="IXT-9-128" /> <a name="IXT-9-129" />,
ch09_20.htm:<p>The script starts from your home directory, then uses <b class="emphasis-bold">sed</b> (<a href="ch13_09.htm#upt3-CHP-13-SECT-9">Section 13.9</a>) to strip
ch09_20.htm:<p>Set up <b class="emphasis-bold">cron</b> (<a href="ch25_03.htm#upt3-CHP-25-SECT-3">Section 25.3</a>) or <a href="at">at</a> to
ch09_20.htm:to search the database. If you use <b class="emphasis-bold">egrep</b> (<a href="ch13_04.htm#upt3-CHP-13-SECT-4">Section 13.4</a>), you can
ch09_21.htm:<p>That trick is also good when you use a <b class="emphasis-bold">wildcard</b> (<a href="ch28_03.htm#upt3-CHP-28-SECT-3">Section 28.3</a>) and
ch09_25.htm:<p><a href="ch09_27.htm#upt3-CHP-9-SECT-27">Section 9.27</a> shows handy aliases that use
ch09_27.htm:<a href="ch09_18.htm#upt3-CHP-9-SECT-18">Section 9.18</a>.
ch09_27.htm:expressions in other articles, especially <a href="ch09_06.htm#upt3-CHP-9-SECT-6">Section 9.6</a> and <a href="ch09_12.htm#upt3-CHP-9-SECT-12">Section 9.12</a>.
ch10_01.htm:even on different filesystems, that point to the same file. <a href="ch10_03.htm#upt3-CHP-10-SECT-3">Section 10.3</a> explores the reasons why you want to do
ch10_01.htm:that; <a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a> discusses the difference
ch10_01.htm:"soft" links; <a href="ch10_05.htm#upt3-CHP-10-SECT-5">Section 10.5</a> demonstrates how to create links; and other
ch10_01.htm:another. <a href="ch10_12.htm#upt3-CHP-10-SECT-12">Section 10.12</a> and <a href="ch10_13.htm#upt3-CHP-10-SECT-13">Section 10.13</a> demonstrate two techniques you can use to
ch10_03.htm:hard <b class="emphasis-bold">links</b> (<a href="ch10_01.htm#upt3-CHP-10-SECT-1">Section 10.1</a>) and symbolic links in a number of places, but
ch10_03.htm:<p><tt class="literal">..</tt> <a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a></p>
ch10_04.htm:(<a href="ch44_09.htm#upt3-CHP-44-SECT-9">Section 44.9</a>)). You can make a symbolic link to a
ch10_04.htm:names that can access it. <a href="ch10_05.htm#upt3-CHP-10-SECT-5">Section 10.5</a> shows
ch10_04.htm:point to this inode. <a href="ch09_24.htm#upt3-CHP-9-SECT-24">Section 9.24</a> shows how
ch10_04.htm:option</b><a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>) and, probably, the
ch10_04.htm:<b class="emphasis-bold">-a option</b> <a href="ch08_09.htm#upt3-CHP-8-SECT-9">Section 8.9</a>) for listing "dot
ch10_04.htm:<b class="emphasis-bold">i-number</b><a href="ch14_02.htm#upt3-CHP-14-SECT-2">Section 14.2</a>)<a name="IXT-10-6357" /> for each entry in the directory; see
ch10_04.htm:<tt class="literal">.</tt> and <tt class="literal">..</tt> in <b class="emphasis-bold">pathnames</b> <a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>);
ch10_04.htm:what's in a directory</b><a href="ch10_02.htm#upt3-CHP-10-SECT-2">Section 10.2</a>). The <tt class="literal">.</tt> entry is a link
ch10_04.htm:<p><tt class="literal">-d</tt> <a href="ch08_05.htm#upt3-CHP-8-SECT-5">Section 8.5</a></p>
ch10_05.htm:<em class="filename">ln</em><a name="IXT-10-6369" /> command creates both <b class="emphasis-bold">hard and soft (symbolic) links</b> <a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>). If by some strange chance
ch10_05.htm:<p><tt class="literal">..</tt> <a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a></p>
ch10_05.htm:<p><tt class="literal">.</tt> <a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a></p>
ch10_05.htm:<p>You can replace this list of files with a <b class="emphasis-bold">wildcard expression</b> <a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>), as in:
ch10_05.htm:<p>Note that <a name="IXT-10-6372" /><a name="IXT-10-6373" /><a name="IXT-10-6374" /><a name="IXT-10-6375" />symbolic links can get <b class="emphasis-bold">out-of-date</b> <a href="ch09_06.htm#upt3-CHP-9-SECT-6">Section 10.6</a>).
ch10_05.htm:<b class="emphasis-bold">find the links</b><a href="ch09_24.htm#upt3-CHP-9-SECT-24">Section 9.24</a>) to each file.
ch10_06.htm:(<a name="IXT-10-6377" /><a name="IXT-10-6378" /> <a name="IXT-10-6379" /><a name="IXT-10-6380" /><a href="ch10_05.htm#upt3-CHP-10-SECT-5">Section 10.5</a>) have one problem. Like good bread, they
ch10_06.htm:<a name="IXT-10-6382" /><b class="emphasis-bold">relative pathnames</b> <a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>) when appropriate. For instance, using
ch10_06.htm:<a href="ch09_13.htm#upt3-CHP-9-SECT-13">Section 10.13</a>) the
ch10_06.htm:pathnames</b> <a href="ch30_02.htm#upt3-CHP-30-SECT-2">Section 31.2</a>).
ch10_07.htm:(<a name="IXT-10-6386" /><a name="IXT-10-6387" /><a name="IXT-10-6388" /><a name="IXT-10-6389" /><a href="ch10_05.htm#upt3-CHP-10-SECT-5">Section 10.5</a>) (a.k.a.
ch10_07.htm:<p><tt class="literal">-F</tt> <a href="ch08_03.htm#upt3-CHP-8-SECT-3">Section 8.3</a></p>
ch10_09.htm:<p><tt class="literal">-d</tt> <a href="ch08_05.htm#upt3-CHP-8-SECT-5">Section
ch10_09.htm:8.5</a>, <tt class="literal">\(..\)..\1</tt> <a href="ch34_11.htm#upt3-CHP-34-SECT-11">Section 34.11</a></p>
ch10_09.htm:them to a <b class="emphasis-bold">shell</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>). The quotes help make
ch10_09.htm:sure that <b class="emphasis-bold">special characters</b> <a href="ch27_17.htm#upt3-CHP-27-SECT-17">Section 27.17</a>) aren't touched by the
ch10_09.htm:versions have the <b class="emphasis-bold">-i options</b> <a href="ch14_15.htm#upt3-CHP-14-SECT-15">Section 14.15</a>). Using <b class="emphasis-bold">sh
ch10_09.htm:-v</b> <a href="ch27_15.htm#upt3-CHP-27-SECT-15">Section 27.15</a>)<a name="IXT-10-6415" />
ch10_10.htm:<p><a name="IXT-10-6420" /><a name="IXT-10-6421" /><a name="IXT-10-6422" /><a href="ch10_09.htm#upt3-CHP-10-SECT-9">Section 10.9</a> shows how to rename a set of files, e.g.,
ch10_10.htm:<p><tt class="literal">&amp;&amp;</tt> <a href="ch34_10.htm#upt3-CHP-34-SECT-10">Section 34.10</a>, <tt class="literal">$</tt> <a href="ch32_05.htm#upt3-CHP-32-SECT-5">Section 32.5</a></p>
ch10_11.htm:<b class="emphasis-bold">script</b> (<a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>) that takes a list of filenames (perhaps
ch10_12.htm:<span class="option">-r</span> option. But it also has an <b class="emphasis-bold">rcp</b> (<a name="IXT-10-6423" /><a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) command that <em class="emphasis">does</em> have
ch10_12.htm:directory (.)</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>):
ch10_12.htm:<p><tt class="literal">[..]*</tt> <a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a></p>
ch10_12.htm:brace operators</b> (<a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a>):
ch10_12.htm:<p><b class="emphasis-bold">Symbolic and hard links</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) <a name="IXT-10-6424" /><a name="IXT-10-6425" /><a name="IXT-10-6426" /><a name="IXT-10-6427" />are
ch10_12.htm:syntax; <i class="command">scp</i> uses <b class="emphasis-bold">SSH</b> (<a href="ch46_06.htm#upt3-CHP-46-SECT-6">Section 46.6</a>) to do its
ch10_13.htm:(<a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>) command isn't just
ch10_13.htm:if your computer has <b class="emphasis-bold">cp -r</b> (<a href="ch10_12.htm#upt3-CHP-10-SECT-12">Section 10.12</a>), there are advantages to using
ch10_13.htm:different current directory</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>,
ch10_13.htm:<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) (the place where you want the copy
ch10_13.htm:<em class="replaceable"><tt>writing-tar</tt></em> in a <b class="emphasis-bold">subshell</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>), or if
ch10_13.htm:directories or files. Just be sure to use <b class="emphasis-bold">relative pathnames</b> (<a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>) that don't start with a
ch10_13.htm:<tt><b></b></tt><a name="IXT-10-6436" /><a name="IXT-10-6437" /><b class="emphasis-bold">&amp;&amp; operator</b> (<a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>) tells the shell to start <tt class="literal">tar xvf
ch10_13.htm:<p>Be aware that <b class="emphasis-bold">symbolic links</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) will be copied exactly. If they point to
ch10_13.htm:(<a href="ch10_06.htm#upt3-CHP-10-SECT-6">Section 10.6</a>). You can search for these symbolic
ch10_13.htm:(<a name="IXT-10-6439" /><a name="IXT-10-6440" /><a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) or <i class="command">ssh</i>, you can run either
ch11_01.htm:<b class="emphasis-bold">redirect standard output</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>) to capture this script in a file.)
ch11_01.htm:standard input of <b class="emphasis-bold">ed</b> (<a href="ch20_06.htm#upt3-CHP-20-SECT-6">Section 20.6</a>) or <i class="command">ex</i>; add a <b class="emphasis-bold">w command</b> (<a href="ch20_04.htm#upt3-CHP-20-SECT-4">Section 20.4</a>) at
ch11_01.htm:is used by both <b class="emphasis-bold">RCS and CVS</b> (<a href="ch39_04.htm#upt3-CHP-39-SECT-4">Section 39.4</a>) to manage multiple revisions of source code
ch11_02.htm:files. Here are three sample files, repeated from <a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>: 
ch11_02.htm:notation</b> (<a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>), the differences
ch11_03.htm:<a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a> and <a href="ch11_02.htm#upt3-CHP-11-SECT-2">Section 11.2</a> show compact formats with just the differences
ch11_03.htm:revisions in an <b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>) file (and will only be available if you have
ch11_03.htm:Incidentally, these examples would also work with <b class="emphasis-bold">cvs diff</b> (<a name="IXT-11-6064" /><a href="ch39_07.htm#upt3-CHP-39-SECT-7">Section 39.7</a>), if you
ch11_03.htm:aren't just nice for reading. The <b class="emphasis-bold">patch</b> (<a href="ch20_09.htm#upt3-CHP-20-SECT-9">Section 20.9</a>) program
ch11_03.htm:<i class="command">diff</i> over the formats in <a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a> and <a href="ch11_02.htm#upt3-CHP-11-SECT-2">Section 11.2</a> is that
ch11_04.htm:compares two files that contain the output of <b class="emphasis-bold">who</b> (<a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a>) at
ch11_04.htm:<p><a href="ch11_05.htm#upt3-CHP-11-SECT-5">Section 11.5</a> explains a very useful feature
ch11_05.htm:might be tempted to tackle with <b class="emphasis-bold">diff3</b> (<a href="ch11_02.htm#upt3-CHP-11-SECT-2">Section 11.2</a>) is
ch11_05.htm:effective way to do this would be to use <b class="emphasis-bold">sdiff</b> (<a href="ch11_04.htm#upt3-CHP-11-SECT-4">Section 11.4</a>). (Of
ch11_05.htm:place, by using <b class="emphasis-bold">RCS or CVS</b> (<a href="ch39_04.htm#upt3-CHP-39-SECT-4">Section 39.4</a>).) 
ch11_06.htm:(<a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>) utility adds extra characters
ch11_07.htm:(<a name="IXT-11-6087" /><a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>); it tells
ch11_07.htm:(<a name="IXT-11-6088" /><a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>) that
ch11_08.htm:(and must be <b class="emphasis-bold">sorted</b> (<a href="ch22_01.htm#upt3-CHP-22-SECT-1">Section 22.1</a>)). For the sake of illustration, assume each
ch11_09.htm:<p><a href="ch11_08.htm#upt3-CHP-11-SECT-8">Section 11.8</a> didn't show one
ch11_09.htm:<b class="emphasis-bold">who</b> (<a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a>)
ch11_10.htm:formatting options</b> (<a href="ch45_13.htm#upt3-CHP-45-SECT-13">Section 45.13</a>) need to
ch11_10.htm:(<a href="ch08_02.htm#upt3-CHP-8-SECT-2">Section 8.2</a>)
ch11_10.htm:generated by processing an unformatted file with <b class="emphasis-bold">nroff</b> <a href="ch45_12.htm#upt3-CHP-45-SECT-12">Section 45.12</a>).
ch11_10.htm:<p><tt class="literal">lp</tt> <a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a></p>
ch11_10.htm:file is more recent. After all the components are made, the <b class="emphasis-bold">lp</b> (<a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>) command is
ch11_11.htm:NIS</b> (<a name="IXT-11-6090" /><a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) (formerly called <span class="acronym">YP</span>, or
ch12_01.htm:approach provided by <b class="emphasis-bold">cat</b> (<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>), but there's more to it than
ch12_01.htm:<p>Pagers such as <b class="emphasis-bold">more and less</b> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) that give you more control when looking
ch12_01.htm:(<a href="ch12_06.htm#upt3-CHP-12-SECT-6">Section 12.6</a>).
ch12_01.htm:<p>Looking at just the beginning or end of a file (<a href="ch12_08.htm#upt3-CHP-12-SECT-8">Section 12.8</a> through <a href="ch12_12.htm#upt3-CHP-12-SECT-12">Section 12.12</a>).
ch12_01.htm:<p>Numbering lines (<a href="ch12_13.htm#upt3-CHP-12-SECT-13">Section 12.13</a>).</p>
ch12_02.htm:they illustrate the shell's <b class="emphasis-bold">output redirection</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>) mechanism.
ch12_02.htm:(<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>).<a href="#FOOTNOTE-43">[43]</a>
ch12_02.htm:<b class="emphasis-bold">pipe</b> <a href="ch01_05.htm#upt3-CHP-1-SECT-5">Section 1.5</a>).</p> </blockquote>
ch12_02.htm:<a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>, <a href="ch12_07.htm#upt3-CHP-12-SECT-7">Section 12.7</a>,
ch12_02.htm:and <a href="ch12_13.htm#upt3-CHP-12-SECT-13">Section 12.13</a> give some more useful tips about
ch12_03.htm:<i class="command">less</i> is reading from <b class="emphasis-bold">pipes</b> <a href="ch01_05.htm#upt3-CHP-1-SECT-5">Section 1.5</a>), it can
ch12_03.htm:favorite setup options in the <em class="emphasis">LESS</em> <b class="emphasis-bold">environment variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>). See the <i class="command">less</i> manpage for
ch12_03.htm:<i class="command">more</i>, <b class="emphasis-bold">vi</b> (<a href="ch17_02.htm#upt3-CHP-17-SECT-2">Section 17.2</a>), or <b class="emphasis-bold">emacs</b>
ch12_03.htm:(<a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>) file-browsing commands. Incidentally,
ch12_03.htm:characters</b> (<a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>).<a name="IXTR3-6517" /> <a name="IXTR3-6518" /> <a name="IXTR3-6519" /> <a name="IXTR3-6520" />
ch12_04.htm:to follow along on one of those systems, try a <b class="emphasis-bold">compressed file</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>)
ch12_04.htm:visible form without those options. See <a href="ch12_05.htm#upt3-CHP-12-SECT-5">Section 12.5</a>. 
ch12_04.htm:(<a name="IXT-12-6468" /><a href="ch13_15.htm#upt3-CHP-13-SECT-15">Section 13.15</a>) program finds printable strings of characters
ch12_05.htm:option</b> (<a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>) shows an
ch12_06.htm:<em class="emphasis">2650</em> is an <b class="emphasis-bold">nroff</b> (<a href="ch45_12.htm#upt3-CHP-45-SECT-12">Section 45.12</a>) file and
ch12_06.htm:<em class="emphasis">0001,v</em> is an <b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>) archive,
ch12_07.htm:(<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>) show all the blank lines between
ch12_07.htm:(<a name="IXT-12-6478" /> <a name="IXT-12-6479" /> <a name="IXT-12-6480" />Many versions of <b class="emphasis-bold">less</b> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) and
ch12_07.htm:<p>In <b class="emphasis-bold">vi</b> (<a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a>)
ch12_08.htm:lines, look at <a href="ch12_09.htm#upt3-CHP-12-SECT-9">Section 12.9</a>.
ch12_10.htm:<p><tt class="literal">&amp;</tt> <a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a></p>
ch12_10.htm:loop, you have to enter CTRL-c (or whatever your <b class="emphasis-bold">interrupt key</b> (<a href="ch24_11.htm#upt3-CHP-24-SECT-11">Section 24.11</a>)
ch12_10.htm:<p><a href="ch12_11.htm#upt3-CHP-12-SECT-11">Section 12.11</a> shows a useful feature of GNU
ch12_11.htm:(<a href="ch12_10.htm#upt3-CHP-12-SECT-10">Section 12.10</a>) is perfect for me.
ch12_11.htm:(<a name="IXT-12-6496" /><a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>) job to rotate log files (rename the files,
ch12_11.htm:<b class="emphasis-bold">file descriptor</b> (<a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>) number, which it constantly watches for
ch12_11.htm:<p><tt class="literal">{ }</tt> <a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a></p>
ch12_12.htm:<p>Like <b class="emphasis-bold">tail</b> (<a href="ch12_09.htm#upt3-CHP-12-SECT-9">Section 12.9</a>),
ch12_13.htm:the leading spaces with something like <b class="emphasis-bold">cut</b> (<a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>).
ch12_13.htm:and footer</b> (<a href="ch45_06.htm#upt3-CHP-45-SECT-6">Section 45.6</a>) it normally uses
ch13_01.htm:Great for searching with regular expressions (<a href="ch13_02.htm#upt3-CHP-13-SECT-2">Section 13.2</a>). 
ch13_01.htm:(<a href="ch13_04.htm#upt3-CHP-13-SECT-4">Section 13.4</a>).
ch13_01.htm:interesting ability to search for multiple strings (<a href="ch13_05.htm#upt3-CHP-13-SECT-5">Section 13.5</a>). 
ch13_01.htm:<i class="command">agrep</i> is introduced in <a href="ch13_06.htm#upt3-CHP-13-SECT-6">Section 13.6</a>. 
ch13_01.htm:Searches through <b class="emphasis-bold">RCS files</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>) (<a href="ch13_07.htm#upt3-CHP-13-SECT-7">Section 13.7</a>).
ch13_01.htm:several lines</b> (<a href="ch13_09.htm#upt3-CHP-13-SECT-9">Section 13.9</a>) and other
ch13_01.htm:<b class="emphasis-bold">programs</b> (<a href="ch41_12.htm#upt3-CHP-41-SECT-12">Section 41.12</a>), which show you a few lines before and after
ch13_02.htm:<p><tt class="literal">".."</tt> <a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a></p>
ch13_02.htm:<p><i class="command">grep</i><a name="IXT-13-5838" /> is also often used as a <b class="emphasis-bold">filter</b> (<a href="ch01_05.htm#upt3-CHP-1-SECT-5">Section 1.5</a>), to
ch13_02.htm:(<a name="IXT-13-5839" /> <a name="IXT-13-5840" /><a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>) and
ch13_02.htm:option</b> (<a href="ch13_03.htm#upt3-CHP-13-SECT-3">Section 13.3</a>) reverses the normal
ch13_03.htm:thousands of separate files under <b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>), and I
ch13_03.htm:version of the <i class="command">find.</i> alias described in <a href="ch09_26.htm#upt3-CHP-9-SECT-26">Section 9.26</a>, with <em class="emphasis">-user tim</em>
ch13_03.htm:using<b class="emphasis-bold"> egrep</b> (<a href="ch13_04.htm#upt3-CHP-13-SECT-4">Section 13.4</a>), which supports the <a name="IXT-13-5853" /> <a name="IXT-13-5854" />plus
ch13_04.htm:<i class="command">egrep</i> command is yet another version of <b class="emphasis-bold">grep</b> (<a href="ch13_02.htm#upt3-CHP-13-SECT-2">Section 13.2</a>), one that
ch13_04.htm:option</b> (<a href="ch13_05.htm#upt3-CHP-13-SECT-5">Section 13.5</a>).
ch13_05.htm:<p><b class="emphasis-bold">egrep</b> (<a name="IXT-13-5865" /><a href="ch13_04.htm#upt3-CHP-13-SECT-4">Section 13.4</a>) lets you look
ch13_05.htm:<p>(To be more accurate, we used <b class="emphasis-bold">rcsegrep</b> (<a href="ch13_07.htm#upt3-CHP-13-SECT-7">Section 13.7</a>), since
ch13_05.htm:(<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>), but you get the idea.)
ch13_06.htm:<p>outputs all <b class="emphasis-bold">mail messages</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) (delimited by a line beginning with
ch13_07.htm:<b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>)
ch13_07.htm:(<a href="ch13_04.htm#upt3-CHP-13-SECT-4">Section 13.4</a>), and <i class="command">fgrep</i> on all
ch13_07.htm:(<i class="command">rcsgrep</i> uses <b class="emphasis-bold">rcsrevs</b> (<a href="ch39_06.htm#upt3-CHP-39-SECT-6">Section 39.6</a>) to
ch13_07.htm:process: a <b class="emphasis-bold">gawk</b> (<a href="ch20_11.htm#upt3-CHP-20-SECT-11">Section 20.11</a>) script. Instead of using the RCS
ch13_09.htm:across two lines. <b class="emphasis-bold">agrep</b> (<a href="ch13_06.htm#upt3-CHP-13-SECT-6">Section 13.6</a>) can do multiline searches. One advantage of
ch13_09.htm:<p>It may surprise you to learn that a fairly decent <b class="emphasis-bold">context grep</b> (<a href="ch13_08.htm#upt3-CHP-13-SECT-8">Section 13.8</a>)
ch13_10.htm:using the <b class="emphasis-bold">egrep</b> (<a href="ch13_04.htm#upt3-CHP-13-SECT-4">Section 13.4</a>) <tt class="literal">|</tt> metacharacter:
ch13_10.htm:patterns matching one consecutive string of text. Well, <b class="emphasis-bold">agrep</b> (<a href="ch13_06.htm#upt3-CHP-13-SECT-6">Section 13.6</a>) is one
ch13_10.htm:(<a name="IXT-13-5905" /><a href="ch27_17.htm#upt3-CHP-27-SECT-17">Section 27.17</a>) to
ch13_11.htm:mechanism</b> (<a name="IXT-13-5908" /><a href="ch30_02.htm#upt3-CHP-30-SECT-2">Section 30.2</a>) and
ch13_11.htm:understand <b class="emphasis-bold">shell quoting</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) and <i class="command">sed</i> regular
ch13_11.htm:<p>[Yes, you can do the exact same thing with multiple <b class="emphasis-bold"> grep -v</b> (<a name="IXT-13-5910" /><a href="ch13_03.htm#upt3-CHP-13-SECT-3">Section 13.3</a>) commands,
ch13_13.htm:following simple <b class="emphasis-bold">awk</b> (<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>) command:
ch13_14.htm:problems: it works only on files that have been <b class="emphasis-bold">sorted</b> (<a href="ch22_01.htm#upt3-CHP-22-SECT-1">Section 22.1</a>). If you
ch13_14.htm:word; see <a href="ch16_03.htm#upt3-CHP-16-SECT-3">Section 16.3</a>. If you
ch13_15.htm:<b class="emphasis-bold">cat -v</b> (<a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>), you'll see a lot of
ch13_15.htm:too. But what the heck?  --  pipe the output to <b class="emphasis-bold">a pager</b> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) or
ch13_15.htm:<b class="emphasis-bold">grep</b> (<a href="ch13_02.htm#upt3-CHP-13-SECT-2">Section 13.2</a>),
ch13_15.htm:<b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>) -- you can see the version number, the
ch13_16.htm:<p>The <b class="emphasis-bold">less</b> (<a name="IXT-13-5931" /><a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) pager
ch14_02.htm:(<a name="IXT-14-6211" /><a href="ch09_24.htm#upt3-CHP-9-SECT-24">Section 9.24</a>, <a href="ch10_03.htm#upt3-CHP-10-SECT-3">Section 10.3</a>) to a file. But you do care about the
ch14_02.htm:<a name="IXT-14-6214" /><dt><i>The file's <b class="emphasis-bold">access mode</b> (<a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a>, <a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>)</i></dt>
ch14_02.htm:<a name="IXT-14-6215" /><dt><i>The file's <b class="emphasis-bold">timestamps</b> (<a href="ch08_02.htm#upt3-CHP-8-SECT-2">Section 8.2</a>)</i></dt>
ch14_02.htm:(<a href="ch01_19.htm#upt3-CHP-1-SECT-19">Section 1.19</a>) as a file
ch14_02.htm:<b class="emphasis-bold">ls -l</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>)
ch14_02.htm:-i option</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) shows a
ch14_03.htm:is removed. If there are no more <b class="emphasis-bold">links</b> (<a href="ch10_03.htm#upt3-CHP-10-SECT-3">Section 10.3</a>) to the
ch14_03.htm:file (i.e., if the file only had one name), its <b class="emphasis-bold">inode</b> (<a href="ch14_02.htm#upt3-CHP-14-SECT-2">Section 14.2</a>) is added
ch14_03.htm:(<a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>) to modify it. (A mistake in its own
ch14_03.htm:of reasons for making regular <b class="emphasis-bold">backups</b> (<a href="ch38_03.htm#upt3-CHP-38-SECT-3">Section 38.3</a>).) By
ch14_04.htm:<p>Use <em class="emphasis">rm -i</em>, possibly as an alias (<a href="ch14_08.htm#upt3-CHP-14-SECT-8">Section 14.8</a>). 
ch14_04.htm:<p>Make <em class="emphasis">rm -i</em> less painful (<a href="ch14_07.htm#upt3-CHP-14-SECT-7">Section 14.7</a>). 
ch14_04.htm:directory (<a href="ch14_09.htm#upt3-CHP-14-SECT-9">Section 14.9</a>).
ch14_04.htm:<p>Use <a name="IXT-14-6228" />revision control (<a href="ch39_04.htm#upt3-CHP-39-SECT-4">Section 39.4</a>). 
ch14_04.htm:explained in <a href="ch38_03.htm#upt3-CHP-38-SECT-3">Section 38.3</a>.
ch14_04.htm:unwritable (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>).
ch14_04.htm:-f</em> (<a href="ch14_10.htm#upt3-CHP-14-SECT-10">Section 14.10</a>).
ch14_05.htm:prompts. If a command opens your terminal (<b class="emphasis-bold">/dev/tty</b> (<a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>))
ch14_05.htm:won't work. Try <b class="emphasis-bold">expect</b> (<a href="ch28_18.htm#upt3-CHP-28-SECT-18">Section 28.18</a>) instead.
ch14_06.htm:the <b class="emphasis-bold">wildcards</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>) would be too painful to type with a plain
ch14_08.htm:<p><a name="IXT-14-6243" /><a name="IXT-14-6244" /> <a name="IXT-14-6245" />Using <b class="emphasis-bold">noclobber</b> (<a href="ch43_06.htm#upt3-CHP-43-SECT-6">Section 43.6</a>) and
ch14_08.htm:<p><tt class="literal">./-</tt> <a href="ch14_13.htm#upt3-CHP-14-SECT-13">Section 14.13</a></p>
ch14_08.htm:<b class="emphasis-bold">inodes</b> (<a href="ch14_02.htm#upt3-CHP-14-SECT-2">Section 14.2</a>). It might be better to make one
ch14_08.htm:<em class="emphasis">-i</em> file in your home directory and <b class="emphasis-bold">hard link</b> (<a name="IXT-14-6248" /><a href="ch15_04.htm#upt3-CHP-15-SECT-4">Section 15.4</a>)
ch14_08.htm:<p><tt class="literal">~</tt> <a href="ch30_11.htm#upt3-CHP-30-SECT-11">Section 30.11</a></p>
ch14_09.htm:via a <b class="emphasis-bold">cron</b> (<a name="IXT-14-6253" /><a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>) entry like
ch14_09.htm:<p><tt class="literal">&amp;&amp;</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>,
ch14_09.htm:<tt class="literal">-r</tt> <a href="ch14_16.htm#upt3-CHP-14-SECT-16">Section 14.16</a> 
ch14_10.htm:<b class="emphasis-bold">directory access permissions</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>).) 
ch14_10.htm:<p>Normally, <i class="command">rm</i>'s <b class="emphasis-bold">exit status</b> (<a name="IXT-14-6256" /><a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>) is 0 if
ch14_11.htm:<p>Deleting files with random control characters in their names (<a href="ch14_12.htm#upt3-CHP-14-SECT-12">Section 14.12</a>).
ch14_11.htm:<p>Deleting files whose names start with a dash (<a href="ch14_13.htm#upt3-CHP-14-SECT-13">Section 14.13</a>). 
ch14_11.htm:filenames (<a href="ch14_14.htm#upt3-CHP-14-SECT-14">Section 14.14</a>).
ch14_11.htm:<p>Deleting files by using the inode number (<a href="ch14_15.htm#upt3-CHP-14-SECT-15">Section 14.15</a>). 
ch14_11.htm:<p>Deleting directories and problems that can arise as a result (<a href="ch14_16.htm#upt3-CHP-14-SECT-16">Section 14.16</a>).
ch14_11.htm:<p>Deleting unused (or rarely used) files (<a href="ch14_17.htm#upt3-CHP-14-SECT-17">Section 14.17</a>). 
ch14_11.htm:<p>Deleting all the files in a directory, except for one or two (<a href="ch14_18.htm#upt3-CHP-14-SECT-18">Section 14.18</a>).
ch14_12.htm:<b class="emphasis-bold">several ways</b> (<a href="ch14_11.htm#upt3-CHP-14-SECT-11">Section 14.11</a>) to handle this problem. One is with <b class="emphasis-bold">wildcards</b> (<a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>). Type
ch14_12.htm:screen before I could see what the filename was! <a href="ch08_12.htm#upt3-CHP-8-SECT-12">Section 8.12</a> explains how, depending on your version of
ch14_13.htm:directory"</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>). So here's how to remove the
ch14_14.htm:The <b class="emphasis-bold">ls -q</b> (<a name="IXT-14-6265" /><a href="ch08_12.htm#upt3-CHP-8-SECT-12">Section 8.12</a>)
ch14_14.htm:*</b> (<a href="ch14_12.htm#upt3-CHP-14-SECT-12">Section 14.12</a>) skip right over the file.
ch14_14.htm:You can see exactly what the filename is by using <b class="emphasis-bold">ls -b</b> (<a name="IXT-14-6267" /><a href="ch08_12.htm#upt3-CHP-8-SECT-12">Section 8.12</a>): 
ch14_14.htm:-c</b> (<a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>) to dump the current
ch14_14.htm:(dot)</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>), character by
ch14_14.htm:<b class="emphasis-bold">rm -rf</b> (<a href="ch14_16.htm#upt3-CHP-14-SECT-16">Section 14.16</a>, <a href="ch14_10.htm#upt3-CHP-14-SECT-10">Section 14.10</a>). Moving files
ch14_15.htm:don't work</b> (<a href="ch14_12.htm#upt3-CHP-14-SECT-12">Section 14.12</a>)
ch14_15.htm:(<a href="ch13_02.htm#upt3-CHP-13-SECT-2">Section 13.2</a>). Then use <b class="emphasis-bold">find's -inum operator</b> (<a href="ch09_09.htm#upt3-CHP-9-SECT-9">Section 9.9</a>) to remove the file.
ch14_15.htm:option</b> (<a href="ch08_12.htm#upt3-CHP-8-SECT-12">Section 8.12</a>) on most versions)
ch14_15.htm:(<a name="IXT-14-6279" /> <a name="IXT-14-6280" /><a href="ch09_25.htm#upt3-CHP-9-SECT-25">Section 9.25</a>) for
ch14_16.htm:(<a href="ch08_09.htm#upt3-CHP-8-SECT-9">Section 8.9</a>):<a href="#FOOTNOTE-45">[45]</a>
ch14_16.htm:..</b> (<a href="ch08_09.htm#upt3-CHP-8-SECT-9">Section 8.9</a>), which you can
ch14_16.htm:output</b> (<a href="ch08_11.htm#upt3-CHP-8-SECT-11">Section 8.11</a>) (like a blank line).
ch14_17.htm:write <b class="emphasis-bold">find</b> (<a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a>) commands that will automatically clean these
ch14_17.htm:<i class="command">find</i> commands to your <b class="emphasis-bold">crontab file</b> (<a name="IXT-14-6297" /><a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>).
ch14_17.htm:command that locates files based on their last access time (<b class="emphasis-bold">-atime</b> (<a href="ch09_05.htm#upt3-CHP-9-SECT-5">Section 9.5</a>)) and use
ch14_17.htm:<b class="emphasis-bold">-ok or -exec</b> (<a href="ch09_09.htm#upt3-CHP-9-SECT-9">Section 9.9</a>) to delete them. Such a command might look
ch14_17.htm:<p><tt class="literal">!</tt> <a href="ch09_06.htm#upt3-CHP-9-SECT-6">Section
ch14_17.htm:9.6</a>, <tt class="literal">-perm</tt> <a href="ch09_15.htm#upt3-CHP-9-SECT-15">Section 9.15</a> 
ch14_17.htm:<p><tt class="literal">if</tt> <a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>, <tt class="literal">&amp;&amp;</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a></p>
ch14_17.htm:<p>That is, this alias deletes all of my <b class="emphasis-bold">Emacs</b> (<a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>) backup
ch14_18.htm:<b class="emphasis-bold">wildcard expression</b> (<a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>) that does what you want -- but sometimes
ch14_18.htm:(<a name="IXT-14-6315" /> <a name="IXT-14-6316" /><a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>)
ch14_18.htm:(<a name="IXT-14-6317" /><a name="IXT-14-6318" /><a href="ch13_03.htm#upt3-CHP-13-SECT-3">Section 13.3</a>) command, and then use backquotes to give the
ch14_18.htm:Using <b class="emphasis-bold">ls -d</b> (<a href="ch08_05.htm#upt3-CHP-8-SECT-5">Section 8.5</a>) makes sure that <i class="command">ls</i>
ch14_18.htm:<p>Another solution is the <b class="emphasis-bold">nom</b> (<a href="ch33_08.htm#upt3-CHP-33-SECT-8">Section 33.8</a>) script.<a name="IXTR3-6323" /> 
ch14_19.htm:<p><tt class="literal">2&gt;&amp;1</tt> <a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a></p>
ch14_19.htm:<a href="ch09_05.htm#upt3-CHP-9-SECT-5">Section 9.5</a>). Doing it all with one
ch15_02.htm:new file will have your default permissions and <b class="emphasis-bold">ownership</b> (<a href="ch50_03.htm#upt3-CHP-50-SECT-3">Section 50.3</a>).
ch15_02.htm:entry</b> (<a href="ch10_02.htm#upt3-CHP-10-SECT-2">Section 10.2</a>) uses).
ch15_02.htm:The <b class="emphasis-bold">find -newer</b> (<a href="ch09_08.htm#upt3-CHP-9-SECT-8">Section 9.8</a>) command can compare other files to a
ch15_02.htm:(<a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a>), on top of the file:
ch15_02.htm:<p><tt class="literal">tail</tt> <a href="ch12_08.htm#upt3-CHP-12-SECT-8">Section 12.8</a></p>
ch15_03.htm:/dev/null</b> (<a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a>):
ch15_03.htm:<b class="emphasis-bold">crontab</b> (<a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>) to truncate and replace the log file. These
ch15_03.htm:getting <b class="emphasis-bold">mail</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) that you want to throw away? You may be able
ch15_04.htm:central copy and put its directory in your <b class="emphasis-bold">search path</b> (<a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a>).
ch15_04.htm:<i class="command">ln</i>. There are lots of advantages to <b class="emphasis-bold">links</b> (<a href="ch10_03.htm#upt3-CHP-10-SECT-3">Section 10.3</a>). One big
ch15_05.htm:file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>), but can also be done
ch15_05.htm:and <i class="command">cron</i> jobs might not read the <b class="emphasis-bold">shell setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) that sets your limit. One way to fix this is
ch15_05.htm:<p><tt class="literal">;</tt> <a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a></p>
ch15_05.htm:<p>If you've written a <b class="emphasis-bold">daemon</b> (<a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>) in C
ch15_05.htm:<p><tt class="literal">chmod</tt> <a href="ch50_05.htm#upt3-CHP-50-SECT-5">Section 50.5</a></p>
ch15_05.htm:<p>If all else fails, try making a symbolic link to <b class="emphasis-bold">/dev/null</b> (<a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a>).
ch15_06.htm:<a href="ch15_07.htm#upt3-CHP-15-SECT-7">Section 15.7</a>.)
ch15_06.htm:output to the <b class="emphasis-bold">less</b> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) command. When you use
ch15_07.htm:(<a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>) command can read lots of little files
ch15_07.htm:<p>Okay, then why am I writing this article? Because the <b class="emphasis-bold">gzip</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>) utility
ch15_07.htm:<b class="emphasis-bold">bzip2</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>)
ch15_07.htm:<p><tt class="literal">..</tt> <a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section
ch15_07.htm:1.16</a>, <tt class="literal">-r</tt> <a href="ch14_16.htm#upt3-CHP-14-SECT-16">Section 14.16</a></p>
ch15_07.htm:other <b class="emphasis-bold">hard links</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>). If a lot of your files have other links,
ch15_07.htm:<p><tt class="literal">less</tt> <a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a></p>
ch15_08.htm:(i.e., <b class="emphasis-bold">NFS</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>)) filesystems. Under Linux or BSD Unix, the
ch15_08.htm:only the <b class="emphasis-bold">superuser</b> (<a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>) can use this reserved space, and that usually
ch15_08.htm:"the current directory" (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>)). 
ch15_09.htm:a quick little command that will <b class="emphasis-bold">compress</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>) files
ch15_09.htm:in the current directory and below. It uses <b class="emphasis-bold">find</b> (<a name="IXT-15-6186" /><a href="ch09_02.htm#upt3-CHP-9-SECT-2">Section 9.2</a>) to
ch15_09.htm:<p><tt class="literal">-size</tt><a href="ch09_14.htm#upt3-CHP-9-SECT-14">Section
ch15_09.htm:9.14</a>, <tt class="literal">xargs</tt> <a href="ch28_17.htm#upt3-CHP-28-SECT-17">Section 28.17</a> 
ch15_09.htm:month or so by <b class="emphasis-bold">at</b> (<a href="ch25_05.htm#upt3-CHP-25-SECT-5">Section 25.5</a>) or <b class="emphasis-bold">cron</b>
ch15_09.htm:(<a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>).
ch15_10.htm:<p><tt class="literal">-s</tt> <a href="ch09_14.htm#upt3-CHP-9-SECT-14">Section 9.14</a></p>
ch15_10.htm:<i class="command">ld</i> directly -- say, in a <b class="emphasis-bold">makefile</b> (<a href="ch11_10.htm#upt3-CHP-11-SECT-10">Section 11.10</a>) -- use the <span class="option">-s</span> option
ch15_10.htm:bin</b> <b class="emphasis-bold">directory</b> (<a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>) and strips them. It's a
ch15_10.htm:<p><tt class="literal">xargs</tt> <a href="ch28_17.htm#upt3-CHP-28-SECT-17">Section 28.17</a></p>
ch15_10.htm:<p>The <b class="emphasis-bold">find</b> (<a href="ch09_02.htm#upt3-CHP-9-SECT-2">Section 9.2</a>) finds all executable files that
ch15_10.htm:aren't setuid or setgid and runs <b class="emphasis-bold">file</b> (<a href="ch12_06.htm#upt3-CHP-12-SECT-6">Section 12.6</a>) to get a
ch16_01.htm:redirect the output to a file, use <b class="emphasis-bold">grep</b> (<a href="ch13_01.htm#upt3-CHP-13-SECT-1">Section 13.1</a>) to locate
ch16_01.htm:but realistically, this is too tedious for most users. (The <b class="emphasis-bold">ispell</b> (<a href="ch16_02.htm#upt3-CHP-16-SECT-2">Section 16.2</a>) program
ch16_01.htm:systems, your word-list file must be <b class="emphasis-bold">sorted</b> (<a href="ch22_01.htm#upt3-CHP-22-SECT-1">Section 22.1</a>).
ch16_01.htm:spell</b> <b class="emphasis-bold">works</b> (<a href="ch15_04.htm#upt3-CHP-15-SECT-4">Section 15.4</a>), you may be less surprised by some of these
ch16_01.htm:(<a href="ch16_02.htm#upt3-CHP-16-SECT-2">Section 16.2</a>). Or you can download and install the
ch16_02.htm:<p>The original Unix spell-checking program, <b class="emphasis-bold">spell</b> (<a name="IXT-16-1587" /><a name="IXT-16-1588" /><a name="IXT-16-1589" /><a href="ch15_01.htm#upt3-CHP-15-SECT-1">Section 15.1</a>), is fine
ch16_02.htm:<b class="emphasis-bold">environment variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>)
ch16_02.htm:pathname</b> (<a href="ch01_14.htm#upt3-CHP-1-SECT-14">Section 1.14</a>), or
ch16_03.htm:<p>If you're using <b class="emphasis-bold">ispell</b> (<a name="IXT-16-1598" /> <a name="IXT-16-1599" /><a href="ch16_02.htm#upt3-CHP-16-SECT-2">Section 16.2</a>) or the newer <i class="command">aspell</i>, you
ch16_03.htm:with <b class="emphasis-bold">look</b> (<a href="ch13_14.htm#upt3-CHP-13-SECT-14">Section 13.14</a>). With just one argument,
ch16_04.htm:you have <b class="emphasis-bold">ispell</b> (<a href="ch16_02.htm#upt3-CHP-16-SECT-2">Section 16.2</a>), there's not a whole lot of
ch16_04.htm:and sort -u</b> (<a name="IXT-16-1607" /> <a name="IXT-16-1608" /><a href="ch22_06.htm#upt3-CHP-22-SECT-6">Section 22.6</a>) to remove
ch16_04.htm:<a href="ch16_01.htm#upt3-CHP-16-SECT-1">Section 16.1</a>.)
ch16_04.htm:<i class="command">spell</i>, the output is appended through <b class="emphasis-bold">tee</b> (<a href="ch43_08.htm#upt3-CHP-43-SECT-8">Section 43.8</a>) into
ch16_04.htm:you might use the <i class="command">sort</i> and <b class="emphasis-bold">uniq -c</b> (<a href="ch21_20.htm#upt3-CHP-21-SECT-20">Section 21.20</a>)
ch16_04.htm:<b class="emphasis-bold">local spelling dictionary</b> (<a href="ch16_01.htm#upt3-CHP-16-SECT-1">Section 16.1</a>). Even better, use <i class="command">ispell</i>;
ch16_04.htm:<b class="emphasis-bold">update the word lists it uses</b> (<a href="ch16_05.htm#upt3-CHP-16-SECT-5">Section 16.5</a>).<a name="IXTR3-1677" /> 
ch16_05.htm:<p><b class="emphasis-bold">ispell</b> (<a name="IXT-16-1620" /><a name="IXT-16-1621" /><a href="ch16_02.htm#upt3-CHP-16-SECT-2">Section 16.2</a>)
ch16_05.htm:<b class="emphasis-bold">environment variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>).) This file is simply a list of words, one
ch16_05.htm:<b class="emphasis-bold">ispell -a</b> (<a name="IXT-16-1627" /><a href="ch16_03.htm#upt3-CHP-16-SECT-3">Section 16.3</a>) option.
ch16_06.htm:option</b> (<a href="ch08_09.htm#upt3-CHP-8-SECT-9">Section 8.9</a>) makes
ch16_06.htm:<i class="command">ls</i><a name="IXT-16-1642" /> command is <b class="emphasis-bold">aliased</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) to
ch16_06.htm:(<a href="ch43_02.htm#upt3-CHP-43-SECT-2">Section 43.2</a>).</p> </blockquote>
ch16_06.htm:<p>See the extra spaces? Understanding how the shell handles <b class="emphasis-bold">quoting</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) will
ch16_06.htm:'</b> (<a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>).
ch16_06.htm:(<a name="IXT-16-1651" /><a href="ch15_08.htm#upt3-CHP-15-SECT-8">Section 15.8</a>) command gives accurate disk usage.
ch16_07.htm:tr</b> (<a name="IXT-16-1656" /><a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>):
ch16_07.htm:<p><tt class="literal">uniq</tt> <a href="ch21_20.htm#upt3-CHP-21-SECT-20">Section 21.20</a></p>
ch16_08.htm:editors, such as <b class="emphasis-bold">Emacs</b> (<a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>) and <b class="emphasis-bold">vim</b> <a href="ch17_01.htm#upt3-CHP-17-SECT-1">Section 17.1</a>), also support syntax coloring and
ch16_08.htm:<p><tt class="literal">gawk</tt> <a href="ch20_11.htm#upt3-CHP-20-SECT-11">Section 20.11</a></p>
ch16_09.htm:<b class="emphasis-bold">sometimes need just the words</b> (<a href="ch16_07.htm#upt3-CHP-16-SECT-7">Section 16.7</a>). 
ch16_09.htm:designed to strip out <b class="emphasis-bold">troff</b> <a href="ch44_11.htm#upt3-CHP-44-SECT-11">Section 45.11</a>) constructs and punctuation from files.
ch16_09.htm:-u</b> (<a href="ch22_06.htm#upt3-CHP-22-SECT-6">Section 22.6</a>) if you want only one of
ch16_09.htm:<b class="emphasis-bold">tr</b> (<a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>),
ch16_09.htm:<p><tt class="literal">&lt;</tt> <a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a></p>
ch16_09.htm:syntax</b> (<a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>)? Then, instead of
ch16_09.htm:(<a name="IXT-16-1677" /><a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>) has slightly different syntax.
ch17_01.htm:(<a name="IXT-17-1380" /><a name="IXT-17-1381" /><a name="IXT-17-1382" /><a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>)? That's because
ch17_02.htm:without leaving <i class="command">vi</i>: <a href="ch17_03.htm#upt3-CHP-17-SECT-3">Section 17.3</a>, <a href="ch17_04.htm#upt3-CHP-17-SECT-4">Section 17.4</a>, and <a href="ch17_06.htm#upt3-CHP-17-SECT-6">Section 17.6</a>. 
ch17_02.htm:<p>Recover deletions from up to nine numbered buffers: <a href="ch17_07.htm#upt3-CHP-17-SECT-7">Section 17.7</a>. 
ch17_02.htm:<p>Do global search and replacement with pattern matching: <a href="ch17_08.htm#upt3-CHP-17-SECT-8">Section 17.8</a>, <a href="ch17_13.htm#upt3-CHP-17-SECT-13">Section 17.13</a>, <a href="ch17_14.htm#upt3-CHP-17-SECT-14">Section 17.14</a>, <a href="ch17_16.htm#upt3-CHP-17-SECT-16">Section 17.16</a>, and <a href="ch17_22.htm#upt3-CHP-17-SECT-22">Section 17.22</a>. 
ch17_02.htm:<p>Save a lot of typing with word abbreviations: <a href="ch17_23.htm#upt3-CHP-17-SECT-23">Section 17.23</a>, <a href="ch17_24.htm#upt3-CHP-17-SECT-24">Section 17.24</a>, and <a href="ch17_25.htm#upt3-CHP-17-SECT-25">Section 17.25</a>. 
ch17_02.htm:fit on the screen as you would like: <a href="ch17_28.htm#upt3-CHP-17-SECT-28">Section 17.28</a>. 
ch17_02.htm:a filter-through): <a href="ch17_18.htm#upt3-CHP-17-SECT-18">Section 17.18</a> and <a href="ch17_21.htm#upt3-CHP-17-SECT-21">Section 17.21</a>. 
ch17_02.htm:files in a local directory: <a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>.
ch17_02.htm:<i class="command">ex</i> in a later chapter: <a href="ch20_03.htm#upt3-CHP-20-SECT-3">Section 20.3</a>, <a href="ch20_04.htm#upt3-CHP-20-SECT-4">Section 20.4</a>, and <a href="ch20_05.htm#upt3-CHP-20-SECT-5">Section 20.5</a>. 
ch17_03.htm:command sequences that you have defined, and you keep <b class="emphasis-bold">yank buffers</b> (<a href="ch17_04.htm#upt3-CHP-17-SECT-4">Section 17.4</a>) so
ch17_03.htm:(<a href="ch17_21.htm#upt3-CHP-17-SECT-21">Section 17.21</a>) and when writing out the contents of
ch17_04.htm:command</b> (<a href="ch17_03.htm#upt3-CHP-17-SECT-3">Section 17.3</a>). Thus, by yanking
ch17_05.htm:directory</b> (<a href="ch01_15.htm#upt3-CHP-1-SECT-15">Section 1.15</a>) and unset them
ch17_05.htm:(<a name="IXT-17-1399" /> <a name="IXT-17-1400" /><a href="ch17_23.htm#upt3-CHP-17-SECT-23">Section 17.23</a>) and <b class="emphasis-bold">key mappings</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>).
ch17_05.htm:<i class="command">ex</i> in an <a name="IXT-17-1403" /><a name="IXT-17-1404" />environment variable called <b class="emphasis-bold">EXINIT</b> (<a href="ch17_27.htm#upt3-CHP-17-SECT-27">Section 17.27</a>). If
ch17_05.htm:(<a name="IXT-17-1405" /><a href="ch10_05.htm#upt3-CHP-10-SECT-5">Section 10.5</a>) to them
ch17_06.htm:<b class="emphasis-bold">nine</b> (<a href="ch17_07.htm#upt3-CHP-17-SECT-7">Section 17.7</a>)
ch17_06.htm:are lost when you change files. See <a href="ch17_04.htm#upt3-CHP-17-SECT-4">Section 17.4</a>. 
ch17_08.htm:course) can <b class="emphasis-bold">address lines</b> (<a href="ch20_03.htm#upt3-CHP-20-SECT-3">Section 20.3</a>) using <b class="emphasis-bold">search
ch17_08.htm:patterns</b> (<a name="IXT-17-1424" /><a href="ch32_01.htm#upt3-CHP-32-SECT-1">Section 32.1</a>). For example:
ch17_09.htm:the previous version of the buffer with <b class="emphasis-bold">:e!</b> (<a href="ch17_03.htm#upt3-CHP-17-SECT-3">Section 17.3</a>).
ch17_11.htm:(<a href="ch20_03.htm#upt3-CHP-20-SECT-3">Section 20.3</a>) with the write command,
ch17_12.htm:<p><tt class="literal">$</tt> <a href="ch20_03.htm#upt3-CHP-20-SECT-3">Section 20.3</a></p>
ch17_13.htm:<a name="IXT-17-1456" />blocks of text delimited by <b class="emphasis-bold">patterns</b> (<a href="ch17_08.htm#upt3-CHP-17-SECT-8">Section 17.8</a>). For
ch17_13.htm:syntax</b> (<a href="ch20_03.htm#upt3-CHP-20-SECT-3">Section 20.3</a>), but it is not
ch17_14.htm:explanations. (<a href="ch32_21.htm#upt3-CHP-32-SECT-21">Section 32.21</a> has a list of
ch17_14.htm:<p><tt class="literal">%</tt> <a href="ch20_03.htm#upt3-CHP-20-SECT-3">Section 20.3</a></p>
ch17_14.htm:and \)</b> (<a href="ch34_11.htm#upt3-CHP-34-SECT-11">Section 34.11</a>) and restored on the
ch17_14.htm:<p><tt class="literal">g</tt> <a href="ch20_04.htm#upt3-CHP-20-SECT-4">Section 20.4</a></p>
ch17_14.htm:<em class="emphasis">first</em> closing quote. As <a href="ch32_18.htm#upt3-CHP-32-SECT-18">Section 32.18</a> explains, using <tt class="literal">".*"</tt> would
ch17_14.htm:(<tt class="literal">;</tt>) (<a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a>) on a Unix
ch17_15.htm:file</b> (<a href="ch17_30.htm#upt3-CHP-17-SECT-30">Section 17.30</a>).
ch17_15.htm:/\&lt;very\&gt;</b> (<a href="ch32_12.htm#upt3-CHP-32-SECT-12">Section 32.12</a>) instead
ch17_16.htm:<p><tt class="literal">\(...\)...\1</tt> <a href="ch32_21.htm#upt3-CHP-32-SECT-21">Section 32.21</a></p>
ch17_16.htm:try putting it in a <b class="emphasis-bold">keymap</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>). 
ch17_17.htm:special character</b> (<a href="ch27_17.htm#upt3-CHP-27-SECT-17">Section 27.17</a>).)
ch17_17.htm:file</b> (<a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>). To make the editor
ch17_17.htm:read it, <b class="emphasis-bold">map</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>) a function key like F1 (or any other key
ch17_17.htm:<p><tt class="literal">source</tt> <a href="ch20_04.htm#upt3-CHP-20-SECT-4">Section 20.4</a>, <tt class="literal">^[</tt><a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a> 
ch17_17.htm:filename</b> (<a href="ch17_03.htm#upt3-CHP-17-SECT-3">Section 17.3</a>).)
ch17_17.htm:links</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) between them. That
ch17_18.htm:case</b> (<a href="ch17_16.htm#upt3-CHP-17-SECT-16">Section 17.16</a>), but it's also easy to
ch17_18.htm:(<a name="IXT-17-1474" /><a name="IXT-17-1475" /><a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>)
ch17_19.htm:<p><img src="figs/bomb.gif" alt="Figure " width="24" /> <a href="ch17_20.htm#upt3-CHP-17-SECT-20">Section 17.20</a></p>
ch17_20.htm:file with <b class="emphasis-bold">vi -r</b> (<a href="ch17_19.htm#upt3-CHP-17-SECT-19">Section 17.19</a>), typing <em class="emphasis">ZZ</em> may not save
ch17_20.htm:in my <em class="filename">tmp</em> directory. Then I use a <b class="emphasis-bold">shell escape</b> (<a href="ch17_21.htm#upt3-CHP-17-SECT-21">Section 17.21</a>) to
ch17_20.htm:run <b class="emphasis-bold">diff</b> (<a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>) and compare the draft file on disk
ch17_20.htm:<b class="emphasis-bold"># shortcuts</b> (<a href="ch17_03.htm#upt3-CHP-17-SECT-3">Section 17.3</a>) are handy here. Oops: <i class="command">diff</i>
ch17_20.htm:<p><tt class="literal">less</tt> <a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a></p>
ch17_20.htm:recovered buffer, as <a href="ch17_04.htm#upt3-CHP-17-SECT-4">Section 17.4</a> explains,
ch17_21.htm:(<a name="IXT-17-1488" /><a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>), that works on most Unix systems. Job control
ch17_21.htm:Give this file to the <b class="emphasis-bold">rcsdiff</b> (<a href="ch11_03.htm#upt3-CHP-11-SECT-3">Section 11.3</a>) program to see what you've changed since the
ch17_21.htm:the file you're editing now (<a href="ch17_03.htm#upt3-CHP-17-SECT-3">Section 17.3</a>).
ch17_21.htm:starts a <b class="emphasis-bold">subshell</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>); it will <em class="emphasis">not</em></tt> take you
ch17_21.htm:control, you'll almost always want to use job control to<b class="emphasis-bold"> suspend vi</b> <b class="emphasis-bold">temporarily</b> instead (<a href="ch23_06.htm#upt3-CHP-23-SECT-6">Section 23.6</a>). Press CTRL-z, or use the
ch17_22.htm:map</b> <a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>):
ch17_22.htm:<p><tt class="literal">^M</tt> <a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a></p>
ch17_24.htm:<b class="emphasis-bold">ab</b> (<a href="ch17_23.htm#upt3-CHP-17-SECT-23">Section 17.23</a>) is
ch17_24.htm:with a colon (:)), abbreviations can be better than <b class="emphasis-bold">keymaps</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>). That's
ch17_24.htm:(If your text is confidential and your <b class="emphasis-bold">umask</b> (<a href="ch49_04.htm#upt3-CHP-49-SECT-4">Section 49.4</a>) isn't set
ch17_24.htm:directory.) Here are some abbreviations from my <b class="emphasis-bold">.exrc</b> (<a href="ch17_30.htm#upt3-CHP-17-SECT-30">Section 17.30</a>) file:
ch17_24.htm:by using <b class="emphasis-bold">named buffers</b> (<a href="ch17_04.htm#upt3-CHP-17-SECT-4">Section 17.4</a>), but temporary files are the only method that
ch17_25.htm:<p><a name="IXT-17-1497" /> <a name="IXT-17-1498" /><a name="IXT-17-1499" /><a name="IXT-17-1500" /><b class="emphasis-bold">Abbreviations</b> (<a href="ch17_23.htm#upt3-CHP-17-SECT-23">Section 17.23</a>)
ch17_25.htm:<p>in your <b class="emphasis-bold">.exrc</b> (<a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>) file.
ch17_25.htm:abbreviation may be <b class="emphasis-bold">recursive</b> (<a href="ch17_23.htm#upt3-CHP-17-SECT-23">Section 17.23</a>) because the <tt class="literal">vi</tt> is
ch17_26.htm:through the program <b class="emphasis-bold">fmt</b> (<a href="ch17_28.htm#upt3-CHP-17-SECT-28">Section 17.28</a>). 
ch17_27.htm:(<a href="ch03_07.htm#upt3-CHP-3-SECT-7">Section 3.7</a>) of a directory on a filesystem with
ch17_27.htm:while using <i class="command">vi</i> and then use the <b class="emphasis-bold">:e command</b> (<a href="ch17_03.htm#upt3-CHP-17-SECT-3">Section 17.3</a>), all
ch17_27.htm:(<a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>), <a name="IXT-17-1510" /><a name="IXT-17-1511" />setting
ch17_28.htm:of your lines too short or long? The <b class="emphasis-bold">fmt</b> (<a name="IXT-17-1514" /><a href="ch21_02.htm#upt3-CHP-21-SECT-2">Section 21.2</a>) utility
ch17_28.htm:<p><tt class="literal">5!!</tt> <a href="ch17_18.htm#upt3-CHP-17-SECT-18">Section 17.18</a></p>
ch17_28.htm:(<a href="ch17_18.htm#upt3-CHP-17-SECT-18">Section 17.18</a>) 5 lines through
ch17_28.htm:<p><tt class="literal">%</tt> <a href="ch20_03.htm#upt3-CHP-20-SECT-3">Section 20.3</a></p>
ch17_28.htm:blocks. <b class="emphasis-bold">cut</b> (<a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>) can remove columns, fields, or shorten lines;
ch17_28.htm:<b class="emphasis-bold">tr</b> (<a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>)
ch17_28.htm:through with the setup in <a href="ch21_17.htm#upt3-CHP-21-SECT-17">Section 21.17</a>. In
ch17_30.htm:settings to be executed any time you start the <b class="emphasis-bold">vi or ex editors</b> (<a href="ch17_02.htm#upt3-CHP-17-SECT-2">Section 17.2</a>) in <em class="emphasis">.exrc</em> in your home
ch17_30.htm:<i class="command">set</i>, <b class="emphasis-bold">ab</b> (<a href="ch17_23.htm#upt3-CHP-17-SECT-23">Section 17.23</a>), and <b class="emphasis-bold">map</b>
ch17_30.htm:(<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>) commands that you want to have in
ch17_30.htm:are <a name="IXT-17-1524" />RETURNs. Make them by pressing <b class="emphasis-bold">CTRL-v, then RETURN</b> (<a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a>). Lines that start with a double quote
ch17_30.htm:particular project</b> (<a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>).
ch18_01.htm:<p>Save time by mapping keys: <a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>,
ch18_01.htm:<a href="ch18_04.htm#upt3-CHP-18-SECT-4">Section 18.4</a>, <a href="ch18_07.htm#upt3-CHP-18-SECT-7">Section 18.7</a>, and <a href="ch18_08.htm#upt3-CHP-18-SECT-8">Section 18.8</a>. 
ch18_01.htm:<p>Know when to map a key and when not to: <a href="ch18_03.htm#upt3-CHP-18-SECT-3">Section 18.3</a>. 
ch18_01.htm:<p>Map keys like ESC and RETURN: <a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a>.</p>
ch18_01.htm:<p>Move around the file without leaving text-input mode: <a href="ch18_11.htm#upt3-CHP-18-SECT-11">Section 18.11</a> 
ch18_01.htm:window: <a href="ch18_05.htm#upt3-CHP-18-SECT-5">Section 18.5</a>.
ch18_01.htm:<p>Put custom commands in your <em class="emphasis">.exrc</em> file: <a href="ch18_09.htm#upt3-CHP-18-SECT-9">Section 18.9</a> and <a href="ch18_12.htm#upt3-CHP-18-SECT-12">Section 18.12</a>.
ch18_01.htm:<p>Break long lines of text: <a href="ch18_13.htm#upt3-CHP-18-SECT-13">Section 18.13</a>.</p>
ch18_02.htm:lot like <b class="emphasis-bold">ab</b> (<a href="ch17_23.htm#upt3-CHP-17-SECT-23">Section 17.23</a>) except that you define a macro for command
ch18_02.htm:(<a href="ch17_30.htm#upt3-CHP-17-SECT-30">Section 17.30</a>) or typed in after a colon (:). If you
ch18_02.htm:that <b class="emphasis-bold">vi @-functions</b> (<a href="ch18_04.htm#upt3-CHP-18-SECT-4">Section 18.4</a>) are easier to create and use. The map
ch18_02.htm:<p><tt class="literal">^[</tt> <a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a></p>
ch18_02.htm:(<a name="IXT-18-1684" /><a name="IXT-18-1685" /><a href="ch05_02.htm#upt3-CHP-5-SECT-2">Section 5.2</a>) defines those keys. For example, to make
ch18_02.htm:use. There's more information in <a href="ch18_12.htm#upt3-CHP-18-SECT-12">Section 18.12</a> about the <em class="emphasis">noremap</em> option.
ch18_02.htm:<b class="emphasis-bold">abbreviations</b> (<a href="ch17_23.htm#upt3-CHP-17-SECT-23">Section 17.23</a>); the difference is that
ch18_02.htm:and then ESC</b> (<a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a>). After your
ch18_02.htm:<p><a href="ch18_03.htm#upt3-CHP-18-SECT-3">Section 18.3</a> lists some problems with
ch18_04.htm:command</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>) lets you define
ch18_04.htm:<tt class="literal">@z</tt>. They're stored in <b class="emphasis-bold">named buffers</b> (<a href="ch17_04.htm#upt3-CHP-17-SECT-4">Section 17.4</a>).
ch18_04.htm:before each ESC or RETURN</b> (<a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a>).
ch18_05.htm:(<a href="ch21_02.htm#upt3-CHP-21-SECT-2">Section 21.2</a>) utility to reformat and clean up lines
ch18_05.htm:<p><tt class="literal">^[</tt> <a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section
ch18_05.htm:back, try a <b class="emphasis-bold">filter-through</b> (<a href="ch17_18.htm#upt3-CHP-17-SECT-18">Section 17.18</a>) with <i class="command">unexpand</i>.
ch18_06.htm:(<a href="ch24_11.htm#upt3-CHP-24-SECT-11">Section 24.11</a>) and <b class="emphasis-bold">stopping
ch18_06.htm:jobs</b> (<a href="ch23_01.htm#upt3-CHP-23-SECT-1">Section 23.1</a>).
ch18_06.htm:an <b class="emphasis-bold">abbreviation</b> (<a href="ch17_23.htm#upt3-CHP-17-SECT-23">Section 17.23</a>) or a substitution command. For example, the
ch18_06.htm:the word <em class="emphasis">Section</em>. The <tt class="literal">&amp;</tt>
ch18_06.htm:text-input mode map (<b class="emphasis-bold">map!</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>)) -- it needs three CTRL-v characters,
ch18_06.htm:F1</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>) insert the string
ch18_07.htm:<p><a name="IXT-18-1714" /><a name="IXT-18-1715" />Another way to do this is with<b class="emphasis-bold"> @-functions</b> (<a href="ch18_04.htm#upt3-CHP-18-SECT-4">Section 18.4</a>).
ch18_07.htm:characters with <b class="emphasis-bold">CTRL-v</b> (<a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a>). <tt class="literal">^[</tt> is the sequence that
ch18_07.htm:(<a href="ch17_03.htm#upt3-CHP-17-SECT-3">Section 17.3</a> explains <tt class="literal">%</tt>
ch18_07.htm:uppercase</b> (<a href="ch17_16.htm#upt3-CHP-17-SECT-16">Section 17.16</a>). If
ch18_08.htm:series</b> (<a href="ch17_03.htm#upt3-CHP-17-SECT-3">Section 17.3</a>):
ch18_08.htm:(<a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a>) ESC. Finally, you append the closing
ch18_08.htm:option</b> (<a href="ch18_12.htm#upt3-CHP-18-SECT-12">Section 18.12</a>), which is normally
ch18_09.htm:<b class="emphasis-bold">map</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>)
ch18_10.htm:(<a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>) file:
ch18_10.htm:<p>when you want FORTRAN mode. Of course, you can <b class="emphasis-bold">define a function key</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>) to <tt class="literal">:source</tt> this.
ch18_11.htm:CTRL-h</b> (<a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>) outside
ch18_11.htm:<p>The lines for your <b class="emphasis-bold">.exrc file</b> (<a href="ch17_30.htm#upt3-CHP-17-SECT-30">Section 17.30</a>) are as follows:
ch18_12.htm:<b class="emphasis-bold">map</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>)
ch18_12.htm:file</b> (<a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>):
ch18_13.htm:with a <b class="emphasis-bold">filter-through</b> (<a href="ch17_18.htm#upt3-CHP-17-SECT-18">Section 17.18</a>) and the <b class="emphasis-bold">fmt</b>
ch18_13.htm:(<a href="ch17_28.htm#upt3-CHP-17-SECT-28">Section 17.28</a>) command:
ch18_14.htm:trailing tilde (<tt class="literal">~</tt>) is an Emacs convention. <a href="ch14_17.htm#upt3-CHP-14-SECT-17">Section 14.17</a> shows ways to remove these backup
ch18_14.htm:<p><tt class="literal">^M</tt> <a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a></p>
ch18_14.htm:<p>The first command uses <b class="emphasis-bold">cp -p</b> (<a href="ch10_12.htm#upt3-CHP-10-SECT-12">Section 10.12</a>) to make a backup of the previously written
ch19_01.htm:(I'll give a list of favorite features in <a href="ch19_02.htm#upt3-CHP-19-SECT-2">Section 19.2</a>.) Emacs' best feature
ch19_01.htm:(<a href="ch17_01.htm#upt3-CHP-17-SECT-1">Section 17.1</a>), but we will point out some of its
ch19_02.htm:completions</b> (<a name="IXT-19-5966" /><a href="ch19_06.htm#upt3-CHP-19-SECT-6">Section 19.6</a>). So if you're creating a
ch19_02.htm:that can be executed automatically. This is similar to <b class="emphasis-bold">vi's map</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>) facility, with one extra twist: Emacs
ch19_03.htm:directory. In <a href="ch19_07.htm#upt3-CHP-19-SECT-7">Section 19.7</a>,
ch19_05.htm:<tt class="literal">overwrite-mode</tt>. You can use <b class="emphasis-bold">command abbreviation</b> (<a href="ch19_06.htm#upt3-CHP-19-SECT-6">Section 19.6</a>) to shorten this to ESC-x
ch19_08.htm:<em class="emphasis">search.el</em>. Just stick this into your <b class="emphasis-bold">directory for Emacs hacks</b> (<a href="ch19_12.htm#upt3-CHP-19-SECT-12">Section 19.12</a>), and add something like the following to your
ch19_09.htm:(<a name="IXT-19-6042" /> <a name="IXT-19-6043" /><a name="IXT-19-6044" /><a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>), starting
ch19_09.htm:shell's PWD environment variable</b> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>) has been incorrectly set. There are a few
ch19_09.htm:(<a href="ch29_01.htm#upt3-CHP-29-SECT-1">Section 29.1</a>):
ch19_09.htm:<p><tt class="literal">(..)</tt> <a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a></p>
ch19_12.htm:<b class="emphasis-bold">PATH</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>)
ch20_01.htm:<p><b class="emphasis-bold">sed</b> (<a name="IXT-20-208" /><a name="IXT-20-209" /><a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) is an editor that can
ch20_01.htm:differences</b> (<a href="ch34_02.htm#upt3-CHP-34-SECT-2">Section 34.2</a>) from
ch20_01.htm:<p><b class="emphasis-bold">awk</b> (<a name="IXT-20-210" /><a name="IXT-20-211" /><a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>) is a great way to pull apart a line of text
ch20_01.htm:<p><b class="emphasis-bold">patch</b> (<a name="IXT-20-212" /><a name="IXT-20-213" /><a href="ch20_09.htm#upt3-CHP-20-SECT-9">Section 20.9</a>) is a specialized editor designed to apply
ch20_01.htm:editing scripts created with <i class="command">diff</i> (<a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>). You can do this with <i class="command">ed</i>
ch20_01.htm:and <b class="emphasis-bold">awk</b> (<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>) lie more complete programming languages like
ch20_01.htm:<b class="emphasis-bold">perl</b> (<a href="ch41_01.htm#upt3-CHP-41-SECT-1">Section 41.1</a>)
ch20_01.htm:and <b class="emphasis-bold">python</b> (<a href="ch42_01.htm#upt3-CHP-42-SECT-1">Section 42.1</a>) that are very adept at manipulating text.
ch20_02.htm:control system</b> (<a href="ch39_04.htm#upt3-CHP-39-SECT-4">Section 39.4</a>) to preserve
ch20_04.htm:built by diff</b> (<a href="ch18_06.htm#upt3-CHP-18-SECT-6">Section 18.6</a>) make heavy
ch20_04.htm:<p><tt class="literal">c</tt> <a href="ch17_09.htm#upt3-CHP-17-SECT-9">Section
ch20_04.htm:17.9</a>, <tt class="literal">\U</tt> <a href="ch17_14.htm#upt3-CHP-17-SECT-14">Section 17.14</a></p>
ch20_04.htm:(<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>) of <em class="replaceable"><tt>command</tt></em>.
ch20_05.htm:(<a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>), which is, at bottom, a list of
ch20_05.htm:it with the <b class="emphasis-bold">:so command</b> (<a href="ch20_04.htm#upt3-CHP-20-SECT-4">Section 20.4</a>). For example, Bruce Barnett uses this trick
ch20_05.htm:programs</b> (<a href="ch18_10.htm#upt3-CHP-18-SECT-10">Section 18.10</a>).
ch20_05.htm:(<a name="IXT-20-244" /><a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) is
ch20_06.htm:editors or the <b class="emphasis-bold">patch</b> (<a href="ch20_09.htm#upt3-CHP-20-SECT-9">Section 20.9</a>) program. They'll apply your
ch20_06.htm:<p><img src="figs/bomb.gif" alt="Figure " width="24" /> <a href="ch20_08.htm#upt3-CHP-20-SECT-8">Section 20.8</a></p>
ch20_06.htm:<p><tt class="literal">&gt;&gt;</tt> <a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a></p>
ch20_06.htm:run <b class="emphasis-bold">diff -e</b> (<a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>); I save the result in
ch20_06.htm:w</b> (<a href="ch27_05.htm#upt3-CHP-27-SECT-5">Section 27.5</a>) to add the command.
ch20_08.htm:<p>There are no limits on <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>), although you'll need to
ch20_08.htm:<b class="emphasis-bold">save its output somehow</b> (<a href="ch34_04.htm#upt3-CHP-34-SECT-4">Section 34.4</a>), and your editing script may have to be
ch20_08.htm:variable $filename</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>)):
ch20_08.htm:<p><tt class="literal">2&gt;&amp;1</tt> <a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>, 
ch20_08.htm:<tt class="literal">[ ]</tt> <a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section
ch20_08.htm:35.26</a>, <tt class="literal">$?</tt> <a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a></p>
ch20_09.htm:Wall's widely used programs (including <b class="emphasis-bold">perl</b> (<a href="ch41_01.htm#upt3-CHP-41-SECT-1">Section 41.1</a>), a
ch20_09.htm:(<a name="IXT-20-262" /><a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>)
ch20_09.htm:asking (usually only if the diff file is a <b class="emphasis-bold">context diff</b> (<a href="ch11_03.htm#upt3-CHP-11-SECT-3">Section 11.3</a>)
ch20_09.htm:(<a href="ch39_04.htm#upt3-CHP-39-SECT-4">Section 39.4</a>) file and check it out, if the filename
ch20_10.htm:gawk</b> (<a href="ch18_11.htm#upt3-CHP-18-SECT-11">Section 18.11</a>), this article tries to
ch20_10.htm:the <b class="emphasis-bold">standard input</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>). 
ch20_10.htm:expression</b> (<a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>). Each record (by
ch20_10.htm:described later in <a href="ch20_10.htm#upt3-CHP-20-SECT-10.3">Section 20.10.3</a>.
ch20_10.htm:described in <a href="ch32_15.htm#upt3-CHP-32-SECT-15">Section 32.15</a>. In addition,
ch20_10.htm:<b class="emphasis-bold">^ and $</b> (<a href="ch32_05.htm#upt3-CHP-32-SECT-5">Section 32.5</a>) can be used to refer to the beginning and end
ch20_10.htm:<p>Relational expressions use the relational operators listed in  <a href="ch20_10.htm#upt3-CHP-20-SECT-10.4">Section 20.10.4</a> later in this
ch20_10.htm:<a href="ch20_10.htm#upt3-CHP-20-SECT-10.4">Section 20.10.4</a> later in
ch20_10.htm:status</b> (<a href="ch34_12.htm#upt3-CHP-34-SECT-12">Section 34.12</a>).
ch20_10.htm:(<a href="ch34_12.htm#upt3-CHP-34-SECT-12">Section 34.12</a>). The status of the command that is
ch21_01.htm:<p><b class="emphasis-bold">fmt</b> (<a href="ch21_02.htm#upt3-CHP-21-SECT-2">Section 21.2</a>)
ch21_01.htm:and <b class="emphasis-bold">related scripts</b> (<a href="ch21_03.htm#upt3-CHP-21-SECT-3">Section 21.3</a>) for reformatting jagged lines into neat
ch21_01.htm:<p><b class="emphasis-bold">recomment</b> (<a href="ch21_04.htm#upt3-CHP-21-SECT-4">Section 21.4</a>), a script for reformatting comment blocks
ch21_01.htm:<p><b class="emphasis-bold">behead</b> (<a href="ch21_05.htm#upt3-CHP-21-SECT-5">Section 21.5</a>), a script for removing the headers from mail
ch21_01.htm:<p><b class="emphasis-bold">center</b> (<a href="ch21_08.htm#upt3-CHP-21-SECT-8">Section 21.8</a>), a script for centering lines of text in a
ch21_01.htm:<p><b class="emphasis-bold">split</b> (<a href="ch21_09.htm#upt3-CHP-21-SECT-9">Section 21.9</a>)
ch21_01.htm:and <b class="emphasis-bold">csplit</b> (<a href="ch21_10.htm#upt3-CHP-21-SECT-10">Section 21.10</a>) let you split a big file into smaller pieces.
ch21_01.htm:<p><b class="emphasis-bold">tr</b> (<a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>)
ch21_01.htm:<p><b class="emphasis-bold">dd</b> (<a href="ch21_06.htm#upt3-CHP-21-SECT-6">Section 21.6</a>,
ch21_01.htm:<a href="ch21_13.htm#upt3-CHP-21-SECT-13">Section 21.13</a>) lets you perform various data
ch21_01.htm:<p><b class="emphasis-bold">cut</b> (<a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>)
ch21_01.htm:lets you cut columns or fields out of a file, and <b class="emphasis-bold">paste</b> (<a href="ch21_18.htm#upt3-CHP-21-SECT-18">Section 21.18</a>) lets you
ch21_02.htm:<b class="emphasis-bold">with</b> <b class="emphasis-bold">vi</b> (<a href="ch17_28.htm#upt3-CHP-17-SECT-28">Section 17.28</a>). (Emacs has
ch21_02.htm:options for other structured data. The <span class="option">-p</span><b class="emphasis-bold"> option</b> (<a href="ch21_04.htm#upt3-CHP-21-SECT-4">Section 21.4</a>)
ch21_02.htm:doesn't have <span class="option">-p</span>, the <b class="emphasis-bold">recomment</b> (<a href="ch21_04.htm#upt3-CHP-21-SECT-4">Section 21.4</a>)
ch21_02.htm:(<a href="ch21_03.htm#upt3-CHP-21-SECT-3">Section 21.3</a>) simple (and a little slower) version
ch21_03.htm:<p><b class="emphasis-bold">fmt</b><a name="IXT-21-5653" /><a name="IXT-21-5654" /><a name="IXT-21-5655" /> (<a href="ch21_02.htm#upt3-CHP-21-SECT-2">Section 21.2</a>) is hard to do without once
ch21_03.htm:<b class="emphasis-bold">sed</b> (<a href="ch37_04.htm#upt3-CHP-37-SECT-4">Section 37.4</a>)
ch21_04.htm:<p>The <b class="emphasis-bold">fmt</b> (<a href="ch21_02.htm#upt3-CHP-21-SECT-2">Section 21.2</a>) program neatens lines of a text file.
ch21_04.htm:<i class="command">fmt</i> utility, and uses <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) to add the
ch21_04.htm:<i class="command">vi</i>, with <b class="emphasis-bold">filter-through</b> (<a href="ch17_18.htm#upt3-CHP-17-SECT-18">Section 17.18</a>)
ch21_04.htm:<p><tt class="literal">-n</tt> <a href="ch34_03.htm#upt3-CHP-34-SECT-3">Section
ch21_04.htm:34.3</a>, <tt class="literal">expr</tt> <a href="ch36_22.htm#upt3-CHP-36-SECT-22">Section 36.22</a>, <tt class="literal">cut</tt> <a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a></p>
ch21_04.htm:<p>When the <i class="command">expr</i> command in <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) is
ch21_05.htm:<p><tt class="literal">mail</tt> <a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a></p>
ch21_06.htm:<p>Why would you want to do this? <a href="ch21_09.htm#upt3-CHP-21-SECT-9">Section 21.9</a>
ch21_06.htm:writing it to a series of smaller files. <a href="ch21_13.htm#upt3-CHP-21-SECT-13">Section 21.13</a> shows even more uses for
ch21_08.htm:<b class="emphasis-bold">#!</b> (<a href="ch36_03.htm#upt3-CHP-36-SECT-3">Section 36.3</a>),
ch21_08.htm:shell wrapper</b> (<a href="ch35_19.htm#upt3-CHP-35-SECT-19">Section 35.19</a>).
ch21_08.htm:<p>In <i class="command">vi</i><a name="IXT-21-5692" />, you can use a <b class="emphasis-bold">filter-through</b> (<a href="ch17_18.htm#upt3-CHP-17-SECT-18">Section 17.18</a>)
ch21_09.htm:<p><tt class="literal">wc</tt> <a href="ch16_06.htm#upt3-CHP-16-SECT-6">Section
ch21_09.htm:CD-ROM [see <a href="http://examples.oreilly.com/upt3">http://examples.oreilly.com/upt3</a>]. Alternatively, if you have installed <b class="emphasis-bold">perl</b> (<a href="ch41_01.htm#upt3-CHP-41-SECT-1">Section 41.1</a>), it is
ch21_09.htm:Unix tool you can use to do the splitting is <b class="emphasis-bold">dd</b> (<a href="ch21_06.htm#upt3-CHP-21-SECT-6">Section 21.6</a>). For
ch21_09.htm:<p><tt class="literal">for</tt> <a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>, <tt class="literal">&gt;</tt> <a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a></p>
ch21_10.htm:<a name="upt3-IDXTERM-3013" /> <a name="upt3-IDXTERM-3014" /> <a name="upt3-IDXTERM-3015" />Like <b class="emphasis-bold">split</b> (<a href="ch21_09.htm#upt3-CHP-21-SECT-9">Section 21.9</a>),
ch21_10.htm:<a name="IXT-21-5699" />period is a <b class="emphasis-bold">metacharacter</b> (<a href="ch32_21.htm#upt3-CHP-32-SECT-21">Section 32.21</a>)
ch21_10.htm:backslash or to surround the pattern in <b class="emphasis-bold">quotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>). A
ch21_10.htm:(<a href="ch32_05.htm#upt3-CHP-32-SECT-5">Section 32.5</a>) is used to match the beginning of the
ch21_10.htm:line and the C shell requires quotes around the <b class="emphasis-bold">braces</b> (<a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a>). The
ch21_11.htm:command is a character translation filter, reading <b class="emphasis-bold">standard input</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>)
ch21_11.htm:<p><tt class="literal">&lt;</tt> <a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a></p>
ch21_11.htm:<p><a name="IXT-21-5708" /> <a name="IXT-21-5709" />As described in <a href="ch17_18.htm#upt3-CHP-17-SECT-18">Section 17.18</a>, this translation (and the reverse) can be
ch21_11.htm:(<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>)): <a name="IXT-21-5710" />
ch21_11.htm:example, as described in <a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>,
ch21_11.htm:<b class="emphasis-bold">script</b> (<a href="ch37_07.htm#upt3-CHP-37-SECT-7">Section 37.7</a>).) 
ch21_12.htm:eight-bit byte. <b class="emphasis-bold">Usenet</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>),
ch21_12.htm:<a name="IXT-21-5721" />a <b class="emphasis-bold">compressed file</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>)
ch21_12.htm:<p><tt class="literal">mail</tt> <a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a></p>
ch21_12.htm:<b class="emphasis-bold">cat &gt;</b> (<a href="ch11_02.htm#upt3-CHP-11-SECT-2">Section 11.2</a>), create a mail body with
ch21_12.htm:headers, so you should strip off the header first. The <b class="emphasis-bold">behead</b><a name="IXT-21-5735" /> (<a href="ch21_05.htm#upt3-CHP-21-SECT-5">Section 21.5</a>) script
ch21_12.htm:<p><b class="emphasis-bold">Extract</b> (<a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>) <em class="filename">smallfile.tar.gz</em> and
ch21_13.htm:of</b> <b class="emphasis-bold">dd</b> (<a href="ch21_06.htm#upt3-CHP-21-SECT-6">Section 21.6</a>) we've covered, you also can
ch21_13.htm:close"</b> (<a href="ch38_05.htm#upt3-CHP-38-SECT-5">Section 38.5</a>) to
ch21_14.htm:(<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) if you want a space or other special
ch21_14.htm:you want, try <b class="emphasis-bold">perl</b> (<a href="ch41_01.htm#upt3-CHP-41-SECT-1">Section 41.1</a>) or <b class="emphasis-bold">awk</b>
ch21_14.htm:(<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>), which let you output fields in any
ch21_14.htm:<p><tt class="literal">who</tt> <a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a></p>
ch21_14.htm:<p>Extract usernames and real names from <b class="emphasis-bold">/etc/passwd</b> (<a href="ch22_03.htm#upt3-CHP-22-SECT-3">Section 22.3</a>):
ch21_14.htm:<p><a href="ch21_18.htm#upt3-CHP-21-SECT-18">Section 21.18</a> covers the
ch21_15.htm:(<a href="ch45_06.htm#upt3-CHP-45-SECT-6">Section 45.6</a>) is famous for printing a file neatly
ch21_15.htm:compare a <a name="IXT-21-5760" />directory with its <b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>)
ch21_15.htm:<p>Also see <b class="emphasis-bold">paste</b> (<a href="ch21_18.htm#upt3-CHP-21-SECT-18">Section 21.18</a>). Of course, programming languages like
ch21_15.htm:<b class="emphasis-bold">awk</b> (<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>)
ch21_15.htm:and <b class="emphasis-bold">perl</b> (<a href="ch41_01.htm#upt3-CHP-41-SECT-1">Section 41.1</a>) can also make text into columns.<a name="IXTR3-5814" /> <a name="IXTR3-5815" /> <a name="IXTR3-5816" /> <a name="IXTR3-5817" /> <a name="IXTR3-5818" />
ch21_16.htm:column-making program, besides <i class="command">cols</i> and <b class="emphasis-bold">pr</b> (<a href="ch21_15.htm#upt3-CHP-21-SECT-15">Section 21.15</a>), is the
ch21_16.htm:<b class="emphasis-bold">sed 1d</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) to delete the <tt class="literal">total</tt>
ch21_16.htm:<b class="emphasis-bold">subshells</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) to make both commands use the same standard
ch21_16.htm:</p><p><tt class="literal">;</tt> <a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a>, <tt class="literal">&gt;</tt> <a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a></p>
ch21_17.htm:article's title. After a few minutes with <b class="emphasis-bold">wc -l -c</b> (<a href="ch16_06.htm#upt3-CHP-16-SECT-6">Section 16.6</a>),
ch21_17.htm:<b class="emphasis-bold">cut</b> (<a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>),
ch21_17.htm:<b class="emphasis-bold">sort</b> (<a href="ch22_01.htm#upt3-CHP-22-SECT-1">Section 22.1</a>),
ch21_17.htm:and <b class="emphasis-bold">join</b> (<a href="ch21_19.htm#upt3-CHP-21-SECT-19">Section 21.19</a>), I had a file that looked like this:
ch21_17.htm:The <b class="emphasis-bold">column</b> (<a href="ch21_16.htm#upt3-CHP-21-SECT-16">Section 21.16</a>) command could do it automatically, but I
ch21_17.htm:<b class="emphasis-bold">awk</b> (<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>)
ch21_18.htm:handy when used with <b class="emphasis-bold">cut</b> (<a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>). You can cut data from one position on a line
ch21_18.htm:<p>Use <b class="emphasis-bold">quoting</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>), if necessary, to protect characters from the
ch21_19.htm:(<a href="ch16_06.htm#upt3-CHP-16-SECT-6">Section 16.6</a>) to count the number of
ch21_19.htm:number; I used <b class="emphasis-bold">sort</b> (<a href="ch22_01.htm#upt3-CHP-22-SECT-1">Section 22.1</a>) to sort the files on that field. I used
ch21_20.htm:<p><i class="command">uniq</i> is often used as a filter. See also <b class="emphasis-bold">comm</b> (<a href="ch11_08.htm#upt3-CHP-11-SECT-8">Section 11.8</a>), <b class="emphasis-bold">sort</b> (<a href="ch22_01.htm#upt3-CHP-22-SECT-1">Section 22.1</a>), and
ch21_20.htm:especially <b class="emphasis-bold">sort -u</b> (<a href="ch22_06.htm#upt3-CHP-22-SECT-6">Section 22.6</a>). 
ch21_20.htm:<p><tt class="literal">grep</tt> <a href="ch13_01.htm#upt3-CHP-13-SECT-1">Section 13.1</a></p>
ch21_21.htm:-r</b> (<a href="ch42_01.htm#upt3-CHP-42-SECT-1">Section 42.1</a>):
ch22_01.htm:<p><a href="ch22_02.htm#upt3-CHP-22-SECT-2">Section 22.2</a> describes how to select
ch22_01.htm:<p><a href="ch22_03.htm#upt3-CHP-22-SECT-3">Section 22.3</a> describes how to change the
ch22_01.htm:<p><a href="ch22_04.htm#upt3-CHP-22-SECT-4">Section 22.4</a> describes the kinds of problems
ch22_01.htm:<p><a href="ch22_05.htm#upt3-CHP-22-SECT-5">Section 22.5</a> clarifies the distinctions
ch22_01.htm:<p><a href="ch22_06.htm#upt3-CHP-22-SECT-6">Section 22.6</a> gives miscellaneous hints about
ch22_01.htm:<p>Sort lines by how long they are (<a href="ch22_07.htm#upt3-CHP-22-SECT-7">Section 22.7</a>). 
ch22_01.htm:there's a middle name as well (<a href="ch22_08.htm#upt3-CHP-22-SECT-8">Section 22.8</a>). 
ch22_03.htm:<p><a name="IXT-22-1538" /><a name="IXT-22-1539" /><a href="ch22_02.htm#upt3-CHP-22-SECT-2">Section 22.2</a>
ch22_03.htm:<p><tt class="literal">/etc..wd</tt> <a href="ch01_07.htm#upt3-CHP-1-SECT-7">Section 1.7</a></p>
ch22_04.htm:delimiter</b> (<a href="ch22_03.htm#upt3-CHP-22-SECT-3">Section 22.3</a>). This makes it
ch22_04.htm:-v</b> (<a href="ch12_05.htm#upt3-CHP-12-SECT-5">Section 12.5</a>, <a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>) shows that the file really looks like this:
ch22_06.htm:powerful than <b class="emphasis-bold">uniq</b> (<a href="ch21_20.htm#upt3-CHP-21-SECT-20">Section 21.20</a>) because:
ch22_06.htm:lines "unique" if the <b class="emphasis-bold">sort fields</b> (<a href="ch22_02.htm#upt3-CHP-22-SECT-2">Section 22.2</a>)
ch22_06.htm:<em class="emphasis">printf</em> statements, write some <b class="emphasis-bold">Emacs</b> (<a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>) macros to
ch22_06.htm:<p><tt class="literal">head</tt> <a href="ch12_12.htm#upt3-CHP-12-SECT-12">Section 12.12</a></p>
ch22_07.htm:<p><tt class="literal">deroff</tt> <a href="ch16_09.htm#upt3-CHP-16-SECT-9">Section 16.9</a>, <tt class="literal">uniq</tt> <a href="ch21_20.htm#upt3-CHP-21-SECT-20">Section 21.20</a></p>
ch22_07.htm:<p><tt class="literal">find</tt> <a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a></p>
ch22_07.htm:(<a name="IXT-22-1567" /><a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>) to print
ch22_07.htm:Next, <i class="command">sort</i> sorts the lengths <b class="emphasis-bold">numerically</b> (<a href="ch22_05.htm#upt3-CHP-22-SECT-5">Section 22.5</a>).
ch22_07.htm:Then <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) strips off the lengths and the spaces and
ch22_08.htm:see <a href="ch41_11.htm#upt3-CHP-41-SECT-11">Section 41.11</a>.
ch23_01.htm:<a name="IXT-23-5493" /><dt><i><b class="emphasis-bold">command &amp;</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>)</i></dt>
ch23_01.htm:<a name="IXT-23-5494" /><dt><i><b class="emphasis-bold">CTRL-c</b> (<a href="ch24_11.htm#upt3-CHP-24-SECT-11">Section 24.11</a>)</i></dt>
ch23_01.htm:Kill the current foreground job by sending the <b class="emphasis-bold">INTR signal</b> (<a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>).
ch23_01.htm:<a name="IXT-23-5495" /><a name="IXT-23-5496" /><dt><i><b class="emphasis-bold">CTRL-z</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>, <a href="ch23_06.htm#upt3-CHP-23-SECT-6">Section 23.6</a>)</i></dt>
ch23_01.htm:Suspend the current foreground job by sending the <b class="emphasis-bold">TSTP signal</b> (<a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>).
ch23_01.htm:(<a href="ch23_07.htm#upt3-CHP-23-SECT-7">Section 23.7</a>).
ch23_01.htm:<a name="IXT-23-5502" /><a name="IXT-23-5503" /><dt><i><b class="emphasis-bold">bg %num</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>)</i></dt>
ch23_01.htm:<a name="IXT-23-5504" /><a name="IXT-23-5505" /><a name="IXT-23-5506" /><dt><i><b class="emphasis-bold">fg %num</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>)</i></dt>
ch23_01.htm:<a name="IXT-23-5507" /><a name="IXT-23-5508" /><dt><i><b class="emphasis-bold">kill %num</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>)</i></dt>
ch23_01.htm:<a name="IXT-23-5509" /><a name="IXT-23-5510" /><a name="IXT-23-5511" /><dt><i><b class="emphasis-bold">kill pid</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>)</i></dt>
ch23_01.htm:<a name="IXT-23-5512" /><a name="IXT-23-5513" /><a name="IXT-23-5514" /><dt><i><b class="emphasis-bold">jobs</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>)</i></dt>
ch23_01.htm:<a name="IXT-23-5515" /><a name="IXT-23-5516" /><dt><i><b class="emphasis-bold">set notify</b> (<a href="ch23_08.htm#upt3-CHP-23-SECT-8">Section 23.8</a>)</i></dt>
ch23_01.htm:<a name="IXT-23-5517" /><a name="IXT-23-5518" /><dt><i><b class="emphasis-bold">stty tostop</b> (<a href="ch23_09.htm#upt3-CHP-23-SECT-9">Section 23.9</a>)</i></dt>
ch23_01.htm:processes by name. See <a href="ch24_15.htm#upt3-CHP-24-SECT-15">Section 24.15</a>, which introduces <i class="command">killall</i>.
ch23_02.htm:control</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>), however, most
ch23_02.htm:the fly with a <b class="emphasis-bold">suspend signal</b> (<a href="ch24_01.htm#upt3-CHP-24-SECT-1">Section 24.1</a>) by typing <a name="IXT-23-5531" /><a name="IXT-23-5532" /><a name="IXT-23-5533" />CTRL-z. Then use
ch23_02.htm:job</b> (<a name="IXT-23-5534" /> <a name="IXT-23-5535" /><a href="ch23_05.htm#upt3-CHP-23-SECT-5">Section 23.5</a>) into the
ch23_04.htm:separated by <b class="emphasis-bold">semicolons</b> (<a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a>) into the background. These shells put only
ch23_04.htm:back until the <b class="emphasis-bold">sleep</b> (<a href="ch25_09.htm#upt3-CHP-25-SECT-9">Section 25.9</a>) command has finished.
ch23_04.htm:<p><tt class="literal">( )</tt> <a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a></p>
ch23_04.htm:<b class="emphasis-bold">stopped</b> (<a href="ch23_01.htm#upt3-CHP-23-SECT-1">Section 23.1</a>) in the background.
ch23_04.htm:<p><b class="emphasis-bold">Stopping vi</b> (<a href="ch23_06.htm#upt3-CHP-23-SECT-6">Section 23.6</a>) is more efficient than using its <b class="emphasis-bold">shell escape mechanism</b> (<a href="ch17_21.htm#upt3-CHP-17-SECT-21">Section 17.21</a>), since it lets you go back to your original
ch23_04.htm:use the <b class="emphasis-bold">nohup</b> (<a href="ch23_10.htm#upt3-CHP-23-SECT-10">Section 23.10</a>) <a name="IXT-23-5561" /><a name="IXT-23-5562" />command.
ch23_04.htm:(<a name="IXT-23-5566" /> <a name="IXT-23-5567" /><a href="ch26_05.htm#upt3-CHP-26-SECT-5">Section 26.5</a>). This is
ch23_06.htm:<b class="emphasis-bold">man</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>)
ch23_06.htm:or <b class="emphasis-bold">info</b> (<a href="ch02_09.htm#upt3-CHP-2-SECT-9">Section 2.9</a>) command when you're in the
ch23_06.htm:(<a href="ch23_01.htm#upt3-CHP-23-SECT-1">Section 23.1</a>), that solves all these problems. (If
ch23_06.htm:it doesn't, you can still use a <b class="emphasis-bold">shell escape</b> (<a href="ch17_21.htm#upt3-CHP-17-SECT-21">Section 17.21</a>).)
ch23_06.htm:my <b class="emphasis-bold">.exrc file</b> (<a href="ch17_05.htm#upt3-CHP-17-SECT-5">Section 17.5</a>) instead.
ch23_07.htm:(<a name="IXT-23-5577" /><a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) some processes, but you'll
ch23_07.htm:<b class="emphasis-bold">renice</b> (<a name="IXT-23-5578" /> <a name="IXT-23-5579" /><a href="ch26_07.htm#upt3-CHP-26-SECT-7">Section 26.7</a>) the
ch23_07.htm:speeds up, unless you're the <b class="emphasis-bold">superuser</b> (<a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>).
ch23_07.htm:<b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>) or
ch23_07.htm:<b class="emphasis-bold">time</b> (<a href="ch26_02.htm#upt3-CHP-26-SECT-2">Section 26.2</a>)
ch23_07.htm:<b class="emphasis-bold">CTRL-z</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>) to stop it. If the job is running in the
ch23_07.htm:can use <b class="emphasis-bold">kill</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) with the <span class="option">-STOP</span> signal and
ch23_07.htm:file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>). Later, when the
ch23_08.htm:tostop</b> (<a href="ch23_09.htm#upt3-CHP-23-SECT-9">Section 23.9</a>).
ch23_09.htm:(<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>) its output, text that the job writes
ch23_09.htm:(<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>).</p> </blockquote>
ch23_09.htm:stopped. To make it do that, set <b class="emphasis-bold">notify</b> (<a href="ch23_08.htm#upt3-CHP-23-SECT-8">Section 23.8</a>).
ch23_10.htm:down all its <b class="emphasis-bold">child processes</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) with it.
ch23_10.htm:(<a name="IXT-23-5604" /> <a name="IXT-23-5605" /><a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>), though
ch23_10.htm:<b class="emphasis-bold">trap</b> (<a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>)
ch23_11.htm:shell sends my background job a HUP signal. I could use <b class="emphasis-bold">nohup</b> (<a href="ch23_10.htm#upt3-CHP-23-SECT-10">Section 23.10</a>) to block
ch23_11.htm:control on, so the jobs are just cluttering the <b class="emphasis-bold">jobs</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>) list.
ch23_11.htm:start the job in a <b class="emphasis-bold">subshell</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>), and put the job inside that subshell into
ch23_11.htm:list, but <b class="emphasis-bold">ps</b> (<a name="IXT-23-5610" /><a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>) should
ch23_11.htm:process</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>)) is 1; this means
ch23_11.htm:<b class="emphasis-bold">init</b> (<a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>).
ch23_12.htm:consoles</em>, a series of <b class="emphasis-bold">ttys</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>) that you
ch23_12.htm:<em class="emphasis">tty</em>s, with <b class="emphasis-bold">getty</b> (<a name="IXT-23-5624" /><a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>) processes
ch23_12.htm:<p><tt class="literal">cat &gt;</tt> <a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a></p>
ch24_01.htm:(<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>, <a href="ch24_06.htm#upt3-CHP-24-SECT-6">Section 24.6</a>,
ch24_01.htm:<a href="ch24_08.htm#upt3-CHP-24-SECT-8">Section 24.8</a>).
ch24_01.htm:<p>What are signals (<a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>)?</p>
ch24_01.htm:<p>How to send signals from the keyboard (<a href="ch24_11.htm#upt3-CHP-24-SECT-11">Section 24.11</a> and <a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>; also see
ch24_01.htm:<a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>).
ch24_01.htm:signals (<a href="ch24_13.htm#upt3-CHP-24-SECT-13">Section 24.13</a> and <a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>). 
ch24_01.htm:<p>How to kill all your processes (<a href="ch24_14.htm#upt3-CHP-24-SECT-14">Section 24.14</a>).</p>
ch24_01.htm:<p>How to kill processes by name rather than by process ID (<a href="ch24_16.htm#upt3-CHP-24-SECT-16">Section 24.16</a>).
ch24_01.htm:<p>How to stop runaway jobs (<a href="ch24_17.htm#upt3-CHP-24-SECT-17">Section 24.17</a>).</p>
ch24_01.htm:kill them (<a href="ch24_18.htm#upt3-CHP-24-SECT-18">Section 24.18</a>, <a href="ch24_19.htm#upt3-CHP-24-SECT-19">Section 24.19</a>). 
ch24_01.htm:<p>How to get rid of a frozen window (<a href="ch24_22.htm#upt3-CHP-24-SECT-22">Section 24.22</a>). 
ch24_01.htm:(<a href="ch23_10.htm#upt3-CHP-23-SECT-10">Section 23.10</a>).
ch24_02.htm:<a href="ch27_02.htm#upt3-CHP-27-SECT-2">Section 27.2</a>, but the concept comes up so
ch24_02.htm:(non-<b class="emphasis-bold">network</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) logins) works. The <i class="command">init</i>
ch24_02.htm:built into the shell</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>).
ch24_02.htm:environment</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>), some commands
ch24_02.htm:prompt; see <a href="ch36_05.htm#upt3-CHP-36-SECT-5">Section 36.5</a>. Watch out, though:
ch24_03.htm:<b class="emphasis-bold">shell</b> (<a href="ch27_01.htm#upt3-CHP-27-SECT-1">Section 27.1</a>). The shell you use may be a variant of the
ch24_03.htm:process is allowed to read from or write to</b> (<a href="ch50_01.htm#upt3-CHP-50-SECT-1">Section 50.1</a>), as well as who is allowed to <b class="emphasis-bold">kill the process</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) (tell it to stop running).
ch24_03.htm:<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>.
ch24_03.htm:directory</b> (<a href="ch01_15.htm#upt3-CHP-1-SECT-15">Section 1.15</a>), it has told you
ch24_03.htm:variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) called
ch24_03.htm:working directory</b> (<a href="ch31_03.htm#upt3-CHP-31-SECT-3">Section 31.3</a>) is the
ch24_03.htm:<b class="emphasis-bold">pathname</b> (<a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>), the program will look in the current working
ch24_03.htm:the current directory (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>
ch24_03.htm:<p><a name="IXT-24-5182" /><a name="IXT-24-5183" /> <a name="IXT-24-5184" />Versions of Unix with <b class="emphasis-bold">job control</b> (<a href="ch23_01.htm#upt3-CHP-23-SECT-1">Section 23.1</a>)
ch24_03.htm:(<a name="IXT-24-5185" /><a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>, <a href="ch24_11.htm#upt3-CHP-24-SECT-11">Section 24.11</a>, <a href="ch24_14.htm#upt3-CHP-24-SECT-14">Section 24.14</a>). It's also used to control
ch24_03.htm:the process that gets the input you type. See <a href="ch24_06.htm#upt3-CHP-24-SECT-6">Section 24.6</a>. 
ch24_03.htm:process ID, since the child is assigned a new one. <b class="emphasis-bold">Built-in shell commands</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>) such as <i class="command">cd</i>
ch24_03.htm:window system such as <b class="emphasis-bold">X</b> (<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>) and want to start up a new
ch24_03.htm:(<a name="IXT-24-5206" /><a name="IXT-24-5207" /><a name="IXT-24-5208" /><a href="ch23_01.htm#upt3-CHP-23-SECT-1">Section 23.1</a>) features (processes that are running in the
ch24_03.htm:vice versa) after that point. For example, if you <b class="emphasis-bold">start up the editor vi, suspend it</b> (<a href="ch24_06.htm#upt3-CHP-24-SECT-6">Section 24.6</a>), and then use the <i class="command">cd</i>
ch24_03.htm:needed</b> (<a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>, <a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>). 
ch24_03.htm:<b class="emphasis-bold">exit status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>) <a name="IXT-24-5210" /> <a name="IXT-24-5211" /><a name="IXT-24-5212" /><a name="IXT-24-5213" />to its parent process. By convention, a
ch24_03.htm:<b class="emphasis-bold">manipulate file descriptors</b> (<a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>).<a name="IXTR3-5461" /> 
ch24_04.htm:process starts another process), the new process runs as a <b class="emphasis-bold">subprocess</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) or
ch24_04.htm:without a <em class="emphasis">fork</em> first. <a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a> explains.</p> </blockquote><blockquote class="footnote"> <a name="FOOTNOTE-71" /><p> [71]When you use the
ch24_04.htm:shell's <b class="emphasis-bold">exec</b> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>) command, it does not start a
ch24_04.htm:are run in a subshell (unless you use the <b class="emphasis-bold">source or . commands</b> (<a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>) to start the script). If the script makes
ch24_04.htm:home directory, reset some aliases, use a different <b class="emphasis-bold">PATH</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>), whatever.
ch24_04.htm:<p><a name="IXT-24-5219" /><a name="IXT-24-5220" /><a name="IXT-24-5221" />If your parent shell has <b class="emphasis-bold">job control</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>),
ch24_04.htm:(or <b class="emphasis-bold">kill -STOP $$</b> (<a href="ch27_17.htm#upt3-CHP-27-SECT-17">Section 27.17</a>)) will stop it. Otherwise, just type CTRL-z at
ch24_04.htm:<p><tt class="literal">prompt</tt> <a href="ch04_01.htm#upt3-CHP-4-SECT-1">Section 4.1</a></p>
ch24_04.htm:escape</b> (<a href="ch17_21.htm#upt3-CHP-17-SECT-21">Section 17.21</a>) starts a subshell.
ch24_04.htm:(usually CTRL-d) will do the same thing. <a href="ch35_16.htm#upt3-CHP-35-SECT-16">Section 35.16</a> explains how <i class="command">exit</i> sets a
ch24_05.htm:terminal</b> (<a href="ch24_06.htm#upt3-CHP-24-SECT-6">Section 24.6</a>).
ch24_05.htm:output to <b class="emphasis-bold">head</b> (<a href="ch12_12.htm#upt3-CHP-12-SECT-12">Section 12.12</a>), which will display the most active
ch24_05.htm:(<tt class="literal">f77</tt>). This process has <b class="emphasis-bold">PID</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) 12923 and
ch24_05.htm:<p><b class="emphasis-bold">User ID</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) of process owner
ch24_05.htm:<p>T: <b class="emphasis-bold">Stopped</b> (<a href="ch23_01.htm#upt3-CHP-23-SECT-1">Section 23.1</a>) 
ch24_05.htm:<p>Z: <b class="emphasis-bold">Zombie process</b> (<a href="ch24_19.htm#upt3-CHP-24-SECT-19">Section 24.19</a>) 
ch24_05.htm:<p>N (BSD): <b class="emphasis-bold">Niced</b> (<a href="ch26_05.htm#upt3-CHP-26-SECT-5">Section 26.5</a>, <a href="ch26_07.htm#upt3-CHP-26-SECT-7">Section 26.7</a>), execution
ch24_05.htm:raised</b> (<a href="ch26_07.htm#upt3-CHP-26-SECT-7">Section 26.7</a>)
ch24_05.htm:<p>Process <b class="emphasis-bold">nice number</b> (<a href="ch26_05.htm#upt3-CHP-26-SECT-5">Section 26.5</a>) 
ch24_06.htm:<p><a name="IXT-24-5242" /><a name="IXT-24-5243" />In <a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>, we pointed out that the <i class="command">ps</i>
ch24_06.htm:(<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) look to the operating system just like
ch24_06.htm:(<a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>) never had one -- they were started
ch24_06.htm:processes</b> (<a href="ch23_11.htm#upt3-CHP-23-SECT-11">Section 23.11</a>) fit this category
ch24_07.htm:help you track down and <b class="emphasis-bold">kill</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) a runaway process. If it's
ch24_07.htm:orphans</b> (<a name="IXT-24-5258" /><a name="IXT-24-5259" /><a href="ch24_19.htm#upt3-CHP-24-SECT-19">Section 24.19</a>). If you have a serious runaway process
ch24_07.htm:(<a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>) that handle system services like mail,
ch24_07.htm:<b class="emphasis-bold">man</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>)
ch24_07.htm:or <b class="emphasis-bold">info</b> (<a href="ch02_09.htm#upt3-CHP-2-SECT-9">Section 2.9</a>) on the process name.
ch24_07.htm:<p><a href="ch24_22.htm#upt3-CHP-24-SECT-22">Section 24.22</a> shows a similar thing: how to
ch24_08.htm:<b class="emphasis-bold">exec</b> (<a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>)
ch24_09.htm:(<a href="ch01_19.htm#upt3-CHP-1-SECT-19">Section 1.19</a>). On many modern Unix systems, even
ch24_09.htm:(<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>). Some versions of
ch24_09.htm:<p><tt class="literal">-F</tt> <a href="ch08_10.htm#upt3-CHP-8-SECT-10">Section 8.10</a></p>
ch24_09.htm:you want an <b class="emphasis-bold">alias</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) that simply shows how much memory is free,
ch24_09.htm:<p><tt class="literal">grep</tt> <a href="ch13_01.htm#upt3-CHP-13-SECT-1">Section 13.1</a></p>
ch24_09.htm:<b class="emphasis-bold">niced user mode</b> (<a href="ch26_05.htm#upt3-CHP-26-SECT-5">Section 26.5</a>), system (kernel) mode, and the idle task,
ch24_09.htm:the <span class="acronym">CPU</span> ststistics, then the start of an <b class="emphasis-bold">awk</b> (<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>) script that
ch24_09.htm:<p><tt class="literal">!!</tt> <a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a></p>
ch24_09.htm:"directory" is actually a <b class="emphasis-bold">symbolic link</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>)
ch24_09.htm:(<a name="IXT-24-5284" /><a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>) are currently pointing to. This
ch24_09.htm:(disk file, <b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>), pipe, etc.) but the actual full pathname of
ch24_09.htm:(<a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a>) and lists again.
ch24_09.htm:for the process <b class="emphasis-bold">PID</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>). Here are a series of examples of the useful
ch24_09.htm:(<a name="IXT-24-5289" /><a name="IXT-24-5290" /><a name="IXT-24-5291" /><a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) to
ch24_09.htm:(<a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>) command translates the NUL-separated
ch24_09.htm:you'd like to know what the <b class="emphasis-bold">EXINIT</b> (<a href="ch17_27.htm#upt3-CHP-17-SECT-27">Section 17.27</a>)
ch24_09.htm:in <b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>)
ch24_09.htm:process 918 has, or what process started it (its <b class="emphasis-bold">parent</b> <span class="acronym">PID</span> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>)): 
ch24_09.htm:Let's see...using <b class="emphasis-bold">echo</b> (<a href="ch27_05.htm#upt3-CHP-27-SECT-5">Section 27.5</a>) to add a
ch24_09.htm:<p><tt class="literal">;</tt> <a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a></p>
ch24_10.htm:kernel</b> (<a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>)
ch24_10.htm:systems (these can be changed; see <a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>). <a name="IXT-24-5305" /><a name="IXT-24-5306" /><a name="IXT-24-5307" /><a name="IXT-24-5308" /><a name="IXT-24-5309" /><a name="IXT-24-5310" /><a name="IXT-24-5311" /><a name="IXT-24-5312" /><a name="IXT-24-5313" /><a name="IXT-24-5314" /><a name="IXT-24-5315" /><a name="IXT-24-5316" /><a name="IXT-24-5317" /><a name="IXT-24-5318" />
ch24_10.htm:foreground). Sent when you type CTRL-z. <b class="emphasis-bold">stty</b> (<a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>) calls this
ch24_10.htm:<p><a name="IXT-24-5324" /><a name="IXT-24-5325" /><a name="IXT-24-5326" />It can <b class="emphasis-bold">trap</b> (<a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>) the signal
ch24_10.htm:<p>The <b class="emphasis-bold">kill</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) command doesn't
ch24_11.htm:(<a name="IXT-24-5331" /><a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>) will
ch24_11.htm:(interrupt) signal</b> (<a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>) to the
ch24_11.htm:Emacs almost always ignore most signals. The <b class="emphasis-bold">trap</b> (<a name="IXT-24-5339" /> <a name="IXT-24-5340" /><a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>) command handles signals in the Bourne shell.
ch24_11.htm:group</b> (<a name="IXT-24-5341" /><a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>). This
ch24_11.htm:<p><a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a> explains how to set the key that
ch24_11.htm:sends these and other signals. The <b class="emphasis-bold">kill</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) command
ch24_12.htm:<b class="emphasis-bold">signal a process</b> (<a href="ch24_13.htm#upt3-CHP-24-SECT-13">Section 24.13</a>); this is the purpose of the
ch24_12.htm:<p><a name="IXT-24-5351" /><a name="IXT-24-5352" /><a name="IXT-24-5353" />Zombies. A process in the <b class="emphasis-bold">zombie state</b> (<a href="ch24_19.htm#upt3-CHP-24-SECT-19">Section 24.19</a>) is
ch24_12.htm:displayed as <em class="emphasis">Z</em> status in BSD <b class="emphasis-bold">ps</b> (<a name="IXT-24-5354" /><a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>) displays
ch24_12.htm:<p>Processes waiting for unavailable <b class="emphasis-bold">NFS</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) resources
ch24_12.htm:(<a name="IXT-24-5362" /><a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>) to kill someone else's
ch24_12.htm:<p>If you're using the X Window System, <a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a> shows how to find which window has the
ch24_13.htm:(<a name="IXT-24-5363" /><a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>) command to catch several different signals
ch24_13.htm:runs <b class="emphasis-bold">lpq</b> (<a name="IXT-24-5371" /><a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>) on all
ch24_13.htm:user with the <b class="emphasis-bold">write</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) command. (You could change it to write to the
ch24_13.htm:use <b class="emphasis-bold">xmessage</b> (<a href="ch36_26.htm#upt3-CHP-36-SECT-26">Section 36.26</a>) to pop a notice window onto
ch24_13.htm:(<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>, <a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>) away
ch24_13.htm:and shells that kill background jobs when you log out, use <b class="emphasis-bold">nohup</b> (<a href="ch23_10.htm#upt3-CHP-23-SECT-10">Section 23.10</a>).</p>
ch24_13.htm:<p><tt class="literal">/dev/null</tt> <a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a></p>
ch24_13.htm:<p><tt class="literal">kill</tt> <a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a></p>
ch24_13.htm:<b class="emphasis-bold">controlling tty</b> (<a href="ch24_06.htm#upt3-CHP-24-SECT-6">Section 24.6</a>). Also, the error messages that <b class="emphasis-bold">egrep</b> (<a href="ch13_04.htm#upt3-CHP-13-SECT-4">Section 13.4</a>) searches
ch24_14.htm:<p><a name="IXT-24-5374" /><a name="IXT-24-5375" /> <a name="IXT-24-5376" /> <a name="IXT-24-5377" /><a name="IXT-24-5378" />On many Unix systems, <b class="emphasis-bold">kill</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) interprets
ch24_14.htm:<p>To see if your system supports this feature, type <b class="emphasis-bold">man 2 kill</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>) to
ch24_14.htm:through <b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>) to find the right process. The <b class="emphasis-bold">zap</b> (<a href="ch24_16.htm#upt3-CHP-24-SECT-16">Section 24.16</a>) script
ch24_14.htm:control</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>).
ch24_15.htm:version of <b class="emphasis-bold">killall</b> (<a href="ch24_16.htm#upt3-CHP-24-SECT-16">Section 24.16</a>) that doesn't seem to have as
ch24_15.htm:<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) or by process names. To an old
ch24_15.htm:<p><tt class="literal">&amp;</tt> <a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a></p>
ch24_15.htm:version of <b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>). It shows me what the default
ch24_15.htm:executable's directory from the <b class="emphasis-bold">PATH</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>) prepended,
ch24_15.htm:(<a href="ch27_03.htm#upt3-CHP-27-SECT-3">Section 27.3</a>). So (whew): to kill these shell
ch24_15.htm:a process by name is that a process can start a <b class="emphasis-bold">subprocess</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) with
ch24_15.htm:a different name. For instance, if your <b class="emphasis-bold">make</b> (<a href="ch11_10.htm#upt3-CHP-11-SECT-10">Section 11.10</a>) job starts
ch24_15.htm:haven't been <b class="emphasis-bold">disowned</b> (<a href="ch23_11.htm#upt3-CHP-23-SECT-11">Section 23.11</a>), for
ch24_15.htm:can just write an <b class="emphasis-bold">alias</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) to override your shell's
ch24_15.htm:control</b> (<a href="ch23_01.htm#upt3-CHP-23-SECT-1">Section 23.1</a>) numbers like
ch24_15.htm:number -- or use a script like <b class="emphasis-bold">zap</b> (<a href="ch24_16.htm#upt3-CHP-24-SECT-16">Section 24.16</a>) instead.
ch24_16.htm:it's a pain in the neck to run <b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>), figure out
ch24_16.htm:the process ID, and then kill the process -- although <b class="emphasis-bold">sometimes you have to do it that way</b> (<a href="ch24_15.htm#upt3-CHP-24-SECT-15">Section 24.15</a>). We'll look at two easier
ch24_16.htm:says: kills all processes on the system (when run as the <b class="emphasis-bold">superuser</b> (<a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>)).
ch24_16.htm:<p><tt class="literal">&amp;</tt> <a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a>, <tt class="literal">[5]</tt> <a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a></p>
ch24_16.htm:(<a name="IXT-24-5404" /><a href="ch13_04.htm#upt3-CHP-13-SECT-4">Section 13.4</a>) to pick the processes to kill;
ch24_16.htm:<a name="IXT-24-5405" />you can type <b class="emphasis-bold">extended expressions</b> (<a href="ch32_15.htm#upt3-CHP-32-SECT-15">Section 32.15</a>) that match more than one process. The
ch24_16.htm:<p><tt class="literal">'...'</tt> <a href="ch36_24.htm#upt3-CHP-36-SECT-24">Section 36.24</a></p>
ch24_16.htm:processes. Your version of <i class="command">ps</i> may need <b class="emphasis-bold">different options</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>). 
ch24_16.htm:<b class="emphasis-bold">awk</b> (<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>)
ch24_16.htm:<i class="command">pick</i>. The inner set of <b class="emphasis-bold">nested</b> (<a href="ch36_24.htm#upt3-CHP-36-SECT-24">Section 36.24</a>)
ch24_16.htm:<b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) in <i class="command">zap</i> pass
ch24_16.htm:(<a href="ch36_23.htm#upt3-CHP-36-SECT-23">Section 36.23</a>) to just a newline,
ch24_16.htm:backquotes passes <b class="emphasis-bold">kill</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) the output of <i class="command">pick</i>,
ch24_16.htm:<p><tt class="literal">/dev/tty</tt> <a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a></p>
ch24_17.htm:<a name="IXT-24-5411" />processes <b class="emphasis-bold">forking</b> (<a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>) out of
ch24_17.htm:(<a name="IXT-24-5412" /><a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>), there's a good answer: use
ch24_17.htm:<p><tt class="literal">kill</tt> <a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a></p>
ch24_17.htm:into the shell</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>) (like
ch24_17.htm:<b class="emphasis-bold">killall</b> (<a href="ch24_16.htm#upt3-CHP-24-SECT-16">Section 24.16</a>), which would be nice to use in this
ch24_17.htm:built-in <b class="emphasis-bold">wildcard matching</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>) to show you the shell's
ch24_17.htm:<p><tt class="literal">exec</tt> <a href="ch36_05.htm#upt3-CHP-36-SECT-5">Section 36.5</a></p>
ch24_18.htm:process that (according to <b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>)) has been sleeping for several days, waiting
ch24_18.htm:for input. If you can't <b class="emphasis-bold">kill</b> (<a href="ch23_12.htm#upt3-CHP-23-SECT-12">Section 23.12</a>) the
ch24_19.htm:<b class="emphasis-bold">open file descriptors</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) and shutting down other resources (memory,
ch24_19.htm:<a name="IXT-24-5425" />hold on to its name and <b class="emphasis-bold">exit status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>).
ch24_19.htm:<b class="emphasis-bold">fork</b> (<a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>);
ch24_19.htm:(the PID of <b class="emphasis-bold">init</b> (<a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>)). While the original parent is around, it can
ch24_19.htm:single byte of <b class="emphasis-bold">status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>) from each child. The
ch24_20.htm:System</b> (<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>). Actually, a lot of
ch24_20.htm:"first window." Find its <b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>). Next, in
ch24_20.htm:variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) with a unique name
ch24_20.htm:previous <i class="command">xterm</i>'s. Run <b class="emphasis-bold">env or printenv</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>), and you should see the special environment
ch24_20.htm:directory</b> (<a href="ch03_07.htm#upt3-CHP-3-SECT-7">Section 3.7</a>), you may have
ch24_20.htm:steps, you've started a chain of <b class="emphasis-bold">processes</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>).
ch24_20.htm:-ef</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>). You should get lines
ch24_20.htm:<b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>)
ch24_20.htm:<b class="emphasis-bold">init</b> (<a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>),
ch24_20.htm:(<a name="IXT-24-5431" /><a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) a hung window or a process in a window.
ch24_20.htm:<i class="command">xterm</i> gets a <b class="emphasis-bold">signal</b> (<a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>), and the
ch24_20.htm:you had started the second <i class="command">xterm</i> in the <b class="emphasis-bold">background</b> (<a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a>), you
ch24_21.htm:<a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>, when the process exits, the
ch24_21.htm:window, use the <b class="emphasis-bold">-e option</b> (<a href="ch05_22.htm#upt3-CHP-5-SECT-22">Section 5.22</a>), followed by the command line to run the
ch24_21.htm:with a scrollbar. Start by choosing a file and using <b class="emphasis-bold">wc -l</b> (<a href="ch16_06.htm#upt3-CHP-16-SECT-6">Section 16.6</a>) to count
ch24_21.htm:<p><tt class="literal">cat</tt> <a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a></p>
ch24_21.htm:<b class="emphasis-bold">read command</b> (<a href="ch35_18.htm#upt3-CHP-35-SECT-18">Section 35.18</a>) to pause until you give a dummy
ch24_21.htm:interprets it. The three commands are separated by <b class="emphasis-bold">semicolons (;)</b> (<a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a>).
ch24_21.htm:the <tt class="literal">sh -c '...'</tt> to run a little <b class="emphasis-bold">shell script</b> (<a href="ch35_01.htm#upt3-CHP-35-SECT-1">Section 35.1</a>)
ch24_22.htm:rid of it, the easier way is usually to <b class="emphasis-bold">kill</b> (<a href="ch24_12.htm#upt3-CHP-24-SECT-12">Section 24.12</a>) the
ch24_22.htm:process. As <a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a> explains, there may
ch24_22.htm:(<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>) to track down the process(es) behind
ch24_22.htm:<b class="emphasis-bold">set user ID</b> (<a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a>) -- you can use run <tt class="literal">ps
ch24_22.htm:of process IDs, parent-to-child, in that window. The <b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>) of the
ch24_22.htm:is still alive by trying to open its <b class="emphasis-bold">menus</b> (<a href="ch05_17.htm#upt3-CHP-5-SECT-17">Section 5.17</a>). If a
ch24_22.htm:<p><tt class="literal">-9</tt> <a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a></p>
ch24_22.htm:console</b> (<a href="ch23_12.htm#upt3-CHP-23-SECT-12">Section 23.12</a>)). So the processes
ch24_22.htm:owned by the <b class="emphasis-bold">init</b> (<a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>) process (<span class="acronym">PID</span> 1), these
ch24_22.htm:were either <b class="emphasis-bold">disowned</b> (<a href="ch23_11.htm#upt3-CHP-23-SECT-11">Section 23.11</a>) by Mozilla, or somehow the top-level
ch24_22.htm:<b class="emphasis-bold">zombie process</b> (<a href="ch24_19.htm#upt3-CHP-24-SECT-19">Section 24.19</a>) that can't be killed, but it
ch24_22.htm:accesses and the zombie is tying up the hardware. <a href="ch24_18.htm#upt3-CHP-24-SECT-18">Section 24.18</a> has some ways to clean up in that case.
ch24_22.htm:(<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>), or names:
ch24_22.htm:<p><tt class="literal">$!</tt> <a href="ch27_17.htm#upt3-CHP-27-SECT-17">Section 27.17</a>, <tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch24_22.htm:<i class="command">xmessage</i> in the background (that is, <b class="emphasis-bold">disowned</b> (<a href="ch23_11.htm#upt3-CHP-23-SECT-11">Section 23.11</a>)) and
ch25_01.htm:<b class="emphasis-bold"> cron</b> (<a name="IXT-25-5068" /><a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>) system
ch25_01.htm:<b class="emphasis-bold">at</b> (<a name="IXT-25-5069" /><a name="IXT-25-5070" /><a name="IXT-25-5071" /><a href="ch25_05.htm#upt3-CHP-25-SECT-5">Section 25.5</a>) command is ideally suited.
ch25_01.htm:(<a href="ch25_09.htm#upt3-CHP-25-SECT-9">Section 25.9</a>) command is available.
ch25_02.htm:(<a name="IXT-25-5078" /><a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>),
ch25_02.htm:path</b> (<a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a>) is usually shorter;
ch25_02.htm:(<a name="IXT-25-5084" /> <a name="IXT-25-5085" /><a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>). What to
ch25_02.htm:a <b class="emphasis-bold">relative pathname</b> (<a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>), it will probably be in your home directory.
ch25_02.htm:<p><tt class="literal">/proc</tt> <a href="ch24_09.htm#upt3-CHP-24-SECT-9">Section 24.9</a>,
ch25_02.htm:<tt class="literal">2&gt;&amp;1</tt> <a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>, <tt class="literal">\%</tt> <a href="ch25_04.htm#upt3-CHP-25-SECT-4">Section 25.4</a></p>
ch25_02.htm:runs the commands together in a <b class="emphasis-bold">subshell</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>).) The
ch25_02.htm:wear and tear and load on your disk, try to <b class="emphasis-bold">combine find jobs</b> (<a href="ch14_19.htm#upt3-CHP-14-SECT-19">Section 14.19</a>). Also, as <a href="ch25_08.htm#upt3-CHP-25-SECT-8">Section 25.8</a> explains, try <em class="emphasis">not</em> to
ch25_02.htm:discarding it to <b class="emphasis-bold">/dev/null</b> (<a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a>). If no output redirection is performed, the
ch25_02.htm:shown in the seventh entry. He uses the <b class="emphasis-bold">test</b> (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>) and
ch25_02.htm:operator</b> (<a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>) runs the
ch25_03.htm:see <a href="ch25_06.htm#upt3-CHP-25-SECT-6">Section 25.6</a>.
ch25_06.htm:<i class="command">at</i> output into the Unix trash can, <b class="emphasis-bold">/dev/null</b> (<a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a>):
ch25_06.htm:<p><tt class="literal">&gt;&amp;</tt> <a href="ch43_05.htm#upt3-CHP-43-SECT-5">Section 43.5</a></p>
ch25_06.htm:<p><tt class="literal">exec &gt;</tt> <a href="ch36_05.htm#upt3-CHP-36-SECT-5">Section 36.5</a></p>
ch25_07.htm:<a href="ch25_08.htm#upt3-CHP-25-SECT-8">Section 25.8</a>. The jobs are ordered according
ch25_07.htm:<b class="emphasis-bold">emptying the file</b> (<a href="ch15_02.htm#upt3-CHP-15-SECT-2">Section 15.2</a>). Or the <b class="emphasis-bold">superuser</b> (<a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>) can
ch25_08.htm:<b class="emphasis-bold">at -l</b> (<a href="ch24_07.htm#upt3-CHP-24-SECT-7">Section 24.7</a>)
ch25_08.htm:(<a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>), you won't be able to
ch25_09.htm:<p><tt class="literal">( ) &amp;</tt> <a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>, <tt class="literal">;</tt> <a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a></p>
ch25_09.htm:(<a href="ch25_05.htm#upt3-CHP-25-SECT-5">Section 25.5</a>), and you have to run a job later (say,
ch25_09.htm:<p><tt class="literal">!!</tt> <a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a></p>
ch25_09.htm:<b class="emphasis-bold">mail</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>)
ch25_09.htm:<p><tt class="literal">foreach</tt> <a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a></p>
ch26_01.htm:(<a name="IXT-26-4988" /><a href="ch26_04.htm#upt3-CHP-26-SECT-4">Section 26.4</a>) to see how many processes were recently
ch26_01.htm:(<a name="IXT-26-4996" /><a href="ch26_02.htm#upt3-CHP-26-SECT-2">Section 26.2</a>) command exists as part of both C and
ch26_03.htm:The <tt class="literal">emacs</tt> process on the <b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>) ttyp1
ch26_03.htm:stopped</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>) to run
ch26_03.htm:<p><tt class="literal">tee</tt> <a href="ch43_08.htm#upt3-CHP-43-SECT-8">Section 43.8</a></p>
ch26_03.htm:(<a href="ch37_07.htm#upt3-CHP-37-SECT-7">Section 37.7</a>) and then run
ch26_03.htm:shell</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>). Those commands are
ch26_04.htm:priorities and <b class="emphasis-bold">niceness</b> (<a href="ch26_05.htm#upt3-CHP-26-SECT-5">Section 26.5</a>) of the processes that are running.
ch26_04.htm:CPU-bound background job at the same time as the <b class="emphasis-bold">X Window System</b> (<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>)
ch26_05.htm:(<a name="IXT-26-5016" /><a href="ch26_01.htm#upt3-CHP-26-SECT-1">Section 26.1</a>) process that will monopolize the CPU from
ch26_05.htm:renice(8) command</b> (<a href="ch26_07.htm#upt3-CHP-26-SECT-7">Section 26.7</a>); this
ch26_05.htm:like a text editor. See <a href="ch26_06.htm#upt3-CHP-26-SECT-6">Section 26.6</a>.
ch26_05.htm:lower priority) for their jobs. Only the <b class="emphasis-bold">superuser</b> (<a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>) can
ch26_05.htm:version in any situation: within <b class="emphasis-bold">makefiles</b> (<a href="ch11_10.htm#upt3-CHP-11-SECT-10">Section 11.10</a>), when
ch26_06.htm:<b class="emphasis-bold">foreground job</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>). If the system gets busy, your terminal could
ch26_06.htm:time to do something. You may not even be able to <b class="emphasis-bold">kill</b> (<a href="ch24_11.htm#upt3-CHP-24-SECT-11">Section 24.11</a>) a
ch26_07.htm:nice level</b> (<a href="ch26_05.htm#upt3-CHP-26-SECT-5">Section 26.5</a>) for the job. It
ch26_07.htm:is the <b class="emphasis-bold">ID number</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) (as shown by <b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>)) of the
ch26_07.htm:(<a name="IXT-26-5050" /><a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>), as shown by <em class="emphasis">ps -l</em>; this
ch27_01.htm:shell has to break the command into words and expand <b class="emphasis-bold">aliases</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>),
ch27_01.htm:<b class="emphasis-bold">history operators</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>), and <b class="emphasis-bold">shell and
ch27_01.htm:environment variables</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>, <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>). It also <b class="emphasis-bold">sets up
ch27_01.htm:standard input and output streams</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>) and performs a lot of other tasks. Indeed, if
ch27_02.htm:<b class="emphasis-bold">external command</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>), what happens?
ch27_02.htm:some Unix manuals. <a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a> has more
ch27_03.htm:<em class="emphasis">cat -v afile bfile &gt; cfile</em>), <b class="emphasis-bold">interprets it</b> (<a href="ch27_01.htm#upt3-CHP-27-SECT-1">Section 27.1</a>),
ch27_03.htm:command is <b class="emphasis-bold">in the background</b> (<a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a>)), the shell is ready to read another command
ch27_03.htm:script</b> (<a href="ch35_01.htm#upt3-CHP-35-SECT-1">Section 35.1</a>) or shell program.
ch27_03.htm:you type from a terminal (though the shell uses its <b class="emphasis-bold">non-interactive mode</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>), which means, basically, that it
ch27_03.htm:<b class="emphasis-bold">bash</b> (<a href="ch01_06.htm#upt3-CHP-1-SECT-6">Section 1.6</a>),
ch27_03.htm:<p><a name="IXT-27-4801" />As <a href="ch26_06.htm#upt3-CHP-26-SECT-6">Section 26.6</a> explains, if the shell is trying to run a
ch27_03.htm:<a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>.
ch27_03.htm:<p>Newer Bourne shells have features -- such as <b class="emphasis-bold">shell functions</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>), an <i class="command">unset</i> command for
ch27_03.htm:yourself</b> (<a href="ch04_01.htm#upt3-CHP-4-SECT-1">Section 4.1</a>). If your account
ch27_03.htm:default. This is normally done using the <b class="emphasis-bold">special #! notation</b> (<a href="ch36_02.htm#upt3-CHP-36-SECT-2">Section 36.2</a>) in the first line of the script.
ch27_05.htm:named <i class="command">showargs</i>; you might want to <b class="emphasis-bold">save it in a file and run it yourself</b> (<a href="ch35_01.htm#upt3-CHP-35-SECT-1">Section 35.1</a>). The script shows how many arguments were
ch27_05.htm:later, its built-in <b class="emphasis-bold">echo</b> (<a href="ch27_05.htm#upt3-CHP-27-SECT-5">Section 27.5</a>) command has the <span class="option">-E</span> option to
ch27_05.htm:<p><tt class="literal">cat</tt> <a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>,
ch27_05.htm:<tt class="literal">&amp;&amp;</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>,
ch27_05.htm:<tt class="literal">$#</tt> <a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>, <tt class="literal">path</tt> <a href="ch35_07.htm#upt3-CHP-35-SECT-7">Section 35.7</a></p>
ch27_06.htm:<a name="upt3-IDXTERM-3971" /> <a name="upt3-IDXTERM-3972" /><a name="IXT-27-4826" />Your <b class="emphasis-bold">search path</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>,
ch27_06.htm:<a href="ch35_07.htm#upt3-CHP-35-SECT-7">Section 35.7</a>) controls what directories -- and in
ch27_06.htm:what order -- the shell searches for <b class="emphasis-bold">external</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>)
ch27_06.htm:file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>). You might also want
ch27_06.htm:(<a name="IXT-27-4827" /><a name="IXT-27-4828" /><a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>).
ch27_06.htm:simply to add the new directory's <b class="emphasis-bold">absolute path</b> (<a name="IXT-27-4829" /><a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>) to the end of the existing
ch27_06.htm:<p><a name="IXT-27-4835" /><a name="IXT-27-4836" />Searching the <b class="emphasis-bold">path</b> (<a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a>) takes
ch27_07.htm:<p><tt class="literal">wc</tt> <a href="ch16_06.htm#upt3-CHP-16-SECT-6">Section 16.6</a></p>
ch27_08.htm:<a name="IXT-27-4851" />you read the <b class="emphasis-bold">previous article</b> (<a href="ch27_07.htm#upt3-CHP-27-SECT-7">Section 27.7</a>), you saw that, most of the time, the shell
ch27_08.htm:program</b> (<a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>):
ch27_08.htm:in <a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 5.3</a> and others.
ch27_09.htm:<b class="emphasis-bold">shell function</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>), a <b class="emphasis-bold">built-in
ch27_09.htm:command</b> (<a name="IXT-27-4856" /> <a name="IXT-27-4857" /><a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>), or an
ch27_09.htm:<b class="emphasis-bold">external command</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>). 
ch27_09.htm:<b class="emphasis-bold">PATH</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>))
ch27_10.htm:<p>[<a href="ch27_09.htm#upt3-CHP-27-SECT-9">Section 27.9</a> <a name="IXT-27-4866" />shows
ch27_11.htm:(<a name="IXT-27-4876" /> <a name="IXT-27-4877" /> <a name="IXT-27-4878" /><a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>) to a file:
ch27_11.htm:<p><a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a> has much more about the
ch27_12.htm:is slightly more complicated. See <a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>.) 
ch27_12.htm:substitution</b> (<a name="IXT-27-4884" /><a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>).
ch27_12.htm:substitution</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>).
ch27_12.htm:!</b> (<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>) except that, in
ch27_12.htm:(Don't use C shell; <b class="emphasis-bold">it's different</b> (<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>).) If you need to start a Bourne-type shell,
ch27_12.htm:<tt class="literal">\*</tt> is a literal asterisk, not a <b class="emphasis-bold">filename wildcard</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>). So, the first <b class="emphasis-bold">expr</b> (<a href="ch36_21.htm#upt3-CHP-36-SECT-21">Section 36.21</a>) command
ch27_12.htm:those two examples using <b class="emphasis-bold">echo</b> (<a href="ch27_05.htm#upt3-CHP-27-SECT-5">Section 27.5</a>) instead of <i class="command">expr</i>.)
ch27_12.htm:<b class="emphasis-bold">comment character</b> (<a href="ch35_01.htm#upt3-CHP-35-SECT-1">Section 35.1</a>). That means the shell will ignore the rest of
ch27_12.htm:substitution</b> (<a name="IXT-27-4902" /><a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>, <a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) and <b class="emphasis-bold">command
ch27_12.htm:substitution</b> (<a name="IXT-27-4903" /><a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) inside
ch27_12.htm:was expanded into the shell's <b class="emphasis-bold">process ID number</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) (in this shell, <tt class="literal">18437</tt>).
ch27_12.htm:(<a name="IXT-27-4904" /><a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) with a multiline message, the kind that might
ch27_12.htm:Bourne shell <a name="IXT-27-4905" /><a name="IXT-27-4906" />prints <b class="emphasis-bold">secondary prompts</b> (<a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a>) (<tt class="literal">&gt;</tt>) until all quotes
ch27_13.htm:haven't read <a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>
ch27_13.htm:substitution</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>) inside quotes.
ch27_13.htm:<p><a href="ch29_10.htm#upt3-CHP-29-SECT-10">Section 29.10</a> shows an amazing pair of aliases
ch27_14.htm:<p><tt class="literal">/dev/null</tt> <a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a></p>
ch27_14.htm:determine the end of each argument. <b class="emphasis-bold">Quoting</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>, <a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>) changes that -- for example, the
ch27_15.htm:<p><tt class="literal">set</tt> <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch27_15.htm:<p>If you wish to turn the options off, use <b class="emphasis-bold">unset</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) instead
ch27_16.htm:<p>This is very useful because <b class="emphasis-bold">variables</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>,
ch27_16.htm:<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) are evaluated during this operation.
ch27_16.htm:<a name="IXT-27-4941" />anonymous <b class="emphasis-bold">ftp</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>)<a href="#FOOTNOTE-84">[84]</a> from a shell script:
ch27_16.htm:substitutions</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) are done. If
ch27_16.htm:<a href="ch36_19.htm#upt3-CHP-36-SECT-19">Section 36.19</a>.
ch27_17.htm:expressions</b> (<a href="ch32_01.htm#upt3-CHP-32-SECT-1">Section 32.1</a>), you should
ch27_17.htm:understand how <b class="emphasis-bold">quoting</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) works in Unix.
ch27_17.htm:expression</b> (<a href="ch32_02.htm#upt3-CHP-32-SECT-2">Section 32.2</a>). If you need a
ch27_17.htm:<tt class="literal">!$</tt>, and so on; see <a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a> instead.
ch27_17.htm:<p><a href="ch28_06.htm#upt3-CHP-28-SECT-6">Section 28.6</a></p>
ch27_17.htm:<p><a href="ch28_06.htm#upt3-CHP-28-SECT-6">Section 28.6</a></p>
ch27_17.htm:<p><a href="ch35_01.htm#upt3-CHP-35-SECT-1">Section 35.1</a></p>
ch27_17.htm:<p><a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch27_17.htm:<p><a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a></p>
ch27_17.htm:<p><a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a></p>
ch27_17.htm:<p><a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>, <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch27_17.htm:<p><a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch27_17.htm:<p><a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a></p>
ch27_17.htm:<p><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch27_17.htm:<p><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch27_17.htm:<p><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch27_17.htm:<p><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch27_17.htm:<p><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch27_17.htm:<p><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch27_17.htm:<p><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch27_17.htm:<p><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch27_17.htm:<p><a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch27_17.htm:<p><a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch27_17.htm:<p><a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch27_17.htm:<p><a href="ch01_05.htm#upt3-CHP-1-SECT-5">Section 1.5</a>, <a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a></p>
ch27_17.htm:<p><a href="ch43_05.htm#upt3-CHP-43-SECT-5">Section 43.5</a></p>
ch27_17.htm:<p><a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a></p>
ch27_17.htm:<p><a href="ch30_05.htm#upt3-CHP-30-SECT-5">Section 30.5</a></p>
ch27_17.htm:<p><a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a></p>
ch27_17.htm:<p><a href="ch23_11.htm#upt3-CHP-23-SECT-11">Section 23.11</a></p>
ch27_17.htm:<p><a href="ch23_11.htm#upt3-CHP-23-SECT-11">Section 23.11</a></p>
ch27_17.htm:<p><a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>, <a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a></p>
ch27_17.htm:<p><a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>, <a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a></p>
ch27_17.htm:<p><a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a></p>
ch27_17.htm:<p><a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a></p>
ch27_17.htm:<p><a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a></p>
ch27_17.htm:<p><a href="ch30_02.htm#upt3-CHP-30-SECT-2">Section 30.2</a></p>
ch27_17.htm:<p><a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a></p>
ch27_17.htm:<p><a href="ch03_19.htm#upt3-CHP-3-SECT-19">Section 3.19</a></p>
ch27_17.htm:<p><a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>,</p>
ch27_17.htm:<p><a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>,</p>
ch27_17.htm:<p><a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a></p>
ch27_17.htm:<p><a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a></p>
ch27_17.htm:<p><a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a></p>
ch27_17.htm:<p><a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a></p>
ch27_17.htm:<p><a href="ch04_15.htm#upt3-CHP-4-SECT-15">Section 4.15</a></p>
ch27_17.htm:<p><a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a></p>
ch27_17.htm:<p><a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a></p>
ch27_17.htm:<p><a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a></p>
ch27_17.htm:<p><a href="ch36_24.htm#upt3-CHP-36-SECT-24">Section 36.24</a>, <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch27_17.htm:<p><a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a></p>
ch27_17.htm:<p><a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a></p>
ch27_17.htm:<p><a href="ch31_05.htm#upt3-CHP-31-SECT-5">Section 31.5</a>, <a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a></p>
ch27_17.htm:<p><a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a></p>
ch27_17.htm:<p><a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>, <a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a></p>
ch27_17.htm:<p><a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a></p>
ch27_17.htm:<p><a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a></p>
ch27_17.htm:<p><a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a></p>
ch27_17.htm:<p><a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a></p>
ch27_17.htm:<p><a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a></p>
ch27_17.htm:<p><a href="ch43_06.htm#upt3-CHP-43-SECT-6">Section 43.6</a></p>
ch27_17.htm:<p><a href="ch43_06.htm#upt3-CHP-43-SECT-6">Section 43.6</a></p>
ch27_17.htm:<p><a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a></p>
ch27_17.htm:<p><a href="ch43_06.htm#upt3-CHP-43-SECT-6">Section 43.6</a></p>
ch27_17.htm:<p><a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a></p>
ch27_17.htm:<p><a href="ch27_16.htm#upt3-CHP-27-SECT-16">Section 27.16</a>, <a href="ch28_13.htm#upt3-CHP-28-SECT-13">Section 28.13</a></p>
ch27_17.htm:<p><a href="ch27_16.htm#upt3-CHP-27-SECT-16">Section 27.16</a></p>
ch27_17.htm:<p><a href="ch27_16.htm#upt3-CHP-27-SECT-16">Section 27.16</a></p>
ch27_17.htm:<p><a href="ch43_05.htm#upt3-CHP-43-SECT-5">Section 43.5</a></p>
ch27_17.htm:<p><a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a></p>
ch27_17.htm:<p><a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a></p>
ch27_17.htm:<p><a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a></p>
ch27_17.htm:<p><a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a></p>
ch27_17.htm:<p><a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a></p>
ch27_17.htm:<p><a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a></p>
ch27_18.htm:<p>In the first case, the shell uses the backslash to <b class="emphasis-bold">quote</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) the
ch27_18.htm:<b class="emphasis-bold">quote</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>)
ch28_01.htm:once</b><a href="ch28_08.htm#upt3-CHP-28-SECT-8">Section 28.8</a>).
ch28_01.htm:(<a name="IXT-28-4540" /><a href="ch28_06.htm#upt3-CHP-28-SECT-6">Section 28.6</a>, <a href="ch28_07.htm#upt3-CHP-28-SECT-7">Section 28.7</a>), which allows you to type the beginning of a
ch28_01.htm:(<a name="IXT-28-4541" /><a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>), which lets you use the output from one
ch28_01.htm:methods</b> (<a href="ch28_10.htm#upt3-CHP-28-SECT-10">Section 28.10</a>, <a href="ch28_11.htm#upt3-CHP-28-SECT-11">Section 28.11</a>). 
ch28_01.htm:long</b> (<a href="ch28_17.htm#upt3-CHP-28-SECT-17">Section 28.17</a>).
ch28_01.htm:<p><b class="emphasis-bold">Job control</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>), which lets you run several commands at the
ch28_01.htm:<p><b class="emphasis-bold">Aliases</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>), or abbreviations, for commands. <b class="emphasis-bold">Shell functions</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>)
ch28_01.htm:<p><b class="emphasis-bold">Command-line editing</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>) and <b class="emphasis-bold">history
ch28_01.htm:substitution</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>). These are two
ch28_01.htm:<p><b class="emphasis-bold">Quoting</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>, <a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>), the way you
ch28_01.htm:<p><b class="emphasis-bold">Wildcards</b> (<a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>). 
ch28_02.htm:interrupts you with <b class="emphasis-bold">write</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) to say it's time for lunch.
ch28_03.htm:editor or the <b class="emphasis-bold">touch</b> (<a href="ch14_08.htm#upt3-CHP-14-SECT-8">Section 14.8</a>) command:
ch28_03.htm:<p>Stumped? Take a look at <a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a> about
ch28_03.htm:(<a href="ch14_08.htm#upt3-CHP-14-SECT-8">Section 14.8</a>) or <tt class="literal">touch
ch28_03.htm:<p><a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a> explains shell <tt class="literal">{
ch28_03.htm:simply <b class="emphasis-bold">quote</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) its name to remove it:
ch28_04.htm:to <b class="emphasis-bold">*, ?, and [ ]</b> (<a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>), but they don't match
ch28_04.htm:<b class="emphasis-bold">echo</b> (<a href="ch27_05.htm#upt3-CHP-27-SECT-5">Section 27.5</a>)
ch28_04.htm:<p>That would give <b class="emphasis-bold">lpr</b> (<a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>) all of these files:
ch28_04.htm:<tt class="literal">vi</tt> <tt class="literal">/usr/foo/file[a-j]</tt> <b class="emphasis-bold">would not work</b> (<a href="ch28_03.htm#upt3-CHP-28-SECT-3">Section 28.3</a>).
ch28_04.htm:<p><tt class="literal">foreach</tt> <a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a></p>
ch28_04.htm:<p><a name="IXT-28-4558" />To send a <b class="emphasis-bold">mail</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) message to
ch28_04.htm:<b class="emphasis-bold">scp</b> (<a href="ch29_14.htm#upt3-CHP-29-SECT-14">Section 29.14</a>): 
ch28_04.htm:<p><tt class="literal">.</tt> <a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a></p>
ch28_04.htm:your <b class="emphasis-bold">lpr</b> (<a name="IXT-28-4567" /><a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>) command
ch28_05.htm:<i class="command">zsh</i>, and <i class="command">bash</i> do <b class="emphasis-bold">history substitutions</b> <a name="upt3-IDXTERM-4200" /> <a name="upt3-IDXTERM-4201" /> <a name="upt3-IDXTERM-4202" />(<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>) they can also edit the substitution. The C
ch28_05.htm:(<a name="IXT-28-4570" /><a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>).
ch28_05.htm:<b class="emphasis-bold">pathname</b> (<a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>), as follows:
ch28_05.htm:used with C shell <b class="emphasis-bold">variables</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) as:
ch28_05.htm:<p>This is the C shell's answer to the <b class="emphasis-bold">basename</b> (<a href="ch36_13.htm#upt3-CHP-36-SECT-13">Section 36.13</a>)
ch28_05.htm:command but does not execute it</b> (<a href="ch30_11.htm#upt3-CHP-30-SECT-11">Section 30.11</a>): 
ch28_06.htm:variable <b class="emphasis-bold">filec</b> (<a href="ch30_09.htm#upt3-CHP-30-SECT-9">Section 30.9</a>) or <em class="emphasis">complete</em>, then press
ch28_06.htm:This works with <b class="emphasis-bold">pathnames</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>) too: each time you press TAB, the shell
ch28_06.htm:(<a href="ch01_12.htm#upt3-CHP-1-SECT-12">Section 1.12</a>) named <em class="filename">alpha.o</em>.
ch28_06.htm:<em class="emphasis">.o</em> files. <a href="ch28_07.htm#upt3-CHP-28-SECT-7">Section 28.7</a>
ch28_06.htm:problem in most cases. <a href="ch31_10.htm#upt3-CHP-31-SECT-10">Section 31.10</a> shows an
ch28_06.htm:commands</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) to connect to
ch28_06.htm:the <b class="emphasis-bold">MH email system</b> (<a href="ch06_02.htm#upt3-CHP-6-SECT-2">Section 6.2</a>)<a name="IXT-28-4601" />. You use MH
ch28_06.htm:<b class="emphasis-bold">setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>): 
ch28_06.htm:<p><tt class="literal">{ }</tt> <a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a></p>
ch28_06.htm:<i class="command">folder</i> output with <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) to exclude
ch28_06.htm:matches any pattern included with <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) from
ch28_06.htm:the <b class="emphasis-bold">cat</b> (<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>) command, which gives us the contents of
ch28_06.htm:<a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a> has an example of
ch28_07.htm:(<a href="ch28_06.htm#upt3-CHP-28-SECT-6">Section 28.6</a>). For example, you may be more likely
ch28_07.htm:<p><tt class="literal">set</tt> <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch28_07.htm:files</b> (<a href="ch19_04.htm#upt3-CHP-19-SECT-4">Section 19.4</a>)), and so on. <a href="ch01_12.htm#upt3-CHP-1-SECT-12">Section 1.12</a> has a list of them.
ch28_07.htm:Emacs) has to be <b class="emphasis-bold">quoted (</b>(<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>) when it's stored in the
ch28_07.htm:(<a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a>).</p> </blockquote>
ch28_08.htm:<p>Type <b class="emphasis-bold">!!</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>) to repeat the previous command line, or
ch28_08.htm:(<a href="ch30_09.htm#upt3-CHP-30-SECT-9">Section 30.9</a>)
ch28_08.htm:<p>Press <b class="emphasis-bold">the up-arrow key</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>) or a <i class="command">vi</i>- or Emacs-style
ch28_08.htm:mouse</b> (<a href="ch28_10.htm#upt3-CHP-28-SECT-10">Section 28.10</a>)
ch28_08.htm:loops</b> <a name="IXT-28-4617" /> <a name="IXT-28-4618" />(<a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a>) can vary the commands they run by picking a
ch28_08.htm:<a name="IXT-28-4619" />(<a href="ch28_11.htm#upt3-CHP-28-SECT-11">Section 28.11</a>). 
ch28_09.htm:<b class="emphasis-bold">command line editing</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>) or -- as we show here -- <b class="emphasis-bold">history substitution</b>
ch28_09.htm:(<a name="IXT-28-4627" /><a href="ch30_05.htm#upt3-CHP-30-SECT-5">Section 30.5</a>):
ch28_09.htm:<p><tt class="literal">-v</tt> <a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>, <tt class="literal">less</tt> <a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a></p>
ch28_09.htm:a word into a <b class="emphasis-bold">shell variable</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>), then running the command(s). The loop goes
ch28_09.htm:are <b class="emphasis-bold">secondary prompts</b> (<a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a>); the shell will keep printing them until you
ch28_09.htm:filenames. Among other things, you can use <b class="emphasis-bold">wildcards</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>),
ch28_09.htm:<b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) (command substitution), <b class="emphasis-bold">variables</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>,
ch28_09.htm:<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>), and the handy <a name="IXT-28-4631" /><b class="emphasis-bold">curly brace ({})
ch28_09.htm:operators</b> (<a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a>). For example, you
ch28_09.htm:<p><tt class="literal">set</tt> <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch28_09.htm:<b class="emphasis-bold">email</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>)
ch28_09.htm:it's a good idea to put a command like <b class="emphasis-bold">sleep 5</b> (<a href="ch25_09.htm#upt3-CHP-25-SECT-9">Section 25.9</a>) on a
ch28_09.htm:<p><tt class="literal">cat</tt> <tt class="literal">-</tt> <b class="emphasis-bold"><a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a></b>
ch28_09.htm:<b class="emphasis-bold">shell programming</b> (<a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>). I usually don't recommend
ch28_09.htm:prompts</b> (<a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a>); the Bourne shell
ch28_09.htm:have to be filenames. Among other things, you can use <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>)
ch28_09.htm:(<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>, <a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>),
ch28_09.htm:<b class="emphasis-bold">wildcards</b> (<a href="ch33_01.htm#upt3-CHP-33-SECT-1">Section 33.1</a>), and, on shells like <i class="command">bash</i>
ch28_09.htm:operators</b> (<a name="IXT-28-4640" /><a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a>). For
ch28_09.htm:command</b> (<a name="IXT-28-4641" /><a href="ch35_18.htm#upt3-CHP-35-SECT-18">Section 35.18</a>). It reads
ch28_09.htm:<p><a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a> has more information about the
ch28_09.htm:<i class="command">for</i> loop. <a href="ch36_12.htm#upt3-CHP-36-SECT-12">Section 36.12</a>
ch28_10.htm:<b class="emphasis-bold">xterm window</b> (<a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>) or another type of terminal emulator with
ch28_10.htm:paste, try using a scratchpad window or <b class="emphasis-bold">xclipboard</b> (<a href="ch05_19.htm#upt3-CHP-5-SECT-19">Section 5.19</a>).
ch28_11.htm:command over and over again -- for example, <b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>) to monitor
ch28_11.htm:the progress of your background processes, or <b class="emphasis-bold">lpq</b> (<a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>) to know
ch28_11.htm:repeatedly, or even using shell <b class="emphasis-bold">history</b> (<a href="ch30_02.htm#upt3-CHP-30-SECT-2">Section 30.2</a>) to
ch28_12.htm:on the next line. For example, to send a quick <b class="emphasis-bold">write</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) message
ch28_12.htm:(<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>). In <i class="command">tcsh</i>,
ch28_12.htm:to use a program like <i class="command">sed</i> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) from the
ch28_12.htm:<p><tt class="literal">nroff -ms</tt><a href="ch03_21.htm#upt3-CHP-3-SECT-21">Section 3.21</a>, <tt class="literal">lp</tt><a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a> 
ch28_12.htm:programming constructs for non-programmers, the <b class="emphasis-bold">for and foreach loops</b> <a name="IXT-28-4663" /> <a name="IXT-28-4664" />(<a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a>), work. While
ch28_12.htm:script</b> (<a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>), it is often even
ch28_12.htm:<em class="emphasis">.tif</em> are sent through <b class="emphasis-bold">netpbm</b> (<a href="ch45_19.htm#upt3-CHP-45-SECT-19">Section 45.19</a>) filters,
ch28_12.htm:<p><tt class="literal">case</tt> <a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>, <tt class="literal">echo</tt><b class="emphasis-bold"><a href="ch27_05.htm#upt3-CHP-27-SECT-5">Section 27.5</a></b></p>
ch28_13.htm:<p><img src="figs/bomb.gif" alt="Figure " width="24" /> <tt class="literal">&lt;&lt;</tt><a href="ch27_16.htm#upt3-CHP-27-SECT-16">Section 27.16</a> 
ch28_13.htm:(<a href="ch27_16.htm#upt3-CHP-27-SECT-16">Section 27.16</a>) is often used in shell
ch28_13.htm:throwaway script. But you also can just type it in <b class="emphasis-bold">at a Bourne shell prompt</b> (<a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a>). (If you use <i class="command">csh</i> or
ch28_13.htm:<i class="command">tcsh</i>, you can either use a <b class="emphasis-bold">foreach loop</b> (<a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a>) or
ch28_13.htm:<b class="emphasis-bold">start a subshell</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>).) 
ch28_13.htm:(<a name="IXT-28-4669" /><a name="IXT-28-4670" /><a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a>) that prints
ch28_13.htm:three friendly form letters with the <b class="emphasis-bold">lpr</b> (<a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>) command.
ch28_13.htm:don't indent the loop body.) The <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) run
ch28_14.htm:<p><tt class="literal">-l</tt> <a href="ch33_06.htm#upt3-CHP-33-SECT-6">Section 33.6</a></p>
ch28_14.htm:<b class="emphasis-bold">mail message</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) to all the users logged on to the system now.
ch28_14.htm:(<a name="IXT-28-4679" /><a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a>). The <i class="command">who</i> output also lists
ch28_14.htm:(<a name="IXT-28-4680" /><a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>):
ch28_14.htm:<b class="emphasis-bold">sort -u</b> (<a href="ch22_06.htm#upt3-CHP-22-SECT-6">Section 22.6</a>). You're done. Just put the
ch28_14.htm:(<a href="ch26_05.htm#upt3-CHP-26-SECT-5">Section 26.5</a>):
ch28_14.htm:<a name="IXT-28-4681" /> <a name="IXT-28-4682" />(<a href="ch36_24.htm#upt3-CHP-36-SECT-24">Section 36.24</a>) the backquotes -- this is where the
ch28_14.htm:them: <b class="emphasis-bold">making unique filenames</b> (<a href="ch08_17.htm#upt3-CHP-8-SECT-17">Section 8.17</a>), <b class="emphasis-bold">removing some files
ch28_14.htm:from a list</b> (<a href="ch14_18.htm#upt3-CHP-14-SECT-18">Section 14.18</a>), <b class="emphasis-bold">setting your shell prompt</b> (<a href="ch04_06.htm#upt3-CHP-4-SECT-6">Section 4.6</a>, <a href="ch04_08.htm#upt3-CHP-4-SECT-8">Section 4.8</a>, <a href="ch04_14.htm#upt3-CHP-4-SECT-14">Section 4.14</a>), and <b class="emphasis-bold">setting
ch28_14.htm:variables</b> (<a href="ch04_08.htm#upt3-CHP-4-SECT-8">Section 4.8</a>, <a href="ch36_23.htm#upt3-CHP-36-SECT-23">Section 36.23</a>). 
ch28_15.htm:<p><tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch28_15.htm:(<a name="IXT-28-4689" /><a href="ch28_17.htm#upt3-CHP-28-SECT-17">Section 28.17</a>). If your system doesn't have
ch28_16.htm:they'll be grouped together in the <b class="emphasis-bold">history list</b> (<a href="ch30_07.htm#upt3-CHP-30-SECT-7">Section 30.7</a>).
ch28_16.htm:<p>I can repeat that same command later by using a <b class="emphasis-bold">history substitution</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>) like <tt class="literal">!ll</tt>.
ch28_16.htm:<p>It's useful with <b class="emphasis-bold">sleep</b> (<a name="IXT-28-4692" /><a href="ch25_09.htm#upt3-CHP-25-SECT-9">Section 25.9</a>) to run a command after a delay. The next
ch28_16.htm:your <b class="emphasis-bold">interrupt key</b> (<a href="ch24_10.htm#upt3-CHP-24-SECT-10">Section 24.10</a>) -- like CTRL-c -- will stop execution
ch28_16.htm:ndown</b> (<a href="ch24_22.htm#upt3-CHP-24-SECT-22">Section 24.22</a>) (which run
ch28_16.htm:has connected). So the shell runs <b class="emphasis-bold">ptbk</b> (<a href="ch38_09.htm#upt3-CHP-38-SECT-9">Section 38.9</a>) to make a
ch28_16.htm:into a <b class="emphasis-bold">subshell</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>) in the <b class="emphasis-bold">background</b> (<a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a>).)
ch28_16.htm:||</b> (<a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>), work like a semicolon,
ch28_17.htm:arguments. The shell's <b class="emphasis-bold">backquotes</b> (<a name="IXT-28-4702" /><a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) do the
ch28_17.htm:<p><tt class="literal">&lt;</tt> <a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a></p>
ch28_17.htm:files with <b class="emphasis-bold">pr</b> (<a href="ch45_06.htm#upt3-CHP-45-SECT-6">Section 45.6</a>) first, you could type:
ch28_17.htm:<p>In the next example, <b class="emphasis-bold">find</b> (<a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a>) gets a list of all files in the directory
ch28_17.htm:and run <b class="emphasis-bold">grep -l</b> (<a href="ch33_06.htm#upt3-CHP-33-SECT-6">Section 33.6</a>) to find which files contain the word
ch28_18.htm:interactive applications such as <b class="emphasis-bold">telnet</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) and
ch28_18.htm:Expect scripts work great as CGI scripts or from <b class="emphasis-bold">cron</b> (<a name="IXT-28-4739" /><a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>) or
ch29_01.htm:<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a> through <a href="ch29_10.htm#upt3-CHP-29-SECT-10">Section 29.10</a> cover C shell aliases. <a href="ch29_04.htm#upt3-CHP-29-SECT-4">Section 29.4</a> through <a href="ch29_14.htm#upt3-CHP-29-SECT-14">Section 29.14</a> cover
ch29_01.htm:<p>All except the oldest Bourne-type shells have <b class="emphasis-bold">shell functions</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>), which are explained in <a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a> through <a href="ch29_13.htm#upt3-CHP-29-SECT-13">Section 29.13</a>. These
ch29_02.htm:get very complicated. <a href="ch29_03.htm#upt3-CHP-29-SECT-3">Section 29.3</a> describes
ch29_02.htm:<a href="ch29_04.htm#upt3-CHP-29-SECT-4">Section 29.4</a> covers some of the differences
ch29_02.htm:function</b> (<a name="IXT-29-4362" /><a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>).
ch29_02.htm:file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>), so
ch29_02.htm:(<a name="IXT-29-4364" /><a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>), so putting
ch29_03.htm:at the end</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) this way:
ch29_03.htm:<p>Using <i class="command">cat</i> and a pipe that way is <b class="emphasis-bold">inefficient</b> (<a href="ch43_02.htm#upt3-CHP-43-SECT-2">Section 43.2</a>). It
ch29_03.htm:do we do this? The C shell's <b class="emphasis-bold">history</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>)
ch29_03.htm:<p>But why couldn't we just use <b class="emphasis-bold">single quotes or double quotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>)? This isn't the right place
ch29_03.htm:does</b> (<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>). If you want to be
ch29_03.htm:match the <b class="emphasis-bold">wildcard</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>) pattern <tt class="literal">!*</tt>. That fails
ch29_03.htm:Here's a sample alias. It uses <b class="emphasis-bold">cat</b> (<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>) to add a
ch29_03.htm:<p><tt class="literal">~</tt> <a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a></p>
ch29_04.htm:<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a> applies to the
ch29_04.htm:This article, along with <a href="ch29_05.htm#upt3-CHP-29-SECT-5">Section 29.5</a> and
ch29_04.htm:<a href="ch29_06.htm#upt3-CHP-29-SECT-6">Section 29.6</a>, have an overview of
ch29_04.htm:understand how <b class="emphasis-bold">quoting</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) works in aliases.
ch29_04.htm:operator</b> (<a name="IXT-29-4384" /><a href="ch29_03.htm#upt3-CHP-29-SECT-3">Section 29.3</a>) does. To
ch29_04.htm:(<a name="IXT-29-4385" /><a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>). 
ch29_05.htm:the regular command alias covered in <a href="ch29_04.htm#upt3-CHP-29-SECT-4">Section 29.4</a>. 
ch29_05.htm:aliases keep track of the locations of <b class="emphasis-bold">external</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>)
ch29_05.htm:-t</tt> shows. Next, I add a tracked alias for <b class="emphasis-bold">less</b> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) (which
ch29_06.htm:in <a href="ch29_04.htm#upt3-CHP-29-SECT-4">Section 29.4</a>. <i class="command">zsh</i> is
ch29_06.htm:isn't quoted). These are like a <b class="emphasis-bold">shell variable</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>)
ch29_07.htm:capability is <b class="emphasis-bold">shell scripts</b> (<a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>). Each has its strengths. An alias is just
ch29_07.htm:visible</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) to the parent shell
ch29_07.htm:command-line arguments into a variable and then <b class="emphasis-bold">source</b> (<a name="IXT-29-4412" /><a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>) a script to
ch29_07.htm:starting a <b class="emphasis-bold">subshell</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) for the script, it can do everything an alias
ch29_07.htm:functions</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>).
ch29_07.htm:the end of its name. I put all of the scripts in my <b class="emphasis-bold">~/bin</b> (<a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>). [Instead
ch29_07.htm:<p><tt class="literal">&lt;&lt;</tt> <a href="ch27_16.htm#upt3-CHP-27-SECT-16">Section 27.16</a></p>
ch29_07.htm:<p><tt class="literal">set</tt> <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a></p>
ch29_08.htm:<p><a href="ch27_09.htm#upt3-CHP-27-SECT-9">Section 27.9</a> has similar information for
ch29_08.htm:that came up on the Net a while ago. Someone wanted an <b class="emphasis-bold">exit</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) alias that
ch29_08.htm:would run a <b class="emphasis-bold">~/.exit file</b> (<a href="ch31_13.htm#upt3-CHP-31-SECT-13">Section 31.13</a>) before leaving the shell. The obvious
ch29_08.htm:<p><a href="ch27_10.htm#upt3-CHP-27-SECT-10">Section 27.10</a> has the hairy details of what
ch29_08.htm:Where <tt><em class="replaceable"><tt>name</tt></em></tt> is the name of a <b class="emphasis-bold">built-in</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>)
ch29_09.htm:(<a href="ch29_07.htm#upt3-CHP-29-SECT-7">Section 29.7</a>). Or that's what I
ch29_09.htm:<b class="emphasis-bold">eval</b> (<a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a>)
ch29_09.htm:(<a href="ch29_03.htm#upt3-CHP-29-SECT-3">Section 29.3</a>) and another during the first pass of
ch29_10.htm:type. The output of <i class="command">cat</i> is piped to the <b class="emphasis-bold">less</b> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) pager. For
ch29_11.htm:(<a name="IXT-29-4437" /><a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>).
ch29_11.htm:<p>Let's start with two aliases from <a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>, changed into shell functions:
ch29_11.htm:(<a name="IXT-29-4445" /><a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>) is
ch29_11.htm:then <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) to pull out the "ANSWER
ch29_11.htm:<p><tt class="literal">for</tt> <a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a></p>
ch29_11.htm:<p>The <i class="command">mx</i> function looks like a little <b class="emphasis-bold">shell program</b> (<a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>).
ch29_11.htm:script</b> (<a href="ch35_30.htm#upt3-CHP-35-SECT-30">Section 35.30</a>). But, as
ch29_11.htm:shell prompt. (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a> has details.)
ch29_11.htm:links</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) named for each
ch29_11.htm:<p><tt class="literal">if</tt> <a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>, <tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>, <tt class="literal">wc</tt> <a href="ch16_06.htm#upt3-CHP-16-SECT-6">Section 16.6</a></p>
ch29_11.htm:<b class="emphasis-bold">$1</b><a name="IXT-29-4459" />, the second in <b class="emphasis-bold">$2</b>, and so on (<a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>).
ch29_11.htm:(<a name="IXT-29-4461" /><a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>) to the
ch29_11.htm:-x</b> (<a href="ch27_15.htm#upt3-CHP-27-SECT-15">Section 27.15</a>) at a shell prompt. Then
ch29_11.htm:operator</b> (<a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>).)
ch29_11.htm:<p><tt class="literal">${..-..}</tt> <a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch29_11.htm:shells, and <a href="ch29_14.htm#upt3-CHP-29-SECT-14">Section 29.14</a> shows how to
ch29_12.htm:<p><a name="IXT-29-4472" /><a href="ch27_11.htm#upt3-CHP-27-SECT-11">Section 27.11</a> introduces shell functions for all Bourne-type
ch29_12.htm:system-wide <b class="emphasis-bold">setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) like <em class="filename">/etc/profile</em></tt>.
ch29_12.htm:<a href="ch27_09.htm#upt3-CHP-27-SECT-9">Section 27.9</a> explains, you can type
ch29_12.htm:If a function uses an environment variable -- like <b class="emphasis-bold">VISUAL or EDITOR</b> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>), your standard text editor -- you can set
ch29_12.htm:(<a name="IXT-29-4479" /><a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>): 
ch29_13.htm:files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>). Here are two other
ch29_13.htm:other <b class="emphasis-bold">bash subshells</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>). (The original Korn shell, but not the
ch29_13.htm:<p>How does this work? It stores the function in an <b class="emphasis-bold">environment variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) whose value starts with <tt class="literal">(
ch29_13.htm:env</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>). For example,
ch29_13.htm:(<a name="IXT-29-4487" /><a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>). So you can
ch29_13.htm:<b class="emphasis-bold">chmod +x foo</b> (<a href="ch35_01.htm#upt3-CHP-35-SECT-1">Section 35.1</a>)), and then the shell can find the function.
ch29_13.htm:command</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>) -- means the
ch29_13.htm:first uses <b class="emphasis-bold">set -xv</b> (<a href="ch37_01.htm#upt3-CHP-37-SECT-1">Section 37.1</a>) for debugging. <i class="command">func1</i> was a
ch29_13.htm:<p>First, without autoloading, I use <b class="emphasis-bold">type</b> (<a href="ch02_06.htm#upt3-CHP-2-SECT-6">Section 2.6</a>) to see if
ch29_13.htm:<p>Next I played with <i class="command">func2</i>. <b class="emphasis-bold">typeset -f</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>)
ch29_13.htm:<b class="emphasis-bold">cat</b> (<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>)
ch29_13.htm:file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>):
ch29_13.htm:<p><tt class="literal">IFS</tt> <a href="ch36_23.htm#upt3-CHP-36-SECT-23">Section 36.23</a>, <tt class="literal">for</tt> <a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a></p>
ch29_13.htm:<b class="emphasis-bold">setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) -- typically <em class="emphasis">.zshrc</em>:
ch29_14.htm:commands. If you have a Bourne shell with no <b class="emphasis-bold">functions</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>) or
ch29_14.htm:<b class="emphasis-bold">aliases</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) and haven't yet turned the
ch29_14.htm:the same things with shell variables and the <b class="emphasis-bold">eval</b> (<a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a>) command.
ch29_14.htm:<p><tt class="literal">test</tt> <a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a></p>
ch29_14.htm:<p><tt class="literal">set</tt> <a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a></p>
ch30_01.htm:<b class="emphasis-bold">history command</b> (<a href="ch30_07.htm#upt3-CHP-30-SECT-7">Section 30.7</a>) lists the saved commands, each with an
ch30_01.htm:the shells to print the history number of each command <b class="emphasis-bold">as part of your prompt</b> (<a href="ch04_03.htm#upt3-CHP-4-SECT-3">Section 4.3</a>).) 
ch30_01.htm:<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a> and <a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a> give quick tutorial summaries of some of the
ch30_01.htm:Bourne and C shells -- also have <a name="IXT-30-4203" /><a name="IXT-30-4204" /> <a name="IXT-30-4205" /><b class="emphasis-bold">interactive command-line editing</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>). Interactive editing might seem to be better
ch30_02.htm:($varname)</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) or <b class="emphasis-bold">command substitution ('command')</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>): the shell replaces what you type (like
ch30_02.htm:<p><a href="ch30_01.htm#upt3-CHP-30-SECT-1">Section 30.1</a> is an introduction to shell
ch30_02.htm:<p>We start with favorite uses from several contributors -- <a href="ch30_03.htm#upt3-CHP-30-SECT-3">Section 30.3</a>, <a href="ch30_04.htm#upt3-CHP-30-SECT-4">Section 30.4</a>, <a href="ch30_05.htm#upt3-CHP-30-SECT-5">Section 30.5</a>, and <a href="ch30_06.htm#upt3-CHP-30-SECT-6">Section 30.6</a>.
ch30_02.htm:<p><a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a> starts with a quick
ch30_02.htm:<p>(Back in <a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a> are examples of
ch30_02.htm:<i class="command">bash</i> commands in <a href="ch30_09.htm#upt3-CHP-30-SECT-9">Section 30.9</a>. 
ch30_02.htm:history to another shell, see <a href="ch30_12.htm#upt3-CHP-30-SECT-12">Section 30.12</a>
ch30_02.htm:and <a href="ch30_13.htm#upt3-CHP-30-SECT-13">Section 30.13</a>.
ch30_02.htm:(<tt class="literal">!</tt>) for history. <a href="ch30_15.htm#upt3-CHP-30-SECT-15">Section 30.15</a> shows how to use some other character.
ch30_02.htm:<p>The Korn shell does history in a different way. <a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a> introduces part of that: command-line editing
ch30_02.htm:your prompt</b> (<a name="IXT-30-4207" /><a name="IXT-30-4208" /><a href="ch04_03.htm#upt3-CHP-4-SECT-3">Section 4.3</a>) makes it easy
ch30_03.htm:<p><a name="IXT-30-4211" />I get a lot of <b class="emphasis-bold">tar archives</b> (<a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>).
ch30_04.htm:<p><a name="IXT-30-4213" /> <a name="IXT-30-4214" />I use <b class="emphasis-bold">!$</b> (<a href="ch30_03.htm#upt3-CHP-30-SECT-3">Section 30.3</a>) a lot, but
ch30_04.htm:example, to use <b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>) and make an edit to article files named <a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a> and <a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a> for this
ch30_04.htm:more of these in <a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>.
ch30_05.htm:(<a name="IXT-30-4216" /><a href="ch30_11.htm#upt3-CHP-30-SECT-11">Section 30.11</a>) to recall an earlier command so I can change
ch30_06.htm:<p>(<b class="emphasis-bold">ls -d a*</b> (<a href="ch08_05.htm#upt3-CHP-8-SECT-5">Section 8.5</a>) will make less output if any subdirectory
ch30_07.htm:editing</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>) when
ch30_07.htm:use <b class="emphasis-bold">!20:$</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>) to pass that filename as an argument to
ch30_07.htm:<p><tt class="literal">less</tt> <a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>, <tt class="literal">\!*</tt> <a href="ch29_03.htm#upt3-CHP-29-SECT-3">Section 29.3</a></p>
ch30_07.htm:prompt</b> (<a name="IXT-30-4226" /><a name="IXT-30-4227" /><a href="ch04_03.htm#upt3-CHP-4-SECT-3">Section 4.3</a>). Then you can
ch30_08.htm:(<tt class="literal">!</tt>) is the <b class="emphasis-bold">default</b> (<a href="ch30_15.htm#upt3-CHP-30-SECT-15">Section 30.15</a>) history
ch30_08.htm:arguments from the command line in aliases</b> (<a href="ch29_03.htm#upt3-CHP-29-SECT-3">Section 29.3</a>): 
ch30_08.htm:you want to add a <b class="emphasis-bold">modifier</b> (<a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a>) like the following:
ch30_08.htm:(<a href="ch04_03.htm#upt3-CHP-4-SECT-3">Section 4.3</a>).
ch30_08.htm:<p>Note that as an <b class="emphasis-bold">operator</b> (<a href="ch28_05.htm#upt3-CHP-28-SECT-5">Section 28.5</a>,),
ch30_08.htm:<b class="emphasis-bold">regular expressions</b> (<a href="ch32_05.htm#upt3-CHP-32-SECT-5">Section 32.5</a>), <tt class="literal">!^</tt> gives the beginning
ch30_08.htm:-v</b> (<a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>) command through
ch30_08.htm:the alias is used -- see <a href="ch29_03.htm#upt3-CHP-29-SECT-3">Section 29.3</a> for
ch30_08.htm:<p><tt class="literal">^xy^yx</tt><a name="IXT-30-4248" /> <a name="IXT-30-4249" /> is the <b class="emphasis-bold">shorthand substitution</b> (<a href="ch30_03.htm#upt3-CHP-30-SECT-3">Section 30.3</a>, <a href="ch30_05.htm#upt3-CHP-30-SECT-5">Section 30.5</a>) command. In
ch30_08.htm:<p>The search part, or left side, cannot include <b class="emphasis-bold">metacharacters</b> (<a href="ch32_03.htm#upt3-CHP-32-SECT-3">Section 32.3</a>).
ch30_10.htm:aliases on the C shell command line. (I could have used <b class="emphasis-bold">shell functions</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>)
ch30_10.htm:<b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>)
ch30_10.htm:<p>The <i class="command">h</i> alias stores the filename in a <b class="emphasis-bold">shell variable</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>).
ch30_10.htm:ampersands) (<a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>) means that the following
ch30_10.htm:(semicolon) (<a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a>) instead of
ch30_12.htm:variable</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) to the number of
ch30_12.htm:(<a href="ch23_12.htm#upt3-CHP-23-SECT-12">Section 23.12</a>) logged on as the same user will have
ch30_12.htm:<i class="command">ksh</i> shell: customize your <b class="emphasis-bold">setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) to
ch30_12.htm:tips in <a href="ch03_18.htm#upt3-CHP-3-SECT-18">Section 3.18</a> and a series starting at
ch30_12.htm:<a href="ch03_10.htm#upt3-CHP-3-SECT-10">Section 3.10</a>.)
ch30_12.htm:<p>The simplest fix is to use<b class="emphasis-bold"> $$</b> (<a href="ch27_17.htm#upt3-CHP-27-SECT-17">Section 27.17</a>) -- which will probably expand differently
ch30_12.htm:may be <b class="emphasis-bold">world-readable</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>) if your umask isn't set to
ch30_12.htm:<i class="command">history -r</i>. <a href="ch30_13.htm#upt3-CHP-30-SECT-13">Section 30.13</a>
ch30_12.htm:a <b class="emphasis-bold">login shell</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>),<a href="#FOOTNOTE-95">[95]</a> you can run <i class="command">history -h</i> from your
ch30_12.htm:</p><blockquote class="footnote"> <a name="FOOTNOTE-95" /><p> [95]<b class="emphasis-bold">xterm -ls</b><a href="ch05_10.htm#upt3-CHP-5-SECT-10">Section 5.10</a> runs a
ch30_12.htm:the shell with an <b class="emphasis-bold">exit</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) command.
ch30_12.htm:<p>Set an <b class="emphasis-bold">alias for exit</b> (<a href="ch29_08.htm#upt3-CHP-29-SECT-8">Section 29.8</a>) that runs <i class="command">history -h</i>
ch30_12.htm:script</b> (<a href="ch30_13.htm#upt3-CHP-30-SECT-13">Section 30.13</a>) that saves and
ch30_13.htm:a history of the commands you type</b> (<a href="ch30_12.htm#upt3-CHP-30-SECT-12">Section 30.12</a>). You can add your own commands to some
ch30_13.htm:another shell</b> (<a href="ch30_12.htm#upt3-CHP-30-SECT-12">Section 30.12</a>).
ch30_13.htm:<p>Of course, you can also use <i class="command">bash</i> <b class="emphasis-bold">interactive command-line editing</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>) on the saved commands.
ch30_14.htm:them you had to retype them.) The C shell added <b class="emphasis-bold">history substitution operators</b> (<a href="ch30_02.htm#upt3-CHP-30-SECT-2">Section 30.2</a>) that were great on teletypes -- and are
ch30_14.htm:partially-typed filenames</b> (<a href="ch28_06.htm#upt3-CHP-28-SECT-6">Section 28.6</a>),
ch30_14.htm:the usual <b class="emphasis-bold">map</b> (<a href="ch18_02.htm#upt3-CHP-18-SECT-2">Section 18.2</a>) command; instead, the
ch30_14.htm:variety of different editor settings</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14.5">Section 30.14.5</a>), to set up the editing mode. To make this the
ch30_14.htm:default, store the command in your shell's <b class="emphasis-bold">setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) (in
ch30_14.htm:<p><a name="IXT-30-4297" /> <a name="IXT-30-4298" /> <a name="IXT-30-4299" /> <a name="IXT-30-4300" />If you know the <b class="emphasis-bold">Emacs</b> (<a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>) editor,
ch30_14.htm:can't run <b class="emphasis-bold">psychoanalyze-pinhead</b> (<a href="ch19_13.htm#upt3-CHP-19-SECT-13">Section 19.13</a>) <tt class="literal">:-)</tt>) -- the emacs-mode
ch30_14.htm:(<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) (in <i class="command">bash</i>, you can
ch30_14.htm:pager such as <b class="emphasis-bold">less</b> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) that lets you page through and do searches.
ch30_14.htm:and <i class="command">bindkey -l</i> into one list with <b class="emphasis-bold">perl</b> (<a href="ch41_01.htm#upt3-CHP-41-SECT-1">Section 41.1</a>) or
ch30_14.htm:<b class="emphasis-bold">awk</b> (<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>)
ch30_14.htm:(<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>) special characters. And the special
ch30_14.htm:<b class="emphasis-bold">history substitutions</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>) in the command line, then lets you continue
ch30_14.htm:remember to <b class="emphasis-bold">quote</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) any special characters. So, if you want to
ch30_14.htm:make CTRL-r be the traditional Unix <b class="emphasis-bold">rprnt</b> (<a href="ch28_02.htm#upt3-CHP-28-SECT-2">Section 28.2</a>) operation
ch30_14.htm:have to put <b class="emphasis-bold">quotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) around the whole binding -- so watch out
ch30_14.htm:for quoting conflicts. For example, to make CTRL-o output a <b class="emphasis-bold">redirection</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>)
ch30_14.htm:<p><tt class="literal">less</tt> <a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a></p>
ch30_15.htm:character</b> (<a href="ch30_05.htm#upt3-CHP-30-SECT-5">Section 30.5</a>)). For example:
ch30_15.htm:character</b> (<a href="ch35_01.htm#upt3-CHP-35-SECT-1">Section 35.1</a>) only in
ch30_16.htm:(<a name="IXT-30-4334" /><a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) command), you can type a backslash
ch30_16.htm:<p>By the way, if you have a window system, you can probably <b class="emphasis-bold">copy and paste the command line</b> (<a href="ch28_10.htm#upt3-CHP-28-SECT-10">Section 28.10</a>) instead of using <a name="IXTR3-4353" /> <a name="IXTR3-4354" />shell history.
ch31_01.htm:<p>Using relative and absolute pathnames: <a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>. 
ch31_01.htm:<p>What good is a current directory? <a href="ch31_03.htm#upt3-CHP-31-SECT-3">Section 31.3</a>. 
ch31_01.htm:<em class="emphasis">cdpath</em>: <a href="ch31_05.htm#upt3-CHP-31-SECT-5">Section 31.5</a>.
ch31_01.htm:using and let you get to them quickly: <a href="ch31_07.htm#upt3-CHP-31-SECT-7">Section 31.7</a>, <a href="ch31_08.htm#upt3-CHP-31-SECT-8">Section 31.8</a>.
ch31_01.htm:<p>Quick <i class="command">cd</i> aliases: <a href="ch31_09.htm#upt3-CHP-31-SECT-9">Section 31.9</a>. 
ch31_01.htm:directories and files: <a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a>.
ch31_01.htm:<i class="command">cd</i>'ing back: <a href="ch31_12.htm#upt3-CHP-31-SECT-12">Section 31.12</a>. 
ch31_01.htm:<p>Automatic setup for entering and exiting a directory: <a href="ch31_13.htm#upt3-CHP-31-SECT-13">Section 31.13</a>. 
ch31_02.htm:(<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>).
ch31_02.htm:<p>The <b class="emphasis-bold">symbolic link</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) adds a twist to pathnames. What two absolute
ch31_03.htm:<p>When you use a <b class="emphasis-bold">subshell</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>, <a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) or a shell
ch31_03.htm:(<a name="IXT-31-4094" /><a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>). Without a current directory and relative
ch31_03.htm:pathnames, you'd always have to use <b class="emphasis-bold">absolute pathnames</b> (<a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>) like
ch31_04.htm:<b class="emphasis-bold">external</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>) command that isn't built
ch31_04.htm:(<a href="ch10_02.htm#upt3-CHP-10-SECT-2">Section 10.2</a>).
ch31_04.htm:book. Also see the last few paragraphs of <a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a> for more about the links between directories.
ch31_05.htm:<p><a name="IXT-31-4101" /><a name="IXT-31-4102" /><a name="IXT-31-4103" /><a name="IXT-31-4104" />Some people make a shell <b class="emphasis-bold">alias</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) for
ch31_05.htm:<b class="emphasis-bold">shell variables</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) to hold the pathnames of directories they
ch31_05.htm:startup files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) each time you
ch31_05.htm:directories</b><a name="IXT-31-4109" /> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>). This
ch31_05.htm:<p><tt class="literal">~</tt> <a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a></p>
ch31_05.htm:<em class="emphasis">PATH</em> variable, is actually <b class="emphasis-bold">an empty entry</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>)
ch31_06.htm:<p><a name="IXT-31-4113" /><a name="IXT-31-4114" /><a name="IXT-31-4115" /><a name="IXT-31-4116" /> <a name="IXT-31-4117" /> <a name="IXT-31-4118" /> <a name="IXT-31-4119" />Normally a <b class="emphasis-bold">for loop</b> (<a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>) iterates
ch31_06.htm:until it has processed all its word arguments. <b class="emphasis-bold">while and until loops</b> (<a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>) iterate until the loop control command
ch31_06.htm:<p><tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>, <tt class="literal">||</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>, <tt class="literal">*</tt> <a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>, <tt class="literal">test</tt> <a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a></p>
ch31_07.htm:(<a href="ch31_05.htm#upt3-CHP-31-SECT-5">Section 31.5</a>) that includes your home directory,
ch31_07.htm:prompt</b> (<a href="ch04_14.htm#upt3-CHP-4-SECT-14">Section 4.14</a>), but I personally
ch31_08.htm:<p><a name="IXT-31-4134" /><a name="IXT-31-4135" />The <b class="emphasis-bold">pushd command</b> (<a href="ch31_07.htm#upt3-CHP-31-SECT-7">Section 31.7</a>)
ch31_08.htm:(<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) in Daniel Gilly's
ch31_09.htm:make <b class="emphasis-bold">aliases</b> (<a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a>) that take you to each directory quickly. For
ch31_09.htm:<b class="emphasis-bold">shell function</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>). A <b class="emphasis-bold">shell
ch31_09.htm:script</b> (<a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>)
ch31_09.htm:won't work, though, because it runs in a <b class="emphasis-bold">subshell</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>).)
ch31_09.htm:<a href="ch35_27.htm#upt3-CHP-35-SECT-27">Section 35.27</a> shows how to pick a new name.
ch31_09.htm:<b class="emphasis-bold">shell setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>), like this C shell example for your
ch31_09.htm:<p><tt class="literal">source</tt> <a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>, <tt class="literal">~</tt> <a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a></p>
ch31_10.htm:shells that don't have <b class="emphasis-bold">filename completion</b> (<a href="ch28_06.htm#upt3-CHP-28-SECT-6">Section 28.6</a>). This function works a bit like filename
ch31_10.htm:<p><tt class="literal">set</tt> <a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>, <tt class="literal">$#</tt> <a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a></p>
ch31_11.htm:GNU <b class="emphasis-bold">Emacs</b> (<a href="ch19_04.htm#upt3-CHP-19-SECT-4">Section 19.4</a>) editor and <i class="command">vi</i>, may create
ch31_11.htm:is. It's a directory full of <b class="emphasis-bold">symbolic links</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>)
ch31_11.htm:<p>In fact, using <b class="emphasis-bold">echo</b> (<a href="ch27_05.htm#upt3-CHP-27-SECT-5">Section 27.5</a>) yourself is a good way to see how
ch31_12.htm:does not exist, <i class="command">csh</i> tries searching its <b class="emphasis-bold">cdpath</b> (<a href="ch31_05.htm#upt3-CHP-31-SECT-5">Section 31.5</a>), then
ch31_12.htm:(<a href="ch31_07.htm#upt3-CHP-31-SECT-7">Section 31.7</a>) to store directory names;
ch31_12.htm:your <b class="emphasis-bold">shell setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>), use <tt class="literal">cdable_vars=1</tt> for
ch31_13.htm:<em class="filename">.exit</em> file is <b class="emphasis-bold">sourced</b> (<a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>) into
ch31_13.htm:(<a href="ch31_07.htm#upt3-CHP-31-SECT-7">Section 31.7</a>), you'll probably want
ch31_13.htm:<p><tt class="literal">setprompt</tt> <a href="ch04_07.htm#upt3-CHP-4-SECT-7">Section 4.7</a></p>
ch31_13.htm:links</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) between the files. If
ch31_13.htm:have to use a <b class="emphasis-bold">symbolic link</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) -- though that probably
ch31_13.htm:<p><tt class="literal">source</tt> <a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a></p>
ch32_01.htm:in <a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>. We did this because regular
ch32_01.htm:(<a href="ch32_16.htm#upt3-CHP-32-SECT-16">Section 32.16</a> and <a href="ch32_18.htm#upt3-CHP-32-SECT-18">Section 32.18</a>) and a few tools that help you see what your
ch32_01.htm:expressions are matching (<a href="ch32_17.htm#upt3-CHP-32-SECT-17">Section 32.17</a>).
ch32_01.htm:There's also a quick reference (<a href="ch32_21.htm#upt3-CHP-32-SECT-21">Section 32.21</a>) for those of you who just need a refresher.
ch32_02.htm:the special characters in a regular expression must be <b class="emphasis-bold">quoted</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) when
ch32_03.htm:(<a name="IXT-32-3937" /><a href="ch13_02.htm#upt3-CHP-13-SECT-2">Section 13.2</a>) that accept regular expressions must first
ch32_03.htm:is matched and what is not. In <a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>
ch32_04.htm:explains the incompatibility at the end of <a href="ch32_15.htm#upt3-CHP-32-SECT-15">Section 32.15</a>.  -- <em class="emphasis">TOR</em></tt>]
ch32_04.htm:(<a href="ch32_05.htm#upt3-CHP-32-SECT-5">Section 32.5</a>)
ch32_04.htm:<p>Matching a character with a character set (<a href="ch32_06.htm#upt3-CHP-32-SECT-6">Section 32.6</a>) 
ch32_04.htm:<p>Match any character with . (dot) (<a href="ch32_07.htm#upt3-CHP-32-SECT-7">Section 32.7</a>) 
ch32_04.htm:(<a href="ch32_08.htm#upt3-CHP-32-SECT-8">Section 32.8</a>)
ch32_04.htm:<p>Exceptions in a character set (<a href="ch32_09.htm#upt3-CHP-32-SECT-9">Section 32.9</a>)</p>
ch32_04.htm:<p>Repeating character sets with <tt class="literal">*</tt> (<a href="ch32_10.htm#upt3-CHP-32-SECT-10">Section 32.10</a>) 
ch32_04.htm:<tt class="literal">\}</tt> (<a href="ch32_11.htm#upt3-CHP-32-SECT-11">Section 32.11</a>)
ch32_04.htm:<tt class="literal">\&gt;</tt> (<a href="ch32_12.htm#upt3-CHP-32-SECT-12">Section 32.12</a>)
ch32_04.htm:<tt class="literal">\)</tt>, and <tt class="literal">\1</tt> (<a href="ch32_13.htm#upt3-CHP-32-SECT-13">Section 32.13</a>) 
ch32_04.htm:<p>Potential problems (<a href="ch32_14.htm#upt3-CHP-32-SECT-14">Section 32.14</a>)</p>
ch32_04.htm:<p>Extended regular expressions (<a href="ch32_15.htm#upt3-CHP-32-SECT-15">Section 32.15</a>)</p>
ch32_05.htm:(<a href="ch13_09.htm#upt3-CHP-13-SECT-9">Section 13.9</a>, <a href="ch11_10.htm#upt3-CHP-11-SECT-10">Section 11.10</a>). -- <em class="emphasis">JP</em>] You see, the
ch32_05.htm:the last argument on the previous line (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a> explains).
ch32_05.htm:<i class="command">ed</i> and <i class="command">sed</i>. <b class="emphasis-bold">cat -v -e</b> (<a name="IXT-32-3975" /><a href="ch12_05.htm#upt3-CHP-12-SECT-5">Section 12.5</a>, <a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>) marks ends of lines with a
ch32_06.htm:the lines of a <b class="emphasis-bold">mail message</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) that identify the sender. Use this pattern
ch32_06.htm:<p><tt class="literal">$USER</tt> <a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a></p>
ch32_10.htm:useless</b> (<a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>), as it matches any
ch32_11.htm:<b class="emphasis-bold">some programs</b> (<a href="ch32_20.htm#upt3-CHP-32-SECT-20">Section 32.20</a>) recognize a special pattern you can use to
ch32_13.htm:on the replacement side (<a href="ch34_11.htm#upt3-CHP-34-SECT-11">Section 34.11</a>).
ch32_14.htm:that <b class="emphasis-bold">extended expressions</b> (<a href="ch32_15.htm#upt3-CHP-32-SECT-15">Section 32.15</a>) offer, I want to mention two potential
ch32_14.htm:<p>The other potential point of confusion is the <b class="emphasis-bold">extent of the pattern matches</b> (<a href="ch32_17.htm#upt3-CHP-32-SECT-17">Section 32.17</a>). Regular expressions match the longest
ch32_15.htm:<b class="emphasis-bold">GNU Emacs</b> (<a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>) does, by the way -- it combines all of the
ch32_16.htm:an <b class="emphasis-bold">expression</b> (<a href="ch32_01.htm#upt3-CHP-32-SECT-1">Section 32.1</a>) by looking up each word in the dictionary.
ch32_19.htm:(<a href="ch32_20.htm#upt3-CHP-32-SECT-20">Section 32.20</a> lists the metacharacters that
ch32_20.htm:descriptions of each of the characters can be found in <a href="ch32_21.htm#upt3-CHP-32-SECT-21">Section 32.21</a>. 
ch32_21.htm:<p><a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a> <a name="upt3-IDXTERM-5082" />
ch33_01.htm:<a name="upt3-IDXTERM-5107" /> <a name="upt3-IDXTERM-5108" />(<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>)
ch33_01.htm:in many situations. If not, they are summarized in <a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>. Here are a few of my favorite wildcard
ch33_01.htm:than <b class="emphasis-bold">find</b> (<a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a>). 
ch33_01.htm:problems</b> (<a href="ch33_05.htm#upt3-CHP-33-SECT-5">Section 33.5</a>).)
ch33_02.htm:<b class="emphasis-bold">(</b><a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a>)
ch33_02.htm:<i class="command">shopt</i>. (For other shells, see <b class="emphasis-bold">nom</b> (<a href="ch33_08.htm#upt3-CHP-33-SECT-8">Section 33.8</a>).)
ch33_02.htm:<tt class="literal">^ab[c]</tt>. (For other shells, see <b class="emphasis-bold">nom</b> (<a href="ch33_08.htm#upt3-CHP-33-SECT-8">Section 33.8</a>).)
ch33_02.htm:<b class="emphasis-bold">regular expresssion</b> (<a href="ch32_02.htm#upt3-CHP-32-SECT-2">Section 32.2</a>) x*). The pattern can have parentheses
ch33_02.htm:expresssion</b> (<a href="ch32_15.htm#upt3-CHP-32-SECT-15">Section 32.15</a>) x+). The
ch33_02.htm:(<a name="IXT-33-3853" /> <a name="IXT-33-3854" /><a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>,
ch33_02.htm:<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>), of course. In the C shells, you can
ch33_03.htm:<p><b class="emphasis-bold">Wildcards</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>) <a name="upt3-IDXTERM-5149" /> <a name="upt3-IDXTERM-5150" /> <a name="upt3-IDXTERM-5151" />are
ch33_03.htm:variants</b> (<a href="ch01_06.htm#upt3-CHP-1-SECT-6">Section 1.6</a>)) honor the same
ch33_03.htm:anyone change the rules. (But most new shells also have <b class="emphasis-bold">extended wildcards</b> (<a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>). And different shells do different things
ch33_03.htm:match</b> (<a href="ch33_04.htm#upt3-CHP-33-SECT-4">Section 33.4</a>).)
ch33_03.htm:files from a tape, which requires the command <b class="emphasis-bold">tar x</b> (<a href="ch38_06.htm#upt3-CHP-38-SECT-6">Section 38.6</a>), so you
ch33_03.htm:of the files you want are already in your <b class="emphasis-bold">current directory</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>). The shell expands the wildcard
ch33_03.htm:shell. Simply put <tt class="literal">*.txt</tt> in <b class="emphasis-bold">quotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>).
ch33_03.htm:and scp</b> (<a href="ch46_06.htm#upt3-CHP-46-SECT-6">Section 46.6</a>)) know how to handle
ch33_03.htm:<b class="emphasis-bold">{} characters</b> (<a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a>), you can use them because they can generate
ch33_03.htm:workaround</b> (<a href="ch38_10.htm#upt3-CHP-38-SECT-10">Section 38.10</a>).<a name="IXTR3-3900" /> <a name="IXTR3-3901" /> <a name="IXTR3-3902" />
ch33_04.htm:probably by using <b class="emphasis-bold">!!</b> (<a href="ch30_08.htm#upt3-CHP-30-SECT-8">Section 30.8</a>) when I knew there weren't
ch33_04.htm:<b class="emphasis-bold">echo</b> (<a href="ch27_05.htm#upt3-CHP-27-SECT-5">Section 27.5</a>),
ch33_05.htm:parentheses)</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>) if you want
ch33_05.htm:<p><tt class="literal">&amp;&amp;</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a></p>
ch33_05.htm:(<a href="ch28_17.htm#upt3-CHP-28-SECT-17">Section 28.17</a>) command.)
ch33_06.htm:<a name="IXT-33-3884" /><a name="IXT-33-3885" /> <a name="IXT-33-3886" />when you run <b class="emphasis-bold">grep</b> (<a href="ch13_01.htm#upt3-CHP-13-SECT-1">Section 13.1</a>) on a group
ch33_06.htm:<p><tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch33_07.htm:(<a name="IXT-33-3887" /><a name="IXT-33-3888" /><a href="ch13_02.htm#upt3-CHP-13-SECT-2">Section 13.2</a>) option <span class="option">-c</span> to tell you how
ch33_07.htm:uppercase, you'll also want the<b class="emphasis-bold"> -i option</b> (<a href="ch09_22.htm#upt3-CHP-9-SECT-22">Section 9.22</a>).)
ch33_07.htm:<p>Using <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) to truncate the <tt class="literal">:0</tt>, you
ch33_07.htm:a <b class="emphasis-bold">$ anchor</b> (<a href="ch32_05.htm#upt3-CHP-32-SECT-5">Section 32.5</a>) to be sure <i class="command">sed</i> matches
ch33_07.htm:(<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) the <tt class="literal">$</tt> for
ch33_07.htm:pathname</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>) puts the
ch33_07.htm:<p><tt class="literal">"$@"</tt> <a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a></p>
ch33_08.htm:<em class="emphasis">don't</em> match. As <a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a> shows, some shells have an
ch33_08.htm:substitution</b> (<a href="ch27_14.htm#upt3-CHP-27-SECT-14">Section 27.14</a>):
ch33_08.htm:<p><tt class="literal">trap</tt> <a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>, <tt class="literal">case</tt> <a href="ch35_11.htm#upt3-CHP-35-SECT-11">Section 35.11</a>, <tt class="literal">$*</tt> <a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>, <tt class="literal">comm</tt> <a href="ch11_08.htm#upt3-CHP-11-SECT-8">Section 11.8</a></p>
ch33_08.htm:<p>The<b class="emphasis-bold"> -d option</b> (<a href="ch08_05.htm#upt3-CHP-8-SECT-5">Section 8.5</a>) tells <i class="command">ls</i> to list the names
ch33_08.htm:of any directories, not their contents. The <b class="emphasis-bold">${1+"$@"}</b> (<a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a>) works
ch34_01.htm:through a pipe (like all well-behaved Unix <b class="emphasis-bold">filters</b> (<a href="ch01_05.htm#upt3-CHP-1-SECT-5">Section 1.5</a>) do).
ch34_01.htm:<p>In this chapter, we start out with the basics: <a href="ch34_02.htm#upt3-CHP-34-SECT-2">Section 34.2</a>, <a href="ch34_03.htm#upt3-CHP-34-SECT-3">Section 34.3</a>, <a href="ch34_04.htm#upt3-CHP-34-SECT-4">Section 34.4</a>, <a href="ch34_05.htm#upt3-CHP-34-SECT-5">Section 34.5</a>, <a href="ch34_06.htm#upt3-CHP-34-SECT-6">Section 34.6</a>, and <a href="ch34_07.htm#upt3-CHP-34-SECT-7">Section 34.7</a> show you how
ch34_01.htm:advanced scripts. <a href="ch34_08.htm#upt3-CHP-34-SECT-8">Section 34.8</a> through <a href="ch34_14.htm#upt3-CHP-34-SECT-14">Section 34.14</a> cover regular expressions and complex
ch34_01.htm:transformations. <a href="ch34_15.htm#upt3-CHP-34-SECT-15">Section 34.15</a> through <a href="ch34_24.htm#upt3-CHP-34-SECT-24">Section 34.24</a> deal with advanced topics such as multiline
ch34_02.htm:(<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>) or a file, transform it, and pass it
ch34_02.htm:to <b class="emphasis-bold">standard output</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>). If you want to edit a file, you have to
ch34_02.htm:write a <b class="emphasis-bold">shell wrapper</b> (<a href="ch34_04.htm#upt3-CHP-34-SECT-4">Section 34.4</a>) to capture standard output and write it back
ch34_03.htm:were using <i class="command">sed</i> on the fly, as a <b class="emphasis-bold">stream editor</b> (<a href="ch34_02.htm#upt3-CHP-34-SECT-2">Section 34.2</a>),
ch34_03.htm:scripts</b> (<a href="ch01_08.htm#upt3-CHP-1-SECT-8">Section 1.8</a>)) you can use the
ch34_04.htm:script</b> (<a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>) that invokes
ch34_04.htm:loop</b> (<a name="IXT-34-704" /><a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>) to apply the
ch34_04.htm:(<a name="IXT-34-713" /><a href="ch08_02.htm#upt3-CHP-8-SECT-2">Section 8.2</a>)
ch34_04.htm:metacharacters</b> (<a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>) can be used
ch34_05.htm:expression</b> (<a name="IXT-34-714" /><a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>) that describes a pattern.
ch34_06.htm:(<a href="ch34_16.htm#upt3-CHP-34-SECT-16">Section 34.16</a>) reads another line into the pattern
ch34_06.htm:<a href="ch34_14.htm#upt3-CHP-34-SECT-14">Section 34.14</a> and other articles after it.
ch34_09.htm:<p><tt class="literal">2</tt> <a href="ch34_12.htm#upt3-CHP-34-SECT-12">Section 34.12</a></p>
ch34_11.htm:of use. (<a href="ch32_13.htm#upt3-CHP-32-SECT-13">Section 32.13</a> has more information.)
ch34_11.htm:test document, using <b class="emphasis-bold">checksed</b> (<a href="ch34_04.htm#upt3-CHP-34-SECT-4">Section 34.4</a>): 
ch34_11.htm:<p><a href="ch43_10.htm#upt3-CHP-43-SECT-10">Section 43.10</a>, <a href="ch31_10.htm#upt3-CHP-31-SECT-10">Section 31.10</a>,
ch34_11.htm:<a href="ch10_09.htm#upt3-CHP-10-SECT-9">Section 10.9</a>, and <a href="ch36_23.htm#upt3-CHP-36-SECT-23">Section 36.23</a> have
ch34_13.htm:function to <b class="emphasis-bold">tr</b> (<a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a>). It replaces any character found in the first
ch34_13.htm:(<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) from being read except by someone who
ch34_14.htm:<p>For other scripts that use the hold space, see <a href="ch34_18.htm#upt3-CHP-34-SECT-18">Section 34.18</a>. For a fanciful analogy that makes clear how
ch34_14.htm:it <a name="IXTR3-817" />works, see <a href="ch34_17.htm#upt3-CHP-34-SECT-17">Section 34.17</a>.<a name="IXTR3-818" /> <a name="IXTR3-819" />
ch34_15.htm:command, y</b> (<a href="ch34_13.htm#upt3-CHP-34-SECT-13">Section 34.13</a>), acts on the
ch34_16.htm:<p><a name="upt3-IDXTERM-5287" /> <a name="upt3-IDXTERM-5288" />Most programs that use <b class="emphasis-bold">regular expressions</b> (<a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>) are able to match a pattern only on a single
ch34_16.htm:<p>or use the <b class="emphasis-bold">\(..\) operators</b> (<a href="ch34_11.htm#upt3-CHP-34-SECT-11">Section 34.11</a>) to keep the newline:
ch34_17.htm:<p><a href="ch34_18.htm#upt3-CHP-34-SECT-18">Section 34.18</a> shows a practical application of
ch34_18.htm:<p><a name="upt3-IDXTERM-5321" /> <a name="upt3-IDXTERM-5322" /> <a name="upt3-IDXTERM-5323" />[<a href="ch13_09.htm#upt3-CHP-13-SECT-9">Section 13.9</a> introduced a script called
ch34_18.htm:advanced applications of this obscure yet wonderful editor. <a href="ch34_14.htm#upt3-CHP-34-SECT-14">Section 34.14</a> through <a href="ch34_17.htm#upt3-CHP-34-SECT-17">Section 34.17</a>
ch34_18.htm:<p>Let's review the two examples from <a href="ch13_09.htm#upt3-CHP-13-SECT-9">Section 13.9</a>. The first command below finds all lines
ch34_18.htm:<p><tt class="literal">case</tt> <a href="ch35_11.htm#upt3-CHP-35-SECT-11">Section 35.11</a>, <tt class="literal">expr</tt> <a href="ch36_21.htm#upt3-CHP-36-SECT-21">Section 36.21</a>, <tt class="literal">shift</tt> <a href="ch35_22.htm#upt3-CHP-35-SECT-22">Section 35.22</a>, <tt class="literal">${?}</tt> <a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a>, <tt class="literal">\~..~</tt> <a href="ch34_08.htm#upt3-CHP-34-SECT-8">Section 34.8</a>, <tt class="literal">"$@"</tt> <a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a></p>
ch34_18.htm:(<a name="IXT-34-789" /><a href="ch35_19.htm#upt3-CHP-35-SECT-19">Section 35.19</a>) to
ch34_18.htm:enclosed in <b class="emphasis-bold">double quotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>). We use the <span class="option">-n</span> option
ch34_19.htm:<em class="emphasis">d</em>, deletes the contents of the <b class="emphasis-bold">pattern space</b> (<a name="IXT-34-794" /><a href="ch34_14.htm#upt3-CHP-34-SECT-14">Section 34.14</a>) and
ch34_21.htm:<p>First, <b class="emphasis-bold">h</b> (<a href="ch34_14.htm#upt3-CHP-34-SECT-14">Section 34.14</a>) holds a copy of the current input line. Then,
ch34_21.htm:<b class="emphasis-bold">g</b> (<a href="ch34_14.htm#upt3-CHP-34-SECT-14">Section 34.14</a>)
ch34_22.htm:<p><img src="figs/bomb.gif" alt="Figure " width="24" /> <a href="ch34_23.htm#upt3-CHP-34-SECT-23">Section 34.23</a></p>
ch34_22.htm:<p><tt class="literal">-n</tt> <a href="ch34_03.htm#upt3-CHP-34-SECT-3">Section 34.3</a></p>
ch34_23.htm:<p>The <i class="command">sed</i> quit command, <b class="emphasis-bold">q</b> (<a href="ch34_22.htm#upt3-CHP-34-SECT-22">Section 34.22</a>), is very
ch34_24.htm:<p><a name="IXT-34-811" /><a name="IXT-34-812" />Feeding <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>)
ch34_24.htm:(<a name="IXT-34-815" /><a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>).
ch34_24.htm:such as <i class="command">bash</i>, which do what I consider <b class="emphasis-bold">the proper thing</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) with this input. The C shell, however, thinks
ch34_24.htm:trailing backslashes</b> (<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>), and
ch34_24.htm:commands <b class="emphasis-bold">in a separate file</b> (<a href="ch34_03.htm#upt3-CHP-34-SECT-3">Section 34.3</a>) to keep the shell's sticky
ch35_01.htm:<p><b class="emphasis-bold">who</b> (<a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a>)
ch35_01.htm:<p><b class="emphasis-bold">cut -c1-8</b> (<a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>) outputs columns 1-8 of the
ch35_01.htm:<p><b class="emphasis-bold">sort -u</b> (<a href="ch22_06.htm#upt3-CHP-22-SECT-6">Section 22.6</a>) puts names in order and takes out names of
ch35_01.htm:<p><b class="emphasis-bold">pr -l1 -8 -w78 -t</b> (<a href="ch21_15.htm#upt3-CHP-21-SECT-15">Section 21.15</a>, <a href="ch45_06.htm#upt3-CHP-45-SECT-6">Section 45.6</a>) takes the list
ch35_01.htm:<p><a name="IXT-35-3470" />If your system supports the <b class="emphasis-bold">special #! notation</b> (<a href="ch36_02.htm#upt3-CHP-36-SECT-2">Section 36.2</a>) (and it probably does), the first line of the
ch35_01.htm:<a href="ch36_02.htm#upt3-CHP-36-SECT-2">Section 36.2</a> has more information.)
ch35_01.htm:you need to make the shell script executable. The <b class="emphasis-bold">chmod</b> (<a href="ch50_05.htm#upt3-CHP-50-SECT-5">Section 50.5</a>) (change
ch35_01.htm:your <b class="emphasis-bold">login shell</b> (<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>) is <i class="command">csh</i> or
ch35_01.htm:<p><tt class="literal">rehash</tt> <a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a></p>
ch35_01.htm:be in your <a name="IXT-35-3479" /> <a name="IXT-35-3480" />shell's <b class="emphasis-bold">command search path</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>, <a href="ch35_07.htm#upt3-CHP-35-SECT-7">Section 35.7</a>). In that case,
ch35_01.htm:that's in your search path and/or <b class="emphasis-bold">change your search path</b> (<a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a>). If you're the only person
ch35_01.htm:<b class="emphasis-bold">bin directory</b> (<a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>). Otherwise, you might ask your system
ch35_02.htm:standard input is a <b class="emphasis-bold">tty</b> (<a href="ch02_07.htm#upt3-CHP-2-SECT-7">Section 2.7</a>), checking options and arguments, or something
ch35_02.htm:<p>On the other hand, maybe your script needs lots of <b class="emphasis-bold">pipes ( | )</b> (<a href="ch01_05.htm#upt3-CHP-1-SECT-5">Section 1.5</a>) or
ch35_02.htm:<p>To see how to write a simple shell program, <a href="ch35_01.htm#upt3-CHP-35-SECT-1">Section 35.1</a>. To embed scripts from other languages such as
ch35_02.htm:<a href="ch35_19.htm#upt3-CHP-35-SECT-19">Section 35.19</a>.
ch35_02.htm:<p>For explanation of shells in general, <a href="ch27_03.htm#upt3-CHP-27-SECT-3">Section 27.3</a>. 
ch35_02.htm:<p>To read about environment and shell variables, <a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a> and <a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>,
ch35_02.htm:<p>Shell quoting is explained in <a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>.</p>
ch35_02.htm:<i class="command">for</i> loop is discussed in <a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a> (as well as in <a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>, later in this chapter).
ch35_02.htm:<p>Test strings with a <i class="command">case</i> statement, <a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>. Match patterns in a <i class="command">case</i>
ch35_02.htm:statement, <a href="ch35_11.htm#upt3-CHP-35-SECT-11">Section 35.11</a>.
ch35_02.htm:command substitution, <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>.
ch35_02.htm:<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>.
ch35_02.htm:that loop, <a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>.
ch35_02.htm:<p>Set exit status of a shell (shell script), <a href="ch35_16.htm#upt3-CHP-35-SECT-16">Section 35.16</a>. 
ch35_02.htm:<p>Handle interrupts (like CTRL-c) and other signals, <a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>. 
ch35_02.htm:<p>Read input from the keyboard, <a href="ch35_18.htm#upt3-CHP-35-SECT-18">Section 35.18</a>.</p>
ch35_02.htm:<p>Handle command-line arguments (options, filenames, etc.), <a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>.
ch35_02.htm:if it worked or failed, <a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a> and
ch35_02.htm:<a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>.
ch35_02.htm:<i class="command">shift</i> commands, <a href="ch35_22.htm#upt3-CHP-35-SECT-22">Section 35.22</a>. 
ch35_02.htm:with <i class="command">getopt</i>, <a href="ch35_24.htm#upt3-CHP-35-SECT-24">Section 35.24</a>.
ch35_02.htm:<i class="command">set</i> command, <a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>.
ch35_02.htm:command, <a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>.
ch35_02.htm:<p>Pick a name for a new command with no conflict, <a href="ch35_27.htm#upt3-CHP-35-SECT-27">Section 35.27</a>. 
ch35_02.htm:<p>Find the name of a program and use it in the script, <a href="ch35_28.htm#upt3-CHP-35-SECT-28">Section 35.28</a>. 
ch35_02.htm:the current environment, <a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>.
ch35_02.htm:<b class="emphasis-bold">test</b> (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>)
ch35_03.htm:(<a name="IXT-35-3489" /><a href="ch05_02.htm#upt3-CHP-5-SECT-2">Section 5.2</a>)
ch35_03.htm:(<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>) <a name="IXT-35-3490" />variable. When you type a command,
ch35_03.htm:command directories</b> (<a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>), and
ch35_03.htm:you'll need to tell the shell <b class="emphasis-bold">how to find them</b> (<a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a>). 
ch35_03.htm:variables</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) is that a shell
ch35_03.htm:(<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>). That is, the new process gets its own
ch35_03.htm:(<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>) that these names are important. But if
ch35_03.htm:understands <b class="emphasis-bold">filename wildcard</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>)-type expressions -- for instance,
ch35_03.htm:<p><a name="IXT-35-3502" /><a name="IXT-35-3503" /><a name="IXT-35-3504" />The <i class="command">set</i> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) command provides a similar listing of shell
ch35_04.htm:(<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) we said that each process gets its own
ch35_04.htm:found. The problem is simple. A Unix <b class="emphasis-bold">process</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) cannot
ch35_04.htm:(<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>).  -- <em class="emphasis">JP</em>]
ch35_05.htm:<a name="IXT-35-3511" /><dt><i><b class="emphasis-bold">PATH</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>) </i></dt>
ch35_05.htm:<a name="IXT-35-3512" /> <a name="IXT-35-3513" />(<a href="ch26_06.htm#upt3-CHP-26-SECT-6">Section 27.6</a>). This is a list of directories in which the
ch35_05.htm:one of your <b class="emphasis-bold">shell setup files</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>). 
ch35_05.htm:(usually set to a <b class="emphasis-bold">line editor</b> (<a href="ch20_01.htm#upt3-CHP-20-SECT-1">Section 20.1</a>) such as <i class="command">ed</i>) and
ch35_05.htm:editing mode</b> (<a href="ch30_14.htm#upt3-CHP-30-SECT-14">Section 30.14</a>).)
ch35_05.htm:<a name="IXT-35-3521" /><a name="IXT-35-3522" /><dt><i><b class="emphasis-bold">PRINTER</b> (<a href="ch45_04.htm#upt3-CHP-45-SECT-4">Section 45.4</a>) or LPDEST </i></dt>
ch35_05.htm:need to tell <b class="emphasis-bold">lpr or lp</b> (<a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>) which printer to use.
ch35_05.htm:<a name="IXT-35-3528" /><a name="IXT-35-3529" /><a name="IXT-35-3530" /><dt><i><b class="emphasis-bold">HOME</b> (<a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a>) (called <em class="emphasis">LOGDIR</em></tt> on some systems) </i></dt>
ch35_05.htm:new Korn shell is started. (See <a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>.) Korn shell only.
ch35_05.htm:new <i class="command">bash</i> shell is started. (See <a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>.) <i class="command">bash</i> only. Often set to
ch35_05.htm:program like<a name="IXT-35-3544" /> <i class="command">less</i> (<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) or
ch35_05.htm:<i class="command">more</i><a name="IXT-35-3545" />. (Programs like <b class="emphasis-bold">man</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>) use
ch35_05.htm:the <b class="emphasis-bold">.cshrc file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) is read to set up each instance of the shell.
ch35_05.htm:See <a href="ch04_04.htm#upt3-CHP-4-SECT-4">Section 4.4</a>.)
ch35_05.htm:<a name="IXT-35-3550" /><dt><i><b class="emphasis-bold">PS2</b> (<a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a>) </i></dt>
ch35_05.htm:<a name="IXT-35-3551" /><a name="IXT-35-3552" /><dt><i><b class="emphasis-bold">MANPATH</b> (<a href="ch03_21.htm#upt3-CHP-3-SECT-21">Section 3.21</a>) </i></dt>
ch35_05.htm:if your <b class="emphasis-bold">man</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>) command supports it, is a colon-separated
ch35_05.htm:(<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>) to identify the display server
ch35_05.htm:command</b> (<a href="ch08_06.htm#upt3-CHP-8-SECT-6">Section 8.6</a>).
ch35_05.htm:to look at the end of a command's <b class="emphasis-bold">manual page</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>) in
ch35_05.htm:printenv</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>)) and make some
ch35_06.htm:<p><tt class="literal">$HOME/bin</tt> <a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a></p>
ch35_06.htm:<p><a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a> explains more about setting the
ch35_06.htm:<b class="emphasis-bold">built-in commands</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>) and commands for which you give the complete
ch35_06.htm:<i class="command">exit</i> instead.) Another fix is to <b class="emphasis-bold">read</b> (<a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>) whichever
ch35_06.htm:(<a href="ch35_27.htm#upt3-CHP-35-SECT-27">Section 35.27</a>). If you really need an overlapping
ch35_06.htm:pathname</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>) to specify
ch35_06.htm:<em class="emphasis">PATH</em> for a command with <b class="emphasis-bold">which</b> (<a href="ch02_06.htm#upt3-CHP-2-SECT-6">Section 2.6</a>),
ch35_06.htm:<a href="ch35_07.htm#upt3-CHP-35-SECT-7">Section 35.7</a> explains the pair of
ch35_07.htm:(<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>) in <i class="command">csh</i> or
ch35_07.htm:variable</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>) is the actual
ch35_07.htm:<p><tt class="literal">~</tt> <a href="ch30_11.htm#upt3-CHP-30-SECT-11">Section 30.11</a></p>
ch35_08.htm:environment, the DISPLAY environment variable will <b class="emphasis-bold">propagate</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) to
ch35_08.htm:<a href="ch06_10.htm#upt3-CHP-6-SECT-10">Section 6.10</a> for more information on running
ch35_09.htm:"general case" of <b class="emphasis-bold">environment variables</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>). If you're a programmer,
ch35_09.htm:(<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>)). If you're a
ch35_09.htm:example, the C shell uses the <b class="emphasis-bold">history</b> (<a href="ch30_01.htm#upt3-CHP-30-SECT-1">Section 30.1</a>)
ch35_09.htm:if the <b class="emphasis-bold">noclobber</b> (<a href="ch43_06.htm#upt3-CHP-43-SECT-6">Section 43.6</a>) variable is defined, the C shell prevents you
ch35_09.htm:.tcshrc</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>) files to define
ch35_09.htm:them up into context-specific files and then <b class="emphasis-bold">read them into their environment</b> (<a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>) as needed.
ch35_09.htm:or env</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>).<a href="#FOOTNOTE-105">[105]</a> If you want to list all of your Bourne or C shell
ch35_09.htm:<b class="emphasis-bold">external</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>) commands; they work with any shell.</p>
ch35_09.htm:programming</b> (<a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>).<a name="IXTR3-3808" /> <a name="IXTR3-3809" />
ch35_10.htm:(<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>, <a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>)) to one
ch35_10.htm:expressions</b> (<a href="ch35_11.htm#upt3-CHP-35-SECT-11">Section 35.11</a>). When the
ch35_10.htm:<p>Here's an example that tests your <b class="emphasis-bold">TERM</b> (<a name="IXT-35-3599" /><a href="ch05_02.htm#upt3-CHP-5-SECT-2">Section 5.2</a>)
ch35_10.htm:<p><tt class="literal">exit</tt> <a href="ch35_16.htm#upt3-CHP-35-SECT-16">Section 35.16</a></p>
ch35_10.htm:line with <b class="emphasis-bold">semicolons</b> (<a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a>)).<a name="IXT-35-3600" />
ch35_11.htm:<p><a name="IXT-35-3601" /> <a name="IXT-35-3602" /><a name="IXT-35-3603" /><a name="IXT-35-3604" />A <b class="emphasis-bold">case statement</b> (<a name="IXT-35-3605" /><a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) is good at
ch35_11.htm:wildcards</b> (<a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>) in the shell,
ch35_11.htm:the pattern <tt class="literal">What now?</tt>. The <a name="IXT-35-3612" /><b class="emphasis-bold">quotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) tell the
ch35_12.htm:exit status in this way, because there are <b class="emphasis-bold">several ways</b> (<a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>,
ch35_12.htm:<a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>, <a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>) to use
ch35_13.htm:<a name="IXT-35-3655" />special null command, a <b class="emphasis-bold">colon (:)</b> (<a href="ch36_06.htm#upt3-CHP-36-SECT-6">Section 36.6</a>).
ch35_13.htm:"true"), the <b class="emphasis-bold">|| operator</b> (<a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>)
ch35_13.htm:first filename from the command line -- see <a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>.) 
ch35_13.htm:named <b class="emphasis-bold">test</b> (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>). The <i class="command">test</i> command does a
ch35_14.htm:<i class="command">cat</i> returns an exit status of 1), you <b class="emphasis-bold">exit</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>). If you
ch35_14.htm:write an <a name="IXT-35-3664" />"inverse <b class="emphasis-bold">if</b> (<a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>)): 
ch35_15.htm:<p>The loop runs <b class="emphasis-bold">who</b> (<a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a>) and pipes that output to <b class="emphasis-bold">grep</b> (<a href="ch13_01.htm#upt3-CHP-13-SECT-1">Section 13.1</a>), which
ch35_15.htm:<p><tt class="literal">/dev/null</tt> <a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a></p>
ch35_16.htm:return a <b class="emphasis-bold">status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>). Your shell script should, too. This section
ch35_16.htm:<a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>. If the script can make a backup
ch35_17.htm:<a name="IXT-35-3677" />your <b class="emphasis-bold">interrupt key</b> (<a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>)
ch35_17.htm:<b class="emphasis-bold">process ID number</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>). Because no other process will have the same
ch35_17.htm:ID number, that file should have a unique name. The script <b class="emphasis-bold">uncompresses</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>)
ch35_17.htm:<p><tt class="literal">exit</tt> <a href="ch35_16.htm#upt3-CHP-35-SECT-16">Section 35.16</a></p>
ch35_17.htm:(<a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a>). The first command removes the
ch35_17.htm:option</b> (<a href="ch14_10.htm#upt3-CHP-14-SECT-10">Section 14.10</a>), so
ch35_17.htm:have two <i class="command">trap</i>s. Look at the <b class="emphasis-bold">nom</b> (<a href="ch33_08.htm#upt3-CHP-33-SECT-8">Section 33.8</a>) script for
ch35_17.htm:<i class="command">echo</i> commands in the script have <b class="emphasis-bold">1&gt;&amp;2</b> (<a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>) at
ch35_17.htm:it's probably neater to call a <b class="emphasis-bold">shell function</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>)
ch35_18.htm:(<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>); they can only read from the
ch35_18.htm:(<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>):
ch35_19.htm:(<a href="ch36_03.htm#upt3-CHP-36-SECT-3">Section 36.3</a>) without needing the Bourne shell,
ch35_19.htm:line</b> (<a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>) and pass information
ch35_19.htm:and so on. Simply use correct <b class="emphasis-bold">quoting</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) to pass
ch35_19.htm:<p><tt class="literal">||</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a></p>
ch35_19.htm:scripts</b> (<a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>):
ch35_19.htm:<p><tt class="literal">&lt;&lt;\</tt> <a href="ch27_16.htm#upt3-CHP-27-SECT-16">Section 27.16</a></p>
ch35_19.htm:command becomes the equivalent of a shell <b class="emphasis-bold">eval</b> (<a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a>); it
ch35_19.htm:line has to end with a backslash (\)</b> (<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>). <a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a> and
ch35_19.htm:<a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a> have more about quoting.
ch35_20.htm:articles</b> (<a href="ch35_16.htm#upt3-CHP-35-SECT-16">Section 35.16</a>, <a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>), <tt class="literal">$1</tt> holds the first
ch35_20.htm:<a name="IXT-35-3710" /><a name="IXT-35-3711" />reading this <b class="emphasis-bold">series</b> (<a href="ch35_02.htm#upt3-CHP-35-SECT-2">Section 35.2</a>) of
ch35_20.htm:articles in order, you saw the <i class="command">zmore</i> (<a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>) script that accepted just one command-line
ch35_20.htm:a script, the shell will replace that string with a <b class="emphasis-bold">quoted</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) set of
ch35_20.htm:<b class="emphasis-bold">unusual characters</b> (<a href="ch14_11.htm#upt3-CHP-14-SECT-11">Section 14.11</a>): 
ch35_20.htm:no command-line arguments, the <tt class="literal">"$@"</tt> <b class="emphasis-bold">becomes a single empty argument</b> (<a href="ch37_05.htm#upt3-CHP-37-SECT-5">Section 37.5</a>), as if you'd typed this:
ch35_20.htm:<b class="emphasis-bold">${1+"$@"}</b> (<a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a>). That means that if <tt class="literal">$1</tt> is
ch35_20.htm:loop</b> (<a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>) can step through all
ch35_20.htm:command-line arguments, one by one. You can also use a <b class="emphasis-bold">while loop</b> (<a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>) that
ch35_20.htm:by one with the <b class="emphasis-bold">shift command</b> (<a href="ch35_22.htm#upt3-CHP-35-SECT-22">Section 35.22</a>). The <b class="emphasis-bold">getopt and
ch35_20.htm:getopts</b> (<a href="ch35_24.htm#upt3-CHP-35-SECT-24">Section 35.24</a>) commands handle
ch35_20.htm:script in <a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>) with <b class="emphasis-bold">case</b> (<a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) or
ch35_20.htm:<b class="emphasis-bold">test</b> (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>).
ch35_21.htm:(The <b class="emphasis-bold">"$@" parameter</b> (<a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>) gives you all of them at once.) The Bourne
ch35_21.htm:<b class="emphasis-bold">shell variable</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>)), then executes the commands from
ch35_21.htm:loop, let's hack on the <b class="emphasis-bold">zmore</b> (<a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>) script.
ch35_21.htm:<p><tt class="literal">case</tt> <a href="ch35_11.htm#upt3-CHP-35-SECT-11">Section 35.11</a></p>
ch35_21.htm:<b class="emphasis-bold">quoted</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>). This way, if <tt class="literal">$switches</tt> is
ch35_21.htm:<b class="emphasis-bold">IFS</b> (<a href="ch36_23.htm#upt3-CHP-36-SECT-23">Section 36.23</a>)-separated) list of words -- not just
ch35_21.htm:substitution</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) (backquotes)
ch35_21.htm:or <b class="emphasis-bold">shell wildcards</b> (<a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>), or just
ch35_21.htm:<p><tt class="literal">lpr</tt> <a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a></p>
ch35_21.htm:<p><a name="IXT-35-3729" />The <b class="emphasis-bold">getopt and getopts</b> (<a href="ch35_24.htm#upt3-CHP-35-SECT-24">Section 35.24</a>) commands handle command-line arguments in a
ch35_22.htm:loop</b> (<a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>) is great if you want
ch35_22.htm:of <b class="emphasis-bold">while</b> (<a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>), <b class="emphasis-bold">test</b> (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>), <b class="emphasis-bold">case</b> (<a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>), and <i class="command">shift</i>.
ch35_22.htm:<i class="command">while</i> loop uses <b class="emphasis-bold">test</b> (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>) to check
ch35_22.htm:approach is perhaps obsolete if you have <b class="emphasis-bold">getopts</b> (<a href="ch35_24.htm#upt3-CHP-35-SECT-24">Section 35.24</a>)
ch35_23.htm:loop</b> (<a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>) iterates until it has
ch35_23.htm:until loops</b> (<a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>) iterate until
ch35_23.htm:<p><tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>, <tt class="literal">||</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>, <tt class="literal">*</tt> <a href="ch01_13.htm#upt3-CHP-1-SECT-13">Section 1.13</a>, <tt class="literal">test</tt> <a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a></p>
ch35_24.htm:command-line arguments -- options, filenames, and so on. <a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>, <a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>, and <a href="ch35_22.htm#upt3-CHP-35-SECT-22">Section 35.22</a> show how to parse command lines with any
ch35_24.htm:you'll usually give <b class="emphasis-bold">"$@"</b> (<a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>) to pass
ch35_24.htm:error message and returns a nonzero <b class="emphasis-bold">status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>).
ch35_24.htm:<p><tt class="literal">||</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>, <tt class="literal">:</tt> <a href="ch36_06.htm#upt3-CHP-36-SECT-6">Section 36.6</a></p>
ch35_24.htm:script starts by running <i class="command">getopt</i> inside <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) and
ch35_24.htm:using the <i class="command">set</i> (<a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>)
ch35_24.htm:dashes)</b> (<a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>), is important: it
ch35_24.htm:empty "$@" parameter</b> (<a href="ch37_05.htm#upt3-CHP-37-SECT-5">Section 37.5</a>). If
ch35_25.htm:option</b> (<a href="ch27_15.htm#upt3-CHP-27-SECT-15">Section 27.15</a>):
ch35_25.htm:around that problem, you could start a <b class="emphasis-bold">subshell</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) with
ch35_25.htm:Unix command with <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>). For example, you can get a list of all
ch35_25.htm:(<a name="IXT-35-3761" /><a name="IXT-35-3762" /><a href="ch02_08.htm#upt3-CHP-2-SECT-8">Section 2.8</a>) and <b class="emphasis-bold">cut</b>
ch35_25.htm:(<a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>) to strip off everything but the
ch35_25.htm:<p><tt class="literal">for</tt> <a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a></p>
ch35_25.htm:functions</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>) and other shell
ch35_25.htm:from a <b class="emphasis-bold">cron</b> (<a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>) job, in the middle of the night when no one
ch35_25.htm:parameters. Then use <b class="emphasis-bold">shift</b> (<a href="ch35_22.htm#upt3-CHP-35-SECT-22">Section 35.22</a>) to shift away the <tt class="literal">x</tt>,
ch35_25.htm:them, <b class="emphasis-bold">wildcards</b> (<a href="ch33_02.htm#upt3-CHP-33-SECT-2">Section 33.2</a>) and other <b class="emphasis-bold">special
ch35_25.htm:characters</b> (<a href="ch27_17.htm#upt3-CHP-27-SECT-17">Section 27.17</a>) will be
ch35_25.htm:(<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>). You can take advantage of this to
ch35_25.htm:<b class="emphasis-bold">IFS</b> (<a href="ch36_23.htm#upt3-CHP-36-SECT-23">Section 36.23</a>)
ch35_25.htm:(<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>) for the part of the script where you
ch35_26.htm:shell's manual page (if your shell has <b class="emphasis-bold">test built in</b> (<a href="ch01_09.htm#upt3-CHP-1-SECT-9">Section 1.9</a>))
ch35_26.htm:<p>The <i class="command">test</i> command returns a zero <b class="emphasis-bold">status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>) if the
ch35_26.htm:<p><tt class="literal">$HOME</tt> <a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>, <tt class="literal">$myname</tt> <a href="ch35_28.htm#upt3-CHP-35-SECT-28">Section 35.28</a></p>
ch35_26.htm:a couple of other common gotchas caused by empty arguments; <a href="ch37_03.htm#upt3-CHP-37-SECT-3">Section 37.3</a> and <a href="ch37_04.htm#upt3-CHP-37-SECT-4">Section 37.4</a> have
ch35_27.htm:<p><tt class="literal">which</tt> <a href="ch02_06.htm#upt3-CHP-2-SECT-6">Section 2.6</a>, <tt class="literal">whereis</tt> <a href="ch02_03.htm#upt3-CHP-2-SECT-3">Section 2.3</a>, <tt class="literal">alias</tt> <a href="ch29_02.htm#upt3-CHP-29-SECT-2">Section 29.2</a></p>
ch35_28.htm:<em class="filename">/xxx/yyy/bin/someprog</em>. The <b class="emphasis-bold">basename</b> (<a href="ch36_13.htm#upt3-CHP-36-SECT-13">Section 36.13</a>)
ch35_28.htm:make <b class="emphasis-bold">links</b> (<a href="ch10_03.htm#upt3-CHP-10-SECT-3">Section 10.3</a>) to give Unix files several names, you can use
ch35_28.htm:names</b> (<a href="ch36_08.htm#upt3-CHP-36-SECT-8">Section 36.8</a>). For instance, see
ch35_29.htm:<p><a name="IXT-35-3795" /><a name="IXT-35-3796" />As <a href="ch35_04.htm#upt3-CHP-35-SECT-4">Section 35.4</a> explains, Unix programs can <em class="emphasis">never,
ch35_29.htm:functions</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>), you can
ch35_29.htm:<b class="emphasis-bold">simulate them</b> (<a href="ch29_14.htm#upt3-CHP-29-SECT-14">Section 29.14</a>) with the . command. It acts a lot like a
ch35_30.htm:<p><a name="upt3-IDXTERM-5742" /> <a name="upt3-IDXTERM-5743" />So far, we have discussed <b class="emphasis-bold">some shell function basics</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>), using examples such as the <tt class="literal">mx(
ch35_30.htm:commands to include those functions from an external file (<a href="ch35_29.htm#upt3-CHP-35-SECT-29">Section 35.29</a>). 
ch35_30.htm:<p>We've also discussed using functions to <b class="emphasis-bold">automate repetitive tasks</b> (<a href="ch29_11.htm#upt3-CHP-29-SECT-11">Section 29.11</a>), such as calculating factorials.
ch36_01.htm:file to read. Chris Torek's Usenet classic, <a href="ch36_02.htm#upt3-CHP-36-SECT-2">Section 36.2</a>, explains how <tt class="literal">#!</tt>
ch36_01.htm:started. <a href="ch36_03.htm#upt3-CHP-36-SECT-3">Section 36.3</a> explains that your
ch36_01.htm:<i class="command">exec</i> command, <a href="ch36_05.htm#upt3-CHP-36-SECT-5">Section 36.5</a>, replaces the shell with another process; it
ch36_01.htm:status -- <a href="ch36_06.htm#upt3-CHP-36-SECT-6">Section 36.6</a> explains why you
ch36_01.htm:substitution, explained in <a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a>, is a
ch36_01.htm:<a href="ch36_08.htm#upt3-CHP-36-SECT-8">Section 36.8</a>. <a href="ch36_09.htm#upt3-CHP-36-SECT-9">Section 36.9</a> shows the easy way to get the last
ch36_01.htm:command-line argument. <a href="ch36_10.htm#upt3-CHP-36-SECT-10">Section 36.10</a> has an
ch36_01.htm:into a single shell variable. <a href="ch36_11.htm#upt3-CHP-36-SECT-11">Section 36.11</a>
ch36_01.htm:input. <a href="ch36_12.htm#upt3-CHP-36-SECT-12">Section 36.12</a> has techniques for making
ch36_01.htm:can be used to split pathnames with a loop; see <a href="ch36_13.htm#upt3-CHP-36-SECT-13">Section 36.13</a>. A <i class="command">while</i> loop can have more
ch36_01.htm:than one command line at the start; see <a href="ch36_14.htm#upt3-CHP-36-SECT-14">Section 36.14</a>. 
ch36_01.htm:<p>Next is an assortment of articles about input/output. <a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a> introduces open files and file
ch36_01.htm:standard input/output/error than you might have realized! <a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a> has a look at file-descriptor handling
ch36_01.htm:<a href="ch36_17.htm#upt3-CHP-36-SECT-17">Section 36.17</a> points out, a shell can also
ch36_01.htm:problems. <a href="ch36_18.htm#upt3-CHP-36-SECT-18">Section 36.18</a> shows one place
ch36_01.htm:<a href="ch36_19.htm#upt3-CHP-36-SECT-19">Section 36.19</a> explains. <a href="ch36_20.htm#upt3-CHP-36-SECT-20">Section 36.20</a> shows how to turn off echoing while your
ch36_01.htm:<p>Two articles -- <a href="ch36_22.htm#upt3-CHP-36-SECT-22">Section 36.22</a> and <a href="ch36_23.htm#upt3-CHP-36-SECT-23">Section 36.23</a> -- show uses for the versatile
ch36_01.htm:<i class="command">expr</i> expression-handling command. <a href="ch36_21.htm#upt3-CHP-36-SECT-21">Section 36.21</a> is a quick reference to
ch36_01.htm:<i class="command">expr</i>. <a href="ch36_24.htm#upt3-CHP-36-SECT-24">Section 36.24</a> covers
ch36_01.htm:multiple <b class="emphasis-bold">command substitution</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>). 
ch36_01.htm:<p><a href="ch36_25.htm#upt3-CHP-36-SECT-25">Section 36.25</a> shows a trick for making one
ch36_01.htm:<b class="emphasis-bold">case statement</b> (<a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) test two things at once. Finally, <a href="ch36_27.htm#upt3-CHP-36-SECT-27">Section 36.27</a> has a simple technique for getting
ch36_02.htm:read your <b class="emphasis-bold">.cshrc file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>). 
ch36_03.htm:<p>Let's run both commands and <b class="emphasis-bold">time</b> (<a name="IXT-36-3188" /><a href="ch26_02.htm#upt3-CHP-26-SECT-2">Section 26.2</a>) them.
ch36_04.htm:<p><a name="IXT-36-3195" /> <a name="IXT-36-3196" /> <a name="IXT-36-3197" />As <a href="ch36_03.htm#upt3-CHP-36-SECT-3">Section 36.3</a>
ch36_04.htm:command will search your <b class="emphasis-bold">PATH</b> (<a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>) for an interpreter, then execute (<b class="emphasis-bold">exec</b> (<a href="ch24_02.htm#upt3-CHP-24-SECT-2">Section 24.2</a>), replace
ch36_05.htm:terminates the current shell and starts a new <b class="emphasis-bold">process</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) in its
ch36_05.htm:<p><i class="command">exec</i><a name="IXT-36-3204" /> <a name="IXT-36-3205" /> also <b class="emphasis-bold">manipulates file descriptors</b> (<a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>) in the Bourne shell. When you use
ch36_06.htm:returns a zero <b class="emphasis-bold">exit status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>). Here are a few places to use it:
ch36_06.htm:make an endless <b class="emphasis-bold">while loop</b> (<a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>). This is more efficient because the shell
ch36_06.htm:if</b> (<a name="IXT-36-3212" /><a name="IXT-36-3213" /> <a name="IXT-36-3214" /><a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>) but
ch36_06.htm:(<a href="ch35_07.htm#upt3-CHP-35-SECT-7">Section 35.7</a>) like
ch36_07.htm:<b class="emphasis-bold">bkedit script</b> (<a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>, <a href="ch35_16.htm#upt3-CHP-35-SECT-16">Section 35.16</a>):
ch36_07.htm:<p>If the <b class="emphasis-bold">VISUAL</b> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>) environment variable is set and is not empty,
ch36_07.htm:You'll see them used with the <b class="emphasis-bold">colon (:) operator</b> (<a href="ch36_06.htm#upt3-CHP-36-SECT-6">Section 36.6</a>), checking or setting default values.
ch36_08.htm:<a name="IXT-36-3231" /><b class="emphasis-bold">links</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>, <a href="ch10_03.htm#upt3-CHP-10-SECT-3">Section 10.3</a>) to it instead. The program can find the name
ch36_08.htm:<tt class="literal">/usr/joe/bin/prog</tt> (<a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a> explains pathnames). There are a couple of
ch36_08.htm:<a href="ch35_11.htm#upt3-CHP-35-SECT-11">Section 35.11</a>) handles the different pathnames
ch36_08.htm:also want to use <b class="emphasis-bold">basename</b> (<a href="ch36_13.htm#upt3-CHP-36-SECT-13">Section 36.13</a>) to strip off any leading pathname and store
ch36_09.htm:<p><tt class="literal">eval</tt> <a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a></p>
ch36_10.htm:<p><a name="IXT-36-3242" /><a name="IXT-36-3243" />The <b class="emphasis-bold">shift</b> (<a href="ch35_22.htm#upt3-CHP-35-SECT-22">Section 35.22</a>) command
ch36_10.htm:(<a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>) to unset all parameters.
ch36_10.htm:<b class="emphasis-bold">set</b> (<a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>) a
ch36_11.htm:<b class="emphasis-bold">for loop</b> (<a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>) is to step through a list of
ch36_11.htm:loop with <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) and <b class="emphasis-bold">cat</b>
ch36_11.htm:(<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>), and the loop will step through the
ch36_12.htm:shell <b class="emphasis-bold">for loop</b> (<a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>) lets you take a list of items, store the
ch36_12.htm:<p><tt class="literal">set</tt> <a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a></p>
ch36_12.htm:shell's <b class="emphasis-bold">eval</b> (<a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a>) command to rescan the contents of the
ch36_13.htm:(<a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>) to find a file or directory. There are
ch36_13.htm:run <b class="emphasis-bold">split</b> (<a href="ch21_09.htm#upt3-CHP-21-SECT-9">Section 21.9</a>) on them, and add <em class="emphasis">huge</em>.
ch36_13.htm:<p><tt class="literal">||</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>, <tt class="literal">exit</tt> <a href="ch35_16.htm#upt3-CHP-35-SECT-16">Section 35.16</a></p>
ch36_14.htm:(<a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>) looked like this, with a single
ch36_15.htm:starts any <b class="emphasis-bold">process</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>) -- for example, <i class="command">grep</i>,
ch36_15.htm:you'll see in <a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>,
ch36_15.htm:<p><a name="IXT-36-3305" /><a name="IXT-36-3306" />When Unix starts a new <b class="emphasis-bold">subprocess</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>), the
ch36_15.htm:redirected-I/O loop, as discussed in <a href="ch43_06.htm#upt3-CHP-43-SECT-6">Section 43.6</a>, takes advantage of this.
ch36_16.htm:standard output, and standard error (<a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a> explains). Without redirection,
ch36_16.htm:<b class="emphasis-bold">/dev/tty</b> (<a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>). It's easy to redirect any
ch36_18.htm:<p><img src="figs/bomb.gif" alt="Figure " width="24" /> <a href="ch36_17.htm#upt3-CHP-36-SECT-17">Section 36.17</a></p>
ch36_18.htm:<em class="emphasis">lib-glob-aprog.c</em>. You can use <b class="emphasis-bold">sed</b> (<a href="ch34_02.htm#upt3-CHP-34-SECT-2">Section 34.2</a>) to convert
ch36_18.htm:an even better solution can be developed using <b class="emphasis-bold">nawk</b> (<a href="ch20_11.htm#upt3-CHP-20-SECT-11">Section 20.11</a>). The
ch36_18.htm:following example uses <b class="emphasis-bold">find</b> (<a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a>) to make a list of pathnames, one per line, in
ch36_18.htm:<tt class="literal">sh -v</tt>, the shell's <b class="emphasis-bold">verbose option</b> (<a href="ch37_01.htm#upt3-CHP-37-SECT-1">Section 37.1</a>)
ch36_18.htm:status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>) -- that might
ch36_19.htm:your <b class="emphasis-bold">hereis document</b> (<a href="ch27_16.htm#upt3-CHP-27-SECT-16">Section 27.16</a>) terminators, there's an
ch36_20.htm:<p><tt class="literal">stty</tt> <a href="ch05_07.htm#upt3-CHP-5-SECT-7">Section 5.7</a>, <tt class="literal">read</tt> <a href="ch35_18.htm#upt3-CHP-35-SECT-18">Section 35.18</a></p>
ch36_20.htm:<p>The response is stored in <tt class="literal">$ans</tt>. The <b class="emphasis-bold">trap</b> (<a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a>) helps to
ch36_21.htm:status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>) values for
ch36_21.htm:output</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>); if false, it writes
ch36_21.htm:<a name="IXT-36-3362" />Sort of like <b class="emphasis-bold">grep</b> (<a href="ch13_01.htm#upt3-CHP-13-SECT-1">Section 13.1</a>);
ch36_21.htm:expression</b> (<a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>) to search for in
ch36_21.htm:symbol</b> (<a href="ch32_05.htm#upt3-CHP-32-SECT-5">Section 32.5</a>) is assumed by
ch36_22.htm:<p><a name="IXT-36-3366" /><a name="IXT-36-3367" /> <a name="IXT-36-3368" /><a name="IXT-36-3369" />The <b class="emphasis-bold">expr</b> (<a href="ch36_21.htm#upt3-CHP-36-SECT-21">Section 36.21</a>) command
ch36_22.htm:expression</b> (<a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>). The string and
ch36_22.htm:so on. <i class="command">expr</i> is <a name="IXT-36-3371" />usually run with <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) to
ch36_22.htm:status</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>). If you want a
ch36_22.htm:<p><tt class="literal">/dev/null</tt> <a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a></p>
ch36_23.htm:<a name="IXT-36-3377" /><a name="IXT-36-3378" />(<a href="ch36_21.htm#upt3-CHP-36-SECT-21">Section 36.21</a>) can grab part of a string with a
ch36_23.htm:command-line arguments in a single word. (Using <b class="emphasis-bold">"$@"</b> (<a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>) here
ch36_23.htm:(<a name="IXT-36-3383" /><a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>) command starts more quickly than
ch36_23.htm:<p><a name="IXT-36-3384" /><a name="IXT-36-3385" /><a name="IXT-36-3386" />The Bourne shell <b class="emphasis-bold">set</b> (<a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>) command can
ch36_23.htm:<a name="IXT-36-3387" />store it in the <b class="emphasis-bold">command-line parameters</b> (<a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>) <tt class="literal">"$@"</tt>,
ch36_23.htm:and so on. Then you can also loop through the words with a <b class="emphasis-bold">for loop</b> (<a href="ch35_21.htm#upt3-CHP-35-SECT-21">Section 35.21</a>) and
ch36_23.htm:(<a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>) command to store the fields in
ch36_23.htm:<i class="command">stty</i> by the <b class="emphasis-bold">backquotes</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>). It
ch36_23.htm:external command like <b class="emphasis-bold">cut</b> (<a href="ch21_14.htm#upt3-CHP-21-SECT-14">Section 21.14</a>) or <b class="emphasis-bold">awk</b>
ch36_23.htm:(<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>).
ch36_23.htm:substitution</b> (<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a>) at spaces,
ch36_23.htm:<b class="emphasis-bold">escaped parentheses</b> (<a href="ch34_11.htm#upt3-CHP-34-SECT-11">Section 34.11</a>) to do the searching and the parsing could
ch36_23.htm:<p><a name="IXT-36-3395" /> <a name="IXT-36-3396" /><a name="IXT-36-3397" />The Unix <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) utility is
ch36_23.htm:<a name="IXT-36-3398" />output of the <b class="emphasis-bold">df</b> (<a href="ch15_08.htm#upt3-CHP-15-SECT-8">Section 15.8</a>) command. On
ch36_23.htm:operators</b> (<a name="IXT-36-3400" /><a href="ch34_11.htm#upt3-CHP-34-SECT-11">Section 34.11</a>)
ch36_23.htm:<b class="emphasis-bold">eval</b> (<a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a>)
ch36_24.htm:<p><a name="IXT-36-3404" /><a name="IXT-36-3405" /><a name="IXT-36-3406" /><a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a> introduced command substitution with a pair of
ch36_24.htm:the special meaning</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) of the
ch36_24.htm:<p><tt class="literal">2&gt;&amp;1</tt> <a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a></p>
ch36_24.htm:case, the <b class="emphasis-bold">find</b> (<a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a>) -- is run first. Its output, a list of
ch36_24.htm:filenames, is put on the command line of the <b class="emphasis-bold">tar</b> (<a href="ch38_02.htm#upt3-CHP-38-SECT-2">Section 38.2</a>) command.
ch36_24.htm:There's another nice example in <a href="ch24_16.htm#upt3-CHP-24-SECT-16">Section 24.16</a>. 
ch36_25.htm:<b class="emphasis-bold">case statement</b> (<a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) has some advantages over the <b class="emphasis-bold">test command</b> (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>) -- for instance, <i class="command">case</i>
ch36_25.htm:matching</b> (<a href="ch35_11.htm#upt3-CHP-35-SECT-11">Section 35.11</a>) and that
ch36_26.htm:Window System</b> (<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>)), give the
ch36_26.htm:variable</b> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>) is set; if not, it
ch36_26.htm:<p><tt class="literal">:</tt> <a href="ch36_06.htm#upt3-CHP-36-SECT-6">Section 36.6</a>, <tt class="literal">${..?..}</tt> <a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch36_26.htm:<p>`<tt class="literal">...</tt>`<a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch36_26.htm:(<a name="IXT-36-3424" /><a name="IXT-36-3425" /><a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>) is endless because
ch36_26.htm:0</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>). As long as the user
ch36_26.htm:statement</b> (<a name="IXT-36-3427" /><a href="ch35_13.htm#upt3-CHP-35-SECT-13">Section 35.13</a>). On the
ch36_26.htm:statement</b> (<a name="IXT-36-3429" /><a href="ch35_10.htm#upt3-CHP-35-SECT-10">Section 35.10</a>) that tests
ch36_26.htm:<b class="emphasis-bold">$?</b> (<a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a>).)
ch36_26.htm:(<a name="IXT-36-3430" /><a href="ch21_02.htm#upt3-CHP-21-SECT-2">Section 21.2</a>)
ch36_27.htm:<a name="IXT-36-3434" />and <b class="emphasis-bold">file permissions</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>) are handled.
ch36_27.htm:<p><tt class="literal">2&gt;</tt> <a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>, <tt class="literal">/dev/null</tt> <a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a>, <tt class="literal">set</tt> <a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a></p>
ch36_27.htm:<em class="emphasis">umask 222</em> command is run in a <b class="emphasis-bold">subshell</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>), it
ch36_27.htm:(<a name="IXT-36-3442" /><a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>) running.
ch37_01.htm:handle <tt class="literal">#!</tt>, use the command <b class="emphasis-bold">set -xv</b> (<a href="ch35_25.htm#upt3-CHP-35-SECT-25">Section 35.25</a>)). The
ch37_01.htm:stdout and stderr</b> (<a href="ch43_04.htm#upt3-CHP-43-SECT-4">Section 43.4</a>) to the
ch37_01.htm:in a file and see it on your screen, too? Use <b class="emphasis-bold">tee</b> (<a href="ch43_08.htm#upt3-CHP-43-SECT-8">Section 43.8</a>) to copy the
ch37_01.htm:shell's output and errors</b> (<a href="ch43_05.htm#upt3-CHP-43-SECT-5">Section 43.5</a>, <a href="ch27_11.htm#upt3-CHP-27-SECT-11">Section 27.11</a>) into a
ch37_01.htm:temporary file. Use <b class="emphasis-bold">tail -f</b> (<a href="ch12_10.htm#upt3-CHP-12-SECT-10">Section 12.10</a>) to "watch"
ch37_01.htm:two files</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>).
ch37_01.htm:outputs</b> (<a href="ch43_06.htm#upt3-CHP-43-SECT-6">Section 43.6</a>). Some Bourne shells
ch37_02.htm:and displays their values</b> (<a href="ch36_14.htm#upt3-CHP-36-SECT-14">Section 36.14</a>):
ch37_02.htm:value of that variable is displayed; the <b class="emphasis-bold">eval</b> (<a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a>) command
ch37_03.htm:(<a name="IXT-37-3101" /> <a name="IXT-37-3102" /><a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>) can
ch37_04.htm:(square bracket) command</b> (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>)
ch37_04.htm:the shell replaces <b class="emphasis-bold">${var+X}</b> (<a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a>) with just <tt class="literal">X</tt> and the first
ch37_04.htm:<p>See also <a href="ch37_03.htm#upt3-CHP-37-SECT-3">Section 37.3</a> for a brief example of
ch37_05.htm:with multiple words. I thought that putting <b class="emphasis-bold">quotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) around
ch37_05.htm:<p><tt class="literal">"$@"</tt> <a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a></p>
ch37_05.htm:shortcuts"</b> (<a name="IXT-37-3129" /><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a>). Another more generally useful one is
ch37_06.htm:mysterious <b class="emphasis-bold">helper programs</b> (<a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>)) to take care of this.<a href="#FOOTNOTE-120">[120]</a>
ch37_07.htm:control</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>) during the script.
ch37_07.htm:different filename, type its <b class="emphasis-bold">pathname</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>) on the
ch37_07.htm:done, type CTRL-d or <b class="emphasis-bold">exit</b> (<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) at a shell prompt.
ch37_07.htm:back" whatever happened by <b class="emphasis-bold">catting</b> (<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>) the
ch37_07.htm:or <b class="emphasis-bold">od -c</b> (<a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a>) will show you these characters.) If the file
ch37_07.htm:<a href="ch21_11.htm#upt3-CHP-21-SECT-11">Section 21.11</a> and <a href="ch37_08.htm#upt3-CHP-37-SECT-8">Section 37.8</a>. 
ch37_07.htm:its <b class="emphasis-bold">menus</b> (<a href="ch05_17.htm#upt3-CHP-5-SECT-17">Section 5.17</a>). 
ch37_08.htm:<p><a name="IXT-37-3150" /> <a name="IXT-37-3151" />As <a href="ch37_07.htm#upt3-CHP-37-SECT-7">Section 37.7</a>
ch37_08.htm:the <b class="emphasis-bold">sed</b> (<a href="ch34_01.htm#upt3-CHP-34-SECT-1">Section 34.1</a>) substitute command to remove CTRL-m (RETURN)
ch37_08.htm:command</b> (<a href="ch34_21.htm#upt3-CHP-34-SECT-21">Section 34.21</a>) to repeat a series
ch37_08.htm:character</b> (<a href="ch05_08.htm#upt3-CHP-5-SECT-8">Section 5.8</a>), change the
ch37_08.htm:<i class="command">sed</i> script has <b class="emphasis-bold">doublequotes</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>)
ch37_08.htm:<p><tt class="literal">eval</tt> <a href="ch27_08.htm#upt3-CHP-27-SECT-8">Section 27.8</a>, <tt class="literal">exec</tt> <a href="ch36_05.htm#upt3-CHP-36-SECT-5">Section 36.5</a></p>
ch37_09.htm:(<a name="IXT-37-3167" /><a href="ch14_05.htm#upt3-CHP-14-SECT-5">Section 14.5</a>) outputs
ch37_09.htm:testing, make it with <i class="command">yes</i> and <b class="emphasis-bold">head</b> (<a name="IXT-37-3168" /><a href="ch12_12.htm#upt3-CHP-12-SECT-12">Section 12.12</a>). For
ch38_01.htm:<p><b class="emphasis-bold">tarring</b> (<a href="ch38_02.htm#upt3-CHP-38-SECT-2">Section 38.2</a>) files to a tape.
ch38_02.htm:<em class="emphasis">ar</em>chiver, one of its common uses is <b class="emphasis-bold">making an archive file on disk</b> (<a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>). Because <i class="command">tar</i>
ch38_02.htm:(<a name="IXT-38-2935" /><a href="ch39_03.htm#upt3-CHP-39-SECT-3">Section 39.3</a>) can
ch38_02.htm:(<a name="IXT-38-2936" /><a href="ch15_07.htm#upt3-CHP-15-SECT-7">Section 15.7</a>) than
ch38_02.htm:<a name="IXT-38-2937" />inode information, it can make a <b class="emphasis-bold">more complete copy</b> (<a href="ch10_13.htm#upt3-CHP-10-SECT-13">Section 10.13</a>) of a file or directory tree than utilities
ch38_02.htm:<p>Yes, we do have articles about archives on tape. <a href="ch38_03.htm#upt3-CHP-38-SECT-3">Section 38.3</a> has enough information to make your own
ch38_02.htm:archive, although you might need the details from <a href="ch38_05.htm#upt3-CHP-38-SECT-5">Section 38.5</a>, too. After you've made an
ch38_02.htm:least as a test to be sure your archive is okay. <a href="ch38_06.htm#upt3-CHP-38-SECT-6">Section 38.6</a> explains how.
ch38_02.htm:<a href="ch38_07.htm#upt3-CHP-38-SECT-7">Section 38.7</a> about using a drive on another
ch38_02.htm:files and directories</b> (<a href="ch39_03.htm#upt3-CHP-39-SECT-3">Section 39.3</a>).
ch38_04.htm:<p><a name="IXT-38-2940" /><a href="ch38_03.htm#upt3-CHP-38-SECT-3">Section 38.3</a>
ch38_04.htm:<p><a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a> and <a href="ch39_03.htm#upt3-CHP-39-SECT-3">Section 39.3</a> have more information on using
ch38_04.htm:<b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>)
ch38_04.htm:or <b class="emphasis-bold">CVS</b> (<a href="ch39_07.htm#upt3-CHP-39-SECT-7">Section 39.7</a>) to save every version of a file you are
ch38_05.htm:<p>As <a href="ch38_03.htm#upt3-CHP-38-SECT-3">Section 38.3</a> says, the
ch38_05.htm:command can be used directly, as we saw in <a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>, to make a backup. For example, the command:
ch38_05.htm:<a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>.
ch38_05.htm:look at the end of <a href="ch21_09.htm#upt3-CHP-21-SECT-9">Section 21.9</a>.)
ch38_05.htm:(<a name="IXT-38-2975" /><a href="ch38_13.htm#upt3-CHP-38-SECT-13">Section 38.13</a>) is an archiving utility that packs files
ch38_06.htm:use <b class="emphasis-bold">GNU tar</b> (<a href="ch39_03.htm#upt3-CHP-39-SECT-3">Section 39.3</a>), which allows you to remap pathnames starting
ch38_06.htm:that starts with slash (<tt class="literal">/</tt>) or <b class="emphasis-bold">tilde</b> (<tt class="literal">~</tt>) (<a href="ch31_11.htm#upt3-CHP-31-SECT-11">Section 31.11</a>) (since the shell will expand
ch38_06.htm:<p><tt class="literal">rsh</tt> <a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a></p>
ch38_06.htm:(<a href="ch38_08.htm#upt3-CHP-38-SECT-8">Section 38.8</a>).
ch38_07.htm:<b class="emphasis-bold">tar</b> (<a href="ch38_02.htm#upt3-CHP-38-SECT-2">Section 38.2</a>)
ch38_07.htm:<b class="emphasis-bold">NFS</b> (<a name="IXT-38-3000" /><a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>), you can just <b class="emphasis-bold">rlogin</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) to the
ch38_07.htm:own files, you can use <i class="command">tar</i>, <b class="emphasis-bold">rsh</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>), and
ch38_07.htm:<b class="emphasis-bold">dd</b> (<a href="ch21_06.htm#upt3-CHP-21-SECT-6">Section 21.6</a>) to
ch38_07.htm:can use <b class="emphasis-bold">man tar</b> (<a href="ch02_01.htm#upt3-CHP-2-SECT-1">Section 2.1</a>) to refresh your memory. The command to dump
ch38_07.htm:machine's name to the remote <b class="emphasis-bold">.rhosts file</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) if
ch38_08.htm:<a href="ch38_07.htm#upt3-CHP-38-SECT-7">Section 38.7</a> about using a tape drive on a
ch38_08.htm:<p><tt class="literal">{ }</tt> <a href="ch28_04.htm#upt3-CHP-28-SECT-4">Section 28.4</a></p>
ch38_08.htm:<b class="emphasis-bold">search path</b> (<a href="ch27_06.htm#upt3-CHP-27-SECT-6">Section 27.6</a>) for the <em class="emphasis">rsh-command</em>; you
ch38_08.htm:like <b class="emphasis-bold">which</b> (<a href="ch02_06.htm#upt3-CHP-2-SECT-6">Section 2.6</a>)): 
ch38_09.htm:control system</b> (<a href="ch39_04.htm#upt3-CHP-39-SECT-4">Section 39.4</a>), but those
ch38_09.htm:(<a name="IXT-38-3016" /><a href="ch09_08.htm#upt3-CHP-9-SECT-8">Section 9.8</a>) to get
ch38_09.htm:another method. For instance, it could copy using <b class="emphasis-bold">rcp</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) or simply
ch38_09.htm:<span class="acronym">NFS</span>-mounted filesystem (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>). 
ch38_09.htm:<p><tt class="literal">||</tt> <a href="ch35_14.htm#upt3-CHP-35-SECT-14">Section 35.14</a>, <tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch38_10.htm:them</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) from the shell, so
ch38_10.htm:<p><tt class="literal">'...'</tt> <a href="ch28_14.htm#upt3-CHP-28-SECT-14">Section 28.14</a></p>
ch38_10.htm:files on the tape. The pattern supplied to <b class="emphasis-bold">egrep</b> (<a name="IXT-38-3023" /><a href="ch13_04.htm#upt3-CHP-13-SECT-4">Section 13.4</a>)
ch38_10.htm:the files from the archive. Note that these patterns are <b class="emphasis-bold">regular expressions, not wildcards</b> (<a href="ch32_02.htm#upt3-CHP-32-SECT-2">Section 32.2</a>). 
ch38_10.htm:with <b class="emphasis-bold">^ or $ characters</b> (<a href="ch32_04.htm#upt3-CHP-32-SECT-4">Section 32.4</a>), they can match anywhere in the file
ch38_10.htm:have to <a name="IXT-38-3024" /><b class="emphasis-bold">quote</b> (<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>) the
ch38_10.htm:regular expressions</b> (<a href="ch32_02.htm#upt3-CHP-32-SECT-2">Section 32.2</a>). Unlike
ch38_10.htm:<p><tt class="literal">&gt;</tt> <a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a></p>
ch38_10.htm:expression! (<a href="ch27_18.htm#upt3-CHP-27-SECT-18">Section 27.18</a> shows a situation
ch38_10.htm:<i class="command">[</i> (or <i class="command">test</i>) (<a href="ch35_26.htm#upt3-CHP-35-SECT-26">Section 35.26</a>): 
ch38_11.htm:pathnames</b> (<a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>) when you create a
ch38_11.htm:tape, you're stuck. If you use <b class="emphasis-bold">relative paths</b> (<a href="ch31_02.htm#upt3-CHP-31-SECT-2">Section 31.2</a>)
ch38_13.htm:whether <b class="emphasis-bold">BSD tar</b> (<a href="ch38_02.htm#upt3-CHP-38-SECT-2">Section 38.2</a>, <a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>) (tape
ch38_13.htm:ships out <i class="command">cpio</i> archives over <b class="emphasis-bold">the Net</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>).
ch38_13.htm:available, including <b class="emphasis-bold">GNU tar</b> (<a href="ch39_03.htm#upt3-CHP-39-SECT-3">Section 39.3</a>). 
ch38_13.htm:list of files to be archived is often specified with <b class="emphasis-bold">find</b> (<a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a>), but it
ch39_01.htm:to a tape for safety</b> (<a href="ch38_03.htm#upt3-CHP-38-SECT-3">Section 38.3</a>). In
ch39_01.htm:aware that you can use the backup program <b class="emphasis-bold">tar</b> (<a name="IXT-39-2835" /><a href="ch38_02.htm#upt3-CHP-38-SECT-2">Section 38.2</a>) to
ch39_02.htm:<p><b class="emphasis-bold">tar</b> (<a href="ch38_02.htm#upt3-CHP-38-SECT-2">Section 38.2</a>)<a name="upt3-IDXTERM-6317" /> is a
ch39_02.htm:<p>There are other options, which we cover in <a href="ch38_05.htm#upt3-CHP-38-SECT-5">Section 38.5</a>. <a href="ch38_12.htm#upt3-CHP-38-SECT-12">Section 38.12</a> has more
ch39_02.htm:<a href="ch39_03.htm#upt3-CHP-39-SECT-3">Section 39.3</a> has a lot more about GNU
ch39_02.htm:<b class="emphasis-bold">info page</b> (<a href="ch02_09.htm#upt3-CHP-2-SECT-9">Section 2.9</a>) for <i class="command">tar</i> for more details
ch39_02.htm:of the OS; some have a slightly more specific default). <a href="ch38_05.htm#upt3-CHP-38-SECT-5">Section 38.5</a> talks about using <i class="command">tar</i> in
ch39_02.htm:pathname</b> (<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>)
ch39_02.htm:<a href="ch38_11.htm#upt3-CHP-38-SECT-11">Section 38.11</a> explains and lists workarounds.
ch39_02.htm:<i class="command">tar</i> <i class="command">manpage</i> or <b class="emphasis-bold">info page</b> (<a href="ch02_09.htm#upt3-CHP-2-SECT-9">Section 2.9</a>) and
ch39_03.htm:<p><a href="ch15_07.htm#upt3-CHP-15-SECT-7">Section 15.7</a> describes how to
ch39_03.htm:absolute pathnames</b> (<a href="ch38_11.htm#upt3-CHP-38-SECT-11">Section 38.11</a>). GNU
ch39_04.htm:(<a name="IXT-39-2857" /><a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>) listings of
ch39_04.htm:how you ever did without them. <a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>
ch39_04.htm:explains how to protect your files with RCS. See <a href="ch39_07.htm#upt3-CHP-39-SECT-7">Section 39.7</a> for an introduction to CVS.
ch39_05.htm:functions</b> (<a href="ch29_01.htm#upt3-CHP-29-SECT-1">Section 29.1</a>) with names like
ch39_05.htm:more). <a href="ch13_07.htm#upt3-CHP-13-SECT-7">Section 13.7</a> and <a href="ch39_06.htm#upt3-CHP-39-SECT-6">Section 39.6</a> explain tools for searching RCS files.
ch39_05.htm:<a href="ch39_07.htm#upt3-CHP-39-SECT-7">Section 39.7</a>, which discusses CVS. CVS is
ch39_06.htm:that are stored in an <b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>) file. For instance:
ch39_06.htm:(<a name="IXT-39-2882" /><a href="ch13_07.htm#upt3-CHP-13-SECT-7">Section 13.7</a>) uses
ch39_06.htm:in a <b class="emphasis-bold">loop</b> (<a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a>). The shell loop below gets all the revision
ch39_06.htm:(<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>) to send each revision to the <b class="emphasis-bold">pr -h</b> (<a href="ch45_06.htm#upt3-CHP-45-SECT-6">Section 45.6</a>) command
ch39_06.htm:<p><tt class="literal">'...'</tt> <a href="ch27_14.htm#upt3-CHP-27-SECT-14">Section 28.14</a>, <tt class="literal">&gt;</tt> <a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 27.12</a></p>
ch39_06.htm:(<a href="ch12_12.htm#upt3-CHP-12-SECT-12">Section 12.12</a>) to grab the two highest revision
ch39_06.htm:numbers from the <i class="command">rcsrevs</i> output, <b class="emphasis-bold">tail -r</b> (<a href="ch12_09.htm#upt3-CHP-12-SECT-9">Section 12.9</a>) to
ch39_06.htm:Then run <i class="command">rcsdiff</i><a name="IXT-39-2886" /> to do the comparisons and <b class="emphasis-bold">email</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) them to
ch39_06.htm:<p><tt class="literal">?</tt> <a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a></p>
ch39_07.htm:working together on a common set of files. Where <b class="emphasis-bold">RCS</b> (<a href="ch39_05.htm#upt3-CHP-39-SECT-5">Section 39.5</a>) deals only
ch39_07.htm:<b class="emphasis-bold">diff</b> (<a href="ch11_01.htm#upt3-CHP-11-SECT-1">Section 11.1</a>).
ch39_08.htm:in a <b class="emphasis-bold">shell setup file</b> (<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>), I need to set an <b class="emphasis-bold">environment variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>) named
ch39_08.htm:<p><tt class="literal">!$</tt> <a href="ch30_03.htm#upt3-CHP-30-SECT-3">Section 30.3</a></p>
ch40_08.htm:HTTP, HTTPS, and FTP</b> (<a href="ch40_08.htm#upt3-CHP-40-SECT-8">Section 40.8</a>). It
ch40_10.htm:<b class="emphasis-bold">tar</b> (<a href="ch15_07.htm#upt3-CHP-15-SECT-7">Section 15.7</a>)
ch41_01.htm:that can be accessed through the <b class="emphasis-bold">perldoc</b> (<a href="ch41_10.htm#upt3-CHP-41-SECT-10">Section 41.10</a>) system.
ch41_02.htm:later in <a href="ch41_11.htm#upt3-CHP-41-SECT-11">Section 41.11</a>.
ch41_03.htm:Network</b><a name="IXT-41-2461" /><a name="IXT-41-2462" /> <b class="emphasis-bold">(CPAN)</b> (<a href="ch41_11.htm#upt3-CHP-41-SECT-11">Section 41.11</a>). You can
ch41_04.htm:(<a name="IXT-41-2482" /><a name="IXT-41-2483" /><a name="IXT-41-2484" /><a href="ch41_10.htm#upt3-CHP-41-SECT-10">Section 41.10</a>), scripts
ch41_04.htm:<a name="IXT-41-2485" /> <a name="IXT-41-2486" /><b class="emphasis-bold">@INC</b> (<a href="ch41_02.htm#upt3-CHP-41-SECT-2">Section 41.2</a>) for these
ch41_04.htm:both to get at values that are pointed to by <b class="emphasis-bold">references</b> (<a name="IXT-41-2509" /><a href="ch41_05.htm#upt3-CHP-41-SECT-5.4">Section 41.5.4</a>) and to make
ch41_05.htm:<b class="emphasis-bold">while</b> (<a href="ch41_07.htm#upt3-CHP-41-SECT-7">Section 41.7</a>)
ch41_05.htm:(<a name="IXT-41-2598" /><a name="IXT-41-2599" /><a href="ch41_07.htm#upt3-CHP-41-SECT-7">Section 41.7</a>). Although
ch41_08.htm:available through <b class="emphasis-bold">modules</b> (<a href="ch41_09.htm#upt3-CHP-41-SECT-9">Section 41.9</a>). In fact, there are too many Unix-like
ch41_09.htm:system</b> (<a href="ch41_11.htm#upt3-CHP-41-SECT-11">Section 41.11</a>) before you can use
ch41_09.htm:<b class="emphasis-bold">reference operator</b> (<a href="ch41_05.htm#upt3-CHP-41-SECT-5.4">Section 41.5.4</a>) <tt class="literal">\</tt>. Without a passed
ch41_09.htm:use <b class="emphasis-bold"> perldoc modulename</b> (<a href="ch41_10.htm#upt3-CHP-41-SECT-10">Section 41.10</a>) to the module's
ch41_09.htm:programmer's sleeve is the <b class="emphasis-bold">Comprehensive Perl Archive Network</b> (<a href="ch41_11.htm#upt3-CHP-41-SECT-11">Section 41.11</a>) (CPAN), which is the central repository for
ch41_11.htm:<a href="ch41_03.htm#upt3-CHP-41-SECT-3">Section 41.3</a>. If the tests all succeed, change to
ch41_12.htm:<b class="emphasis-bold">Perl</b> (<a href="ch41_01.htm#upt3-CHP-41-SECT-1">Section 41.1</a>),
ch41_12.htm:(<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) messages always use a blank
ch41_13.htm:module</b> (<a href="ch41_11.htm#upt3-CHP-41-SECT-11">Section 41.11</a>) like this:
ch42_04.htm:<p><b class="emphasis-bold">urllib</b> (<a name="IXT-42-2412" /><a name="IXT-42-2413" /><a href="ch42_05.htm#upt3-CHP-42-SECT-5">Section 42.5</a>) provides basic functions for opening and
ch42_04.htm:<p><b class="emphasis-bold">urllib2</b> (<a name="IXT-42-2414" /><a name="IXT-42-2415" /><a href="ch42_06.htm#upt3-CHP-42-SECT-6">Section 42.6</a>) provides an extended, extensible interface
ch42_04.htm:<p><b class="emphasis-bold">htmllib</b><a name="IXT-42-2416" /><a name="IXT-42-2417" /> and <b class="emphasis-bold">HTMLParser</b> (<a href="ch42_07.htm#upt3-CHP-42-SECT-7">Section 42.7</a>)
ch42_04.htm:<p><b class="emphasis-bold">cgi</b> (<a href="ch42_08.htm#upt3-CHP-42-SECT-8">Section 42.8</a>)
ch42_04.htm:(<a name="IXT-42-2420" /><a name="IXT-42-2421" /><a name="IXT-42-2422" /><a href="ch42_09.htm#upt3-CHP-42-SECT-9">Section 42.9</a>) is an
ch42_05.htm:client activities is through modules called <b class="emphasis-bold">urllib and urllib2</b> (<a href="ch42_06.htm#upt3-CHP-42-SECT-6">Section 42.6</a>). <tt class="literal">urllib</tt> is the simple web
ch42_06.htm:(<a href="ch42_05.htm#upt3-CHP-42-SECT-5">Section 42.5</a>). Underneath, however,
ch43_01.htm:(<a name="IXT-43-2233" /><a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>). To
ch43_01.htm:to a file. As we said, Unix is <b class="emphasis-bold">file-based</b> (<a href="ch01_19.htm#upt3-CHP-1-SECT-19">Section 1.19</a>).
ch43_01.htm:<p><a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>
ch43_01.htm:<em class="emphasis">c</em> (see <a href="ch27_16.htm#upt3-CHP-27-SECT-16">Section 27.16</a>)
ch43_01.htm:<p>We'll discuss commands like this in <a href="ch43_03.htm#upt3-CHP-43-SECT-3">Section 43.3</a> and <a href="ch43_05.htm#upt3-CHP-43-SECT-5">Section 43.5</a>.
ch43_01.htm:Bourne shell</b> (<a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>).
ch43_01.htm:(<a name="IXT-43-2244" /><a href="ch20_11.htm#upt3-CHP-20-SECT-11">Section 20.11</a>), support
ch43_01.htm:those are <b class="emphasis-bold">symbolic links</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) to <em class="emphasis">/proc/self/fd/0</em>,
ch43_02.htm:<p><tt class="literal">cat</tt> <a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a></p>
ch43_02.htm:<a name="IXT-43-2254" /><b class="emphasis-bold">&lt; character</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>):
ch43_03.htm:command in a <b class="emphasis-bold">subshell</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>). The standard output of the command is
ch43_03.htm:outside the subshell is the standard error; the <b class="emphasis-bold">|&amp; operator</b> (<a href="ch43_05.htm#upt3-CHP-43-SECT-5">Section 43.5</a>)
ch43_03.htm:redirects it (along with the empty standard output) to the <b class="emphasis-bold">mail</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) program:
ch43_03.htm:(<a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>) as the
ch43_03.htm:the <b class="emphasis-bold">more complicated syntax</b> (<a href="ch36_16.htm#upt3-CHP-36-SECT-16">Section 36.16</a>). Here's how to run your
ch43_04.htm:(<a href="ch12_03.htm#upt3-CHP-12-SECT-3">Section 12.3</a>) can be mighty handy. But piping to a
ch43_04.htm:and <em class="emphasis">gail/.cshrc</em> are <b class="emphasis-bold">read-protected</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>).
ch43_04.htm:<i class="command">grep</i> writes its errors to the <b class="emphasis-bold">standard error</b> (<a name="IXT-43-2270" /><a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>)! But both
ch43_05.htm:<p><tt class="literal">make</tt> <a href="ch11_10.htm#upt3-CHP-11-SECT-10">Section 11.10</a></p>
ch43_05.htm:<b class="emphasis-bold">tail -f</b> (<a name="IXT-43-2279" /><a href="ch12_10.htm#upt3-CHP-12-SECT-10">Section 12.10</a>). If you don't want the
ch43_05.htm:<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>.
ch43_05.htm:background or on another computer and <b class="emphasis-bold">mailing</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) any
ch43_06.htm:output</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>).
ch43_06.htm:variable, so any new shells you create <b class="emphasis-bold">won't inherit it</b> (<a href="ch35_09.htm#upt3-CHP-35-SECT-9">Section 35.9</a>). Therefore, if you want this feature, put the
ch43_06.htm:(<a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>).
ch43_06.htm:redirecting standard output to <b class="emphasis-bold">/dev/null</b> (<a href="ch43_12.htm#upt3-CHP-43-SECT-12">Section 43.12</a>) or to
ch43_07.htm:(<a href="ch24_04.htm#upt3-CHP-24-SECT-4">Section 24.4</a>) that, in effect,
ch43_07.htm:<p><tt class="literal">echo</tt> <a href="ch27_05.htm#upt3-CHP-27-SECT-5">Section 27.5</a></p>
ch43_07.htm:entire sequence of commands separated by <b class="emphasis-bold">semicolons (;)</b> (<a href="ch28_16.htm#upt3-CHP-28-SECT-16">Section 28.16</a>)
ch43_07.htm:active shell's current directory</b> (<a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>): 
ch43_08.htm:<b class="emphasis-bold">tail -f</b> (<a href="ch12_10.htm#upt3-CHP-12-SECT-10">Section 12.10</a>). Or use a program like <b class="emphasis-bold">script</b> (<a href="ch37_07.htm#upt3-CHP-37-SECT-7">Section 37.7</a>).
ch43_09.htm:<p>The <b class="emphasis-bold">tee</b> (<a href="ch43_08.htm#upt3-CHP-43-SECT-8">Section 43.8</a>) command <a name="IXT-43-2302" /><a name="IXT-43-2303" />writes its standard input to a file
ch43_09.htm:<p><tt class="literal">&gt;</tt> <a href="ch28_12.htm#upt3-CHP-28-SECT-12">Section 28.12</a></p>
ch43_09.htm:operators</b> (<a href="ch43_07.htm#upt3-CHP-43-SECT-7">Section 43.7</a>) collect the
ch43_10.htm:<tt class="literal">%%Pages</tt>: at the end of the file. Using <b class="emphasis-bold">bzcat</b> (<a href="ch15_06.htm#upt3-CHP-15-SECT-6">Section 15.6</a>) to
ch43_10.htm:commands into a <b class="emphasis-bold">for loop</b> (<a href="ch28_09.htm#upt3-CHP-28-SECT-9">Section 28.9</a>) (or put them into a shell script). This loop
ch43_10.htm:<p><tt class="literal">-n</tt> <a href="ch34_03.htm#upt3-CHP-34-SECT-3">Section 34.3</a></p>
ch43_10.htm:<p><a name="IXT-43-2308" /><a name="IXT-43-2309" />Using process substitution and <b class="emphasis-bold">tee</b> (<a href="ch43_08.htm#upt3-CHP-43-SECT-8">Section 43.8</a>), I can do
ch43_10.htm:CD-ROM [see <a href="http://examples.oreilly.com/upt3">http://examples.oreilly.com/upt3</a>]. <i class="command">tpipe</i> is similar to <b class="emphasis-bold">tee</b> (<a href="ch43_08.htm#upt3-CHP-43-SECT-8">Section 43.8</a>), but
ch43_10.htm:<p>You can also simulate <i class="command">tpipe</i> by using <b class="emphasis-bold">awk</b> (<a href="ch20_10.htm#upt3-CHP-20-SECT-10">Section 20.10</a>). Write a
ch43_11.htm:like a file. It has a filename and <b class="emphasis-bold">permissions</b> (<a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a>),
ch43_11.htm:mode like <b class="emphasis-bold">chmod</b> (<a href="ch50_05.htm#upt3-CHP-50-SECT-5">Section 50.5</a>) uses. To remove a <span class="acronym">FIFO</span>,
ch43_11.htm:<b class="emphasis-bold">xterm</b> (<a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>)); you'll write to the
ch43_11.htm:<b class="emphasis-bold">background</b> (<a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a>) and run the reading process in the
ch43_11.htm:writing process. If it does, and if your system has <b class="emphasis-bold">job control</b> (<a href="ch23_03.htm#upt3-CHP-23-SECT-3">Section 23.3</a>), do
ch43_11.htm:<p><tt class="literal">-F</tt> <a href="ch08_10.htm#upt3-CHP-8-SECT-10">Section 8.10</a></p>
ch43_11.htm:<b class="emphasis-bold">cat</b> (<a href="ch12_02.htm#upt3-CHP-12-SECT-2">Section 12.2</a>)
ch43_11.htm:<span class="acronym">FIFO</span>, here's a little <b class="emphasis-bold">shell script</b> (<a href="ch35_01.htm#upt3-CHP-35-SECT-1">Section 35.1</a>)
ch43_11.htm:<p><tt class="literal">while</tt> <a href="ch35_15.htm#upt3-CHP-35-SECT-15">Section 35.15</a>,
ch43_11.htm:<tt class="literal">sleep</tt> <a href="ch24_09.htm#upt3-CHP-24-SECT-9">Section 24.9</a></p>
ch43_11.htm:program, like the <b class="emphasis-bold">pr</b> (<a href="ch45_06.htm#upt3-CHP-45-SECT-6">Section 45.6</a>) formatter with its <span class="option">-l15</span>
ch43_11.htm:see when <b class="emphasis-bold">tail</b> (<a href="ch12_08.htm#upt3-CHP-12-SECT-8">Section 12.8</a>) reads from a pipe or <span class="acronym">FIFO</span>?
ch43_12.htm:top of" the other file (<a href="ch15_02.htm#upt3-CHP-15-SECT-2">Section 15.2</a>). 
ch43_12.htm:<p>That <b class="emphasis-bold">redirects</b> (<a href="ch43_01.htm#upt3-CHP-43-SECT-1">Section 43.1</a>) standard output but leaves standard error
ch43_12.htm:<b class="emphasis-bold">yes</b> (<a href="ch14_05.htm#upt3-CHP-14-SECT-5">Section 14.5</a>).)
ch43_12.htm:instance, the <b class="emphasis-bold">grep</b> (<a href="ch13_01.htm#upt3-CHP-13-SECT-1">Section 13.1</a>) programs won't give the name
ch43_12.htm:one</b> (<a href="ch09_21.htm#upt3-CHP-9-SECT-21">Section 9.21</a>):
ch43_12.htm:<p><a href="ch15_03.htm#upt3-CHP-15-SECT-3">Section 15.3</a> shows even more uses for
ch43_12.htm:(<a href="ch12_12.htm#upt3-CHP-12-SECT-12">Section 12.12</a>) will give you a stop!):<a href="#FOOTNOTE-133">[133]</a>
ch43_12.htm:<p><tt class="literal">od</tt> <a href="ch12_04.htm#upt3-CHP-12-SECT-4">Section 12.4</a></p>
ch44_01.htm:and <b class="emphasis-bold">disks</b> (<a href="ch44_04.htm#upt3-CHP-44-SECT-4">Section 44.4</a>, <a href="ch44_05.htm#upt3-CHP-44-SECT-5">Section 44.5</a>), <b class="emphasis-bold">CD-ROMs</b> (<a href="ch44_06.htm#upt3-CHP-44-SECT-6">Section 44.6</a>),
ch44_01.htm:<b class="emphasis-bold">ethernet cards</b> (<a href="ch44_08.htm#upt3-CHP-44-SECT-8">Section 44.8</a>), <b class="emphasis-bold">modems</b>
ch44_01.htm:(<a href="ch44_10.htm#upt3-CHP-44-SECT-10">Section 44.10</a>), <b class="emphasis-bold">sound
ch44_01.htm:cards</b> (<a href="ch44_13.htm#upt3-CHP-44-SECT-13">Section 44.13</a>), and so on. Each
ch44_01.htm:<b class="emphasis-bold">ifconfig</b> (<a href="ch44_08.htm#upt3-CHP-44-SECT-8">Section 44.8</a>) for <b class="emphasis-bold">network
ch44_01.htm:devices</b> (<a href="ch44_06.htm#upt3-CHP-44-SECT-6">Section 44.6</a>, <a href="ch44_07.htm#upt3-CHP-44-SECT-7">Section 44.7</a>), <b class="emphasis-bold">mount</b>
ch44_01.htm:(<a href="ch44_09.htm#upt3-CHP-44-SECT-9">Section 44.9</a>) for disks and so forth.
ch44_04.htm:and in <b class="emphasis-bold">/etc/fstab</b> (<a href="ch44_05.htm#upt3-CHP-44-SECT-5">Section 44.5</a>). 
ch44_05.htm:<b class="emphasis-bold">manually mounted</b> (<a href="ch44_06.htm#upt3-CHP-44-SECT-6">Section 44.6</a>)) and a standard <em class="emphasis">procfs</em>.
ch44_07.htm:(<a href="ch44_04.htm#upt3-CHP-44-SECT-4">Section 44.4</a>)). This allows mounting a file as if it
ch44_07.htm:size (this is effectively creating a <b class="emphasis-bold">partition</b> (<a href="ch44_04.htm#upt3-CHP-44-SECT-4">Section 44.4</a>) -- in this case, a 100 megabyte image.
ch44_11.htm:connection -- you can use <b class="emphasis-bold">ifconfig</b> (<a href="ch44_08.htm#upt3-CHP-44-SECT-8">Section 44.8</a>, <a href="ch46_03.htm#upt3-CHP-46-SECT-3">Section 46.3</a>) to examine it and packets will be routed to
ch44_11.htm:the PPP connection by default, and tools like <b class="emphasis-bold">traceroute</b> (<a href="ch46_04.htm#upt3-CHP-46-SECT-4">Section 46.4</a>) can
ch44_11.htm:ISP's <b class="emphasis-bold">DNS</b> (<a href="ch46_09.htm#upt3-CHP-46-SECT-9">Section 46.9</a>) server. Some implementations of
ch44_12.htm:modules</b> (<a href="ch44_03.htm#upt3-CHP-44-SECT-3">Section 44.3</a>) loaded (and on many
ch45_01.htm:<p>The first few articles in this chapter, <a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>,
ch45_01.htm:<a href="ch45_03.htm#upt3-CHP-45-SECT-3">Section 45.3</a>, <a href="ch45_04.htm#upt3-CHP-45-SECT-4">Section 45.4</a>, and <a href="ch45_05.htm#upt3-CHP-45-SECT-5">Section 45.5</a>, discuss the basic Unix spooling system and
ch45_01.htm:line-printer emulation mode. <a href="ch45_06.htm#upt3-CHP-45-SECT-6">Section 45.6</a>
ch45_01.htm:describes this kind of simple formatting, and <a href="ch45_07.htm#upt3-CHP-45-SECT-7">Section 45.7</a> gets a little more complicated on the same
ch45_01.htm:PostScript. They're discussed in <a href="ch45_10.htm#upt3-CHP-45-SECT-10">Section 45.10</a> through <a href="ch45_17.htm#upt3-CHP-45-SECT-17">Section 45.17</a>, along
ch45_01.htm:<p>Finally, <a href="ch45_19.htm#upt3-CHP-45-SECT-19">Section 45.19</a> is about the
ch45_02.htm:command <b class="emphasis-bold">lpc status</b> (<a href="ch45_03.htm#upt3-CHP-45-SECT-3">Section 45.3</a>) can be used to determine which printers are
ch45_02.htm:variable</b> (<a href="ch45_04.htm#upt3-CHP-45-SECT-4">Section 45.4</a>).
ch45_02.htm:variable</b> (<a href="ch45_04.htm#upt3-CHP-45-SECT-4">Section 45.4</a>).
ch45_03.htm:<p><a name="IXT-45-1768" /><a name="IXT-45-1769" />The printer <b class="emphasis-bold">daemon</b> (<a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>) watches
ch45_03.htm:the queue for jobs that people submit with <b class="emphasis-bold">lpr</b> (<a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>). If
ch45_04.htm:includes <b class="emphasis-bold">lpr</b> (<a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>), various scripts to format typeset documents,
ch45_04.htm:variable</b> (<a href="ch35_03.htm#upt3-CHP-35-SECT-3">Section 35.3</a>); if
ch45_05.htm:<b class="emphasis-bold">symbolic link</b> (<a href="ch10_04.htm#upt3-CHP-10-SECT-4">Section 10.4</a>) to your file from the spooling directory.
ch45_05.htm:troff file</b> (<a href="ch45_16.htm#upt3-CHP-45-SECT-16">Section 45.16</a>) for a PostScript
ch45_06.htm:<p><a name="upt3-IDXTERM-7227" /> <a name="upt3-IDXTERM-7228" /> <a name="upt3-IDXTERM-7229" />The <b class="emphasis-bold">line printer spooler</b> (<a href="ch45_02.htm#upt3-CHP-45-SECT-2">Section 45.2</a>) prints what you send it. If you send it a
ch45_06.htm:<a href="ch21_15.htm#upt3-CHP-21-SECT-15">Section 21.15</a>.
ch45_06.htm:chopped to fit. See <a href="ch21_15.htm#upt3-CHP-21-SECT-15">Section 21.15</a>. This is a
ch45_06.htm:(<a href="ch21_18.htm#upt3-CHP-21-SECT-18">Section 21.18</a>).
ch45_06.htm:See <a href="ch21_15.htm#upt3-CHP-21-SECT-15">Section 21.15</a>.
ch45_06.htm:(<a href="ch12_13.htm#upt3-CHP-12-SECT-13">Section 12.13</a>).
ch45_06.htm:carriage-return character to be read from <b class="emphasis-bold">/dev/tty</b> (<a href="ch36_15.htm#upt3-CHP-36-SECT-15">Section 36.15</a>).)
ch45_06.htm:<b class="emphasis-bold">cat -n</b> (<a href="ch12_13.htm#upt3-CHP-12-SECT-13">Section 12.13</a>) to supply the line numbers:
ch45_09.htm:However, <i class="command">lpd</i><a name="IXT-45-1803" /><a name="IXT-45-1804" /> does know how to <b class="emphasis-bold">run files through a filter</b> (<a href="ch45_17.htm#upt3-CHP-45-SECT-17">Section 45.17</a>). So what we'll do is provide
ch45_10.htm:complex languages</b> (<a href="ch45_14.htm#upt3-CHP-45-SECT-14">Section 45.14</a>) to print,
ch45_10.htm:text</b> (<a href="ch45_07.htm#upt3-CHP-45-SECT-7">Section 45.7</a>) so it could be
ch45_10.htm:<p>What we will try to cover are formatting languages (<a href="ch45_12.htm#upt3-CHP-45-SECT-12">Section 45.12</a> and <a href="ch45_13.htm#upt3-CHP-45-SECT-13">Section 45.13</a>), printer
ch45_10.htm:languages (<a href="ch45_14.htm#upt3-CHP-45-SECT-14">Section 45.14</a>), and ways to use
ch45_10.htm:(<a href="ch45_15.htm#upt3-CHP-45-SECT-15">Section 45.15</a> through <a href="ch45_17.htm#upt3-CHP-45-SECT-17">Section 45.17</a>). 
ch45_10.htm:OpenOffice, <a href="ch45_18.htm#upt3-CHP-45-SECT-18">Section 45.18</a> might help.
ch45_13.htm:<p><a name="IXT-45-1817" /> <a name="IXT-45-1818" /><a href="ch45_12.htm#upt3-CHP-45-SECT-12">Section 45.12</a> shows an example of a
ch45_15.htm:<p><a name="IXT-45-1843" /><a name="IXT-45-1844" /><a href="ch45_07.htm#upt3-CHP-45-SECT-7">Section 45.7</a> introduced one tool that can convert plain
ch45_15.htm:<i class="command">a2ps</i> and <b class="emphasis-bold">enscript</b> (<a href="ch45_07.htm#upt3-CHP-45-SECT-7">Section 45.7</a>) can do what you need. If your printer
ch45_15.htm:to get that output to go to the printer properly. <a href="ch45_17.htm#upt3-CHP-45-SECT-17">Section 45.17</a> shows how to arrange for most of that to be
ch45_16.htm:<p><a name="IXT-45-1846" /><a name="IXT-45-1847" /><a href="ch45_15.htm#upt3-CHP-45-SECT-15">Section 45.15</a> showed the steps necessary to convert plain text into something
ch45_16.htm:<a href="ch45_15.htm#upt3-CHP-45-SECT-15">Section 45.15</a>, because the default options all do what we want. Even
ch45_16.htm:so, it can be made even simpler; <a href="ch45_17.htm#upt3-CHP-45-SECT-17">Section 45.17</a>
ch45_17.htm:<p><a name="IXT-45-1849" /> <a name="IXT-45-1850" /><a href="ch45_15.htm#upt3-CHP-45-SECT-15">Section 45.15</a>
ch45_17.htm:and <a href="ch45_16.htm#upt3-CHP-45-SECT-16">Section 45.16</a> showed what sorts of steps are
ch45_17.htm:<p>In <a href="ch45_09.htm#upt3-CHP-45-SECT-9">Section 45.9</a>, we used an input filter
ch45_19.htm:(<a href="ch01_22.htm#upt3-CHP-1-SECT-22">Section 1.22</a>) bitmaps out of pictures in newspapers
ch45_19.htm:<em class="emphasis">PICT</em> format. Then I <b class="emphasis-bold">ftp</b> (<a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a>) the file to
ch46_01.htm:(<a name="IXT-46-453" /><a name="IXT-46-454" /><a href="ch46_01.htm#upt3-CHP-46-SECT-1">Section 46.1</a>). When you
ch46_01.htm:telnet, HTTP servers and web browsers, <b class="emphasis-bold">SSH</b> (<a href="ch46_06.htm#upt3-CHP-46-SECT-6">Section 46.6</a>), and
ch46_01.htm:<b class="emphasis-bold">email</b> (<a href="ch46_08.htm#upt3-CHP-46-SECT-8">Section 46.8</a>). 
ch46_01.htm:broadcast. Services like <b class="emphasis-bold">DNS</b> (<a href="ch46_09.htm#upt3-CHP-46-SECT-9">Section 46.9</a>) and <b class="emphasis-bold">DHCP</b>
ch46_01.htm:(<a href="ch46_10.htm#upt3-CHP-46-SECT-10">Section 46.10</a>) use UDP rather than TCP, as do many
ch46_01.htm:the like. <b class="emphasis-bold">/etc/services</b> (<a href="ch46_02.htm#upt3-CHP-46-SECT-2">Section 46.2</a>) lists most of the well-known ports used by
ch46_01.htm:<b class="emphasis-bold">ping and traceroute</b> (<a href="ch46_04.htm#upt3-CHP-46-SECT-4">Section 46.4</a>) to diagnose problems, check network status,
ch46_02.htm:the top of your head. <b class="emphasis-bold">SMTP</b> (<a href="ch46_08.htm#upt3-CHP-46-SECT-8">Section 46.8</a>) is port 25, HTTP is port 80, and so on.
ch46_03.htm:(<a name="IXT-46-474" /><a name="IXT-46-475" /><a name="IXT-46-476" /><a href="ch44_08.htm#upt3-CHP-44-SECT-8">Section 44.8</a>), but it also can be used to see the current
ch46_03.htm:can <b class="emphasis-bold">ping</b> (<a href="ch46_04.htm#upt3-CHP-46-SECT-4">Section 46.4</a>) other machines on your local network, but you
ch46_03.htm:point to your <b class="emphasis-bold">gateway</b> (<a href="ch46_11.htm#upt3-CHP-46-SECT-11">Section 46.11</a>). For a private LAN running <b class="emphasis-bold">NAT</b> (<a href="ch46_11.htm#upt3-CHP-46-SECT-11">Section 46.11</a>), your
ch46_03.htm:<b class="emphasis-bold">DNS</b> (<a href="ch46_09.htm#upt3-CHP-46-SECT-9">Section 46.9</a>)
ch46_04.htm:<i class="command">ping</i> sends one or more <b class="emphasis-bold">ICMP</b> (<a href="ch46_01.htm#upt3-CHP-46-SECT-1">Section 46.1</a>) Echo
ch46_04.htm:you know you don't have a <b class="emphasis-bold">firewall</b> (<a href="ch46_12.htm#upt3-CHP-46-SECT-12">Section 46.12</a>)
ch46_04.htm:trying anything more complex; start looking for <b class="emphasis-bold">interfaces down or routing problems</b> (<a href="ch46_03.htm#upt3-CHP-46-SECT-3">Section 46.3</a>) or, possibly, unplugged cables or the like.
ch46_05.htm:(<a href="ch46_01.htm#upt3-CHP-46-SECT-1">Section 46.1</a>) and start up the appropriate server
ch46_05.htm:<b class="emphasis-bold">firewall</b> (<a href="ch46_12.htm#upt3-CHP-46-SECT-12">Section 46.12</a>), as it provides extra security by
ch46_05.htm:into your machine. As an example, my home firewall allows <b class="emphasis-bold">SMTP</b> (<a href="ch46_08.htm#upt3-CHP-46-SECT-8">Section 46.8</a>) and
ch46_05.htm:<b class="emphasis-bold">SSH</b> (<a href="ch46_06.htm#upt3-CHP-46-SECT-6">Section 46.6</a>)
ch46_05.htm:resolved</b> (<a href="ch46_09.htm#upt3-CHP-46-SECT-9">Section 46.9</a>), thus requiring a
ch46_06.htm:mode, <i class="command">telnet</i> connects to an <b class="emphasis-bold">inetd</b> (<a href="ch46_05.htm#upt3-CHP-46-SECT-5">Section 46.5</a>)-managed
ch46_08.htm:(<a name="IXT-46-550" /><a href="ch46_09.htm#upt3-CHP-46-SECT-9">Section 46.9</a>) for your
ch46_09.htm:address</b> (<a name="IXT-46-560" /><a name="IXT-46-561" /><a href="ch46_01.htm#upt3-CHP-46-SECT-1">Section 46.1</a>).
ch46_09.htm:<b class="emphasis-bold">mail</b> (<a href="ch46_08.htm#upt3-CHP-46-SECT-8">Section 46.8</a>).
ch46_09.htm:(<a name="IXT-46-571" /><a href="ch46_03.htm#upt3-CHP-46-SECT-3">Section 46.3</a>) for anything more complicated than a quick
ch46_10.htm:server. <a href="ch46_11.htm#upt3-CHP-46-SECT-11">Section 46.11</a> describes NAT, which can
ch46_11.htm:(<a name="IXT-46-599" /><a href="ch46_12.htm#upt3-CHP-46-SECT-12">Section 46.12</a>);
ch46_11.htm:correct private addresses on the way back in. If you use <b class="emphasis-bold">DHCP</b> (<a name="IXT-46-605" /><a href="ch46_10.htm#upt3-CHP-46-SECT-10">Section 46.10</a>) to configure
ch46_11.htm:(<a name="IXT-46-612" /><a href="ch44_03.htm#upt3-CHP-44-SECT-3">Section 44.3</a>)
ch46_12.htm:(<a name="IXT-46-615" /><a name="IXT-46-616" /><a href="ch46_11.htm#upt3-CHP-46-SECT-11">Section 46.11</a>)
ch46_12.htm:(<a name="IXT-46-618" /><a href="ch46_01.htm#upt3-CHP-46-SECT-1">Section 46.1</a>) it is
ch46_12.htm:(<a href="ch46_08.htm#upt3-CHP-46-SECT-8">Section 46.8</a>) port) on the mail server machine,
ch46_12.htm:machine, and port 22 (the <b class="emphasis-bold">SSH</b> (<a href="ch46_06.htm#upt3-CHP-46-SECT-6">Section 46.6</a>) port) on any server that should be able to
ch46_13.htm:configure one Unix machine as a <b class="emphasis-bold">gateway</b> (<a href="ch46_11.htm#upt3-CHP-46-SECT-11">Section 46.11</a>), with
ch46_13.htm:(<a name="IXT-46-626" /><a href="ch44_11.htm#upt3-CHP-44-SECT-11">Section 44.11</a>), turn
ch46_13.htm:on PPP's <b class="emphasis-bold">NAT</b> (<a href="ch46_11.htm#upt3-CHP-46-SECT-11">Section 46.11</a>) handling and then <b class="emphasis-bold">turn
ch46_13.htm:on gatewaying</b> (<a href="ch46_11.htm#upt3-CHP-46-SECT-11">Section 46.11</a>). Make sure
ch46_13.htm:gateway (handing out addresses via <b class="emphasis-bold">DHCP</b> (<a href="ch46_10.htm#upt3-CHP-46-SECT-10">Section 46.10</a>) is an easy
ch47_02.htm:wish to use the web administration tool <b class="emphasis-bold">SWAT</b> (<a name="IXT-47-1992" /><a href="ch47_04.htm#upt3-CHP-47-SECT-4">Section 47.4</a>) to
ch47_02.htm:talked about in more detail in <a href="ch47_06.htm#upt3-CHP-47-SECT-6">Section 47.6</a>. For now,
ch47_02.htm:writable by SMB clients that are able to <b class="emphasis-bold">connect</b> (<a href="ch47_06.htm#upt3-CHP-47-SECT-6">Section 47.6</a>). When
ch47_08.htm:creates a private network on your machine so that, with <b class="emphasis-bold">Samba</b> (<a href="ch47_02.htm#upt3-CHP-47-SECT-2">Section 47.2</a>), you can
ch48_01.htm:<b class="emphasis-bold">security checklist</b> (<a href="ch48_02.htm#upt3-CHP-48-SECT-2">Section 48.2</a>). 
ch48_02.htm:<b class="emphasis-bold">security alerts</b> (<a href="ch48_03.htm#upt3-CHP-48-SECT-3">Section 48.3</a>), where to get security patches for your
ch48_02.htm:(<a name="IXT-48-1887" /><a href="ch50_05.htm#upt3-CHP-50-SECT-5">Section 50.5</a>) on a file:
ch48_02.htm:(<a name="IXT-48-1888" /><a href="ch48_05.htm#upt3-CHP-48-SECT-5">Section 48.5</a>).
ch48_03.htm:(<a name="IXT-48-1893" /><a name="IXT-48-1894" /><a href="ch48_02.htm#upt3-CHP-48-SECT-2">Section 48.2</a>).
ch48_03.htm:most current advisory was warning about a <b class="emphasis-bold">potential buffer overflow</b> (<a href="ch48_04.htm#upt3-CHP-48-SECT-4">Section 48.4</a>) problem related to FreeBSD's
ch48_06.htm:problems. Probably the most commonly used utility is <b class="emphasis-bold">ps</b> (<a href="ch24_05.htm#upt3-CHP-24-SECT-5">Section 24.5</a>); however,
ch48_07.htm:<p>Check logfiles first, and then check for any unusual <b class="emphasis-bold">setgid</b> (<a href="ch49_05.htm#upt3-CHP-49-SECT-5">Section 49.5</a>) or
ch48_07.htm:<b class="emphasis-bold">find</b> (<a name="IXT-48-1947" /><a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a>) command. For
ch48_07.htm:<em class="filename">/etc/passwd</em> and the <b class="emphasis-bold">crontab file</b> (<a href="ch25_03.htm#upt3-CHP-25-SECT-3">Section 25.3</a>),
ch48_09.htm:<b class="emphasis-bold">ps</b> (<a href="ch49_06.htm#upt3-CHP-49-SECT-6">Section 49.6</a>)),
ch48_09.htm:point you can use <b class="emphasis-bold">cat</b> (<a href="ch11_02.htm#upt3-CHP-11-SECT-2">Section 11.2</a>) to print out the <em class="emphasis">cmdline</em>
ch48_12.htm:<p><a name="IXT-48-1965" />The same configuration and <b class="emphasis-bold">TCP wrapper</b> (<a href="ch46_05.htm#upt3-CHP-46-SECT-5">Section 46.5</a>) -- known as the Wietse
ch49_01.htm:usernames and also added to one or more Unix <b class="emphasis-bold">groups</b> (<a href="ch49_07.htm#upt3-CHP-49-SECT-7">Section 49.7</a>). Both a
ch49_08.htm:particularly C shell scripts, as discussed in <a href="ch50_09.htm#upt3-CHP-50-SECT-9">Section 50.9</a>. And since the scripts can be run by anybody,
ch49_13.htm:<p>You can temporarily disable logins by creating an entry in <b class="emphasis-bold">/etc/nologin</b><a name="IXT-49-432" /><a name="IXT-49-433" /><a name="IXT-49-434" /> (<a href="ch03_01.htm#upt3-CHP-3-SECT-1">Section 3.1</a>) and
ch50_02.htm:accessing files inside that directory. (<a href="ch10_02.htm#upt3-CHP-10-SECT-2">Section 10.2</a> has more information
ch50_02.htm:the contents of a file. (See <a href="ch50_09.htm#upt3-CHP-50-SECT-9">Section 50.9</a>.)
ch50_02.htm:you don't. (See <a href="ch50_10.htm#upt3-CHP-50-SECT-10">Section 50.10</a>.) 
ch50_02.htm:the <b class="emphasis-bold">group</b> (<a href="ch49_06.htm#upt3-CHP-49-SECT-6">Section 49.6</a>) of the file, and one set for everyone else.
ch50_02.htm:<b class="emphasis-bold">specifies the type of file</b> (<a href="ch09_13.htm#upt3-CHP-9-SECT-13">Section 9.13</a>). The first three of the nine permissions
ch50_02.htm:with three octal digits instead of nine characters. (<a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a> has diagrams of permission bits and explains
ch50_02.htm:don't apply to the <b class="emphasis-bold">superuser</b> (<a href="ch01_18.htm#upt3-CHP-1-SECT-18">Section 1.18</a>), who
ch50_02.htm:mechanism</b> (<a href="ch49_07.htm#upt3-CHP-49-SECT-7">Section 49.7</a>) to deny one group
ch50_02.htm:(<a name="IXT-50-1002" /><a href="ch50_05.htm#upt3-CHP-50-SECT-5">Section 50.5</a>) command
ch50_02.htm:letters. (See <a href="ch07_05.htm#upt3-CHP-7-SECT-5">Section 7.5</a>.)
ch50_02.htm:some <b class="emphasis-bold">aliases</b> (<a href="ch49_04.htm#upt3-CHP-49-SECT-4">Section 49.4</a>) defined:
ch50_02.htm:different names. <a href="ch31_13.htm#upt3-CHP-31-SECT-13">Section 31.13</a> shows how.
ch50_02.htm:(<a name="IXT-50-1013" /><a href="ch09_01.htm#upt3-CHP-9-SECT-1">Section 9.1</a>) three times a day and search for files owned
ch50_02.htm:<p><tt class="literal">$USER</tt><a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>, <tt class="literal">xargs</tt><a href="ch28_17.htm#upt3-CHP-28-SECT-17">Section 28.17</a>, <tt class="literal">chmod</tt><a href="ch50_05.htm#upt3-CHP-50-SECT-5">Section 50.5</a></p>
ch50_02.htm:(<a name="IXT-50-1014" /><a href="ch25_02.htm#upt3-CHP-25-SECT-2">Section 25.2</a>) to
ch50_03.htm:change file ownership</b> (<a href="ch50_14.htm#upt3-CHP-50-SECT-14">Section 50.14</a>, <a href="ch50_15.htm#upt3-CHP-50-SECT-15">Section 50.15</a>). 
ch50_03.htm:(<a href="ch50_09.htm#upt3-CHP-50-SECT-9">Section 50.9</a>).
ch50_03.htm:<p>With an editor like <b class="emphasis-bold">vi</b> (<a href="ch17_02.htm#upt3-CHP-17-SECT-2">Section 17.2</a>), the file keeps its original owner because a
ch50_03.htm:<p>An editor like <b class="emphasis-bold">Emacs</b> (<a href="ch19_01.htm#upt3-CHP-19-SECT-1">Section 19.1</a>), which makes a backup copy, can be different.
ch50_03.htm:-l</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>).
ch50_04.htm:person (see <a href="ch50_09.htm#upt3-CHP-50-SECT-9">Section 50.9</a>). Many newer
ch50_04.htm:can set its <em class="emphasis">sticky bit</em> (<b class="emphasis-bold">mode</b> (<a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a>) 1000). The
ch50_05.htm:(<a name="IXT-50-1054" /><a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a>,
ch50_05.htm:<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>), and give a command like this one:
ch50_05.htm:<p><b class="emphasis-bold">Set exactly this permission</b> (<a href="ch50_06.htm#upt3-CHP-50-SECT-6">Section 50.6</a>). 
ch50_05.htm:bit"</b> (<a href="ch50_04.htm#upt3-CHP-50-SECT-4">Section 50.4</a>, <a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a>).
ch50_05.htm:<p>(<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a> explains the
ch50_05.htm:(<a name="IXT-50-1061" /><a href="ch09_09.htm#upt3-CHP-9-SECT-9">Section 9.9</a>, <a href="ch50_06.htm#upt3-CHP-50-SECT-6">Section 50.6</a>). You won't need this often,
ch50_06.htm:owner's group. <a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>
ch50_06.htm:have <em class="emphasis">chmod -R</em>, use this <b class="emphasis-bold">find</b> (<a href="ch09_09.htm#upt3-CHP-9-SECT-9">Section 9.9</a>):
ch50_07.htm:<em class="emphasis">chmod +x</em>. <a href="ch50_08.htm#upt3-CHP-50-SECT-8">Section 50.8</a>
ch50_07.htm:(<a href="ch49_04.htm#upt3-CHP-49-SECT-4">Section 49.4</a>), you can find some file that might be
ch50_07.htm:<p><tt class="literal">"$@"</tt><a href="ch35_20.htm#upt3-CHP-35-SECT-20">Section 35.20</a>, <tt class="literal">${..=..}</tt><a href="ch36_07.htm#upt3-CHP-36-SECT-7">Section 36.7</a></p>
ch50_08.htm:(<a href="ch50_07.htm#upt3-CHP-50-SECT-7">Section 50.7</a>).
ch50_09.htm:(<a name="IXT-50-1086" /><a href="ch01_20.htm#upt3-CHP-1-SECT-20">Section 1.20</a>), and one of its nagging problems has always
ch50_09.htm:<b class="emphasis-bold">umask</b> (<a href="ch49_04.htm#upt3-CHP-49-SECT-4">Section 49.4</a>)
ch50_09.htm:correctly and using <b class="emphasis-bold">chmod</b> (<a href="ch50_05.htm#upt3-CHP-50-SECT-5">Section 50.5</a>) to fix permissions of existing directories.
ch50_09.htm:bit</b> (<a href="ch50_04.htm#upt3-CHP-50-SECT-4">Section 50.4</a>).
ch50_10.htm:<p><tt class="literal">-d</tt> <a href="ch08_05.htm#upt3-CHP-8-SECT-5">Section 8.5</a></p>
ch50_10.htm:error shown above. <a href="ch31_04.htm#upt3-CHP-31-SECT-4">Section 31.4</a> has details.)
ch50_10.htm:<p>In the example above, <em class="emphasis">toria</em> made a <b class="emphasis-bold">hard link</b> (<a href="ch10_05.htm#upt3-CHP-10-SECT-5">Section 10.5</a>) to
ch50_10.htm:keeps the file's i-number</b> (<a href="ch10_02.htm#upt3-CHP-10-SECT-2">Section 10.2</a>) but a symbolic link doesn't.
ch50_10.htm:<p>This setup can still be a little confusing. For instance, as <a href="ch31_04.htm#upt3-CHP-31-SECT-4">Section 31.4</a> explains, the <i class="command">pwd</i>
ch50_10.htm:$PWD</b> (<a href="ch35_05.htm#upt3-CHP-35-SECT-5">Section 35.5</a>) will probably have the
ch50_11.htm:the <b class="emphasis-bold">groups command</b> (<a href="ch49_06.htm#upt3-CHP-49-SECT-6">Section 49.6</a>) to find out what groups a user belongs to:
ch50_11.htm:the <b class="emphasis-bold">chgrp</b> (<a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a>) command:
ch50_11.htm:(<a href="ch49_04.htm#upt3-CHP-49-SECT-4">Section 49.4</a>) first.)
ch50_12.htm:<b class="emphasis-bold">ls -l</b> (<a href="ch50_02.htm#upt3-CHP-50-SECT-2">Section 50.2</a>), but the corrupted file could have the same
ch50_12.htm:date</b> (<a href="ch08_02.htm#upt3-CHP-8-SECT-2">Section 8.2</a>), but
ch50_12.htm:<p><tt class="literal">$?</tt> <a href="ch35_12.htm#upt3-CHP-35-SECT-12">Section 35.12</a></p>
ch50_12.htm:Some software downloading and distribution systems, like <b class="emphasis-bold">RPM</b> (<a href="ch40_11.htm#upt3-CHP-40-SECT-11">Section 40.11</a>), can do
ch50_13.htm:<p><img src="figs/bomb.gif" alt="Figure " width="24" /> <a href="ch35_17.htm#upt3-CHP-35-SECT-17">Section 35.17</a></p>
ch50_14.htm:restriction is not bogus, because the system supports <b class="emphasis-bold">disk quotas</b> (<a href="ch15_11.htm#upt3-CHP-15-SECT-11">Section 15.11</a>). If
ch50_14.htm:<p>If you need to change ownership, there is a <b class="emphasis-bold">workaround</b> (<a href="ch50_15.htm#upt3-CHP-50-SECT-15">Section 50.15</a>) that
ch50_15.htm:quotas</b> (<a href="ch15_11.htm#upt3-CHP-15-SECT-11">Section 15.11</a>) <b class="emphasis-bold">won't let you change the
ch50_15.htm:owner</b> (<a href="ch50_14.htm#upt3-CHP-50-SECT-14">Section 50.14</a>) of a file; only the
ch50_15.htm:<p><tt class="literal">-d</tt> <a href="ch08_05.htm#upt3-CHP-8-SECT-5">Section 8.5</a>, <tt class="literal">-f</tt> <a href="ch14_10.htm#upt3-CHP-14-SECT-10">Section 14.10</a></p>
ch50_15.htm:same time, <b class="emphasis-bold">su</b> (<a href="ch49_09.htm#upt3-CHP-49-SECT-9">Section 49.9</a>) is probably the fastest way to change
ch50_15.htm:(<a href="ch10_12.htm#upt3-CHP-10-SECT-12">Section 10.12</a>) command preserves the
ch51_01.htm:<p><b class="emphasis-bold">Enabling SSH</b> (<a name="upt3-IDXTERM-7980" /><a href="ch46_06.htm#upt3-CHP-46-SECT-6">Section 46.6</a>) on <a name="IXT-51-636" /><a name="IXT-51-637" />Mac OS X is fairly simple. Access the System
ch51_01.htm:file (using <b class="emphasis-bold">sudo</b> (<a href="ch49_11.htm#upt3-CHP-49-SECT-11">Section 49.11</a>) if you're logged in as a
ch51_01.htm:(<a href="ch49_07.htm#upt3-CHP-49-SECT-7">Section 49.7</a>) or login as root). Remove the pound
ch51_01.htm:restart <b class="emphasis-bold">inetd</b> (<a href="ch46_05.htm#upt3-CHP-46-SECT-5">Section 46.5</a>) by typing:
ch51_02.htm:(<a href="ch46_06.htm#upt3-CHP-46-SECT-6">Section 46.6</a>). SSH encrypts any communication
ch51_03.htm:(<a name="IXT-51-648" /><a name="IXT-51-649" /><a href="ch46_06.htm#upt3-CHP-46-SECT-6">Section 46.6</a>) is built-in. In other cases you can use
ch51_05.htm:ssh</b> (<a href="ch46_06.htm#upt3-CHP-46-SECT-6">Section 46.6</a>)<a name="IXT-51-654" />, scp, ssh-agent, ssh-keygen, etc.,
ch51_06.htm:configurationfiles</b> (<a href="ch05_03.htm#upt3-CHP-5-SECT-3">Section 6.3</a>). If you
ch51_06.htm:subshell</b>) (<a href="ch06_03.htm#upt3-CHP-6-SECT-3">Section 6.3</a>).
ch51_07.htm:<b class="emphasis-bold">client configuration file</b> (<a href="ch07_01.htm#upt3-CHP-7-SECT-1">Section 7.1</a>). Remember that multiple sections of the
gloss.htm:also</em> <a href="ch27_18.htm#upt3-CHP-27-SECT-18">Section 27.18</a>.
gloss.htm:also</em> <a href="ch07_04.htm#upt3-CHP-7-SECT-4">Section 7.4</a>.
gloss.htm:<em class="emphasis">See also</em> <a href="ch15_04.htm#upt3-CHP-15-SECT-4">Section 15.4</a>.
gloss.htm:See <a href="ch03_03.htm#upt3-CHP-3-SECT-3">Section 3.3</a>.</p>
gloss.htm:notification of incoming mail. <em class="emphasis">See also</em> <a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>.
gloss.htm:<em class="filename">.profile</em></tt>. <em class="emphasis">See also</em></tt> <a href="ch03_06.htm#upt3-CHP-3-SECT-6">Section 3.6</a>.
gloss.htm:<em class="emphasis">See also</em> <a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a>
gloss.htm:and <a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>.
gloss.htm:also</em> <a href="ch23_02.htm#upt3-CHP-23-SECT-2">Section 23.2</a>.
gloss.htm:<em class="emphasis">See also</em></tt> <a href="ch01_10.htm#upt3-CHP-1-SECT-10">Section 1.10</a>.
gloss.htm:<a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>.
gloss.htm:<em class="emphasis">See also</em> <a href="ch01_17.htm#upt3-CHP-1-SECT-17">Section 1.17</a>.
gloss.htm:also</em> <a href="ch01_21.htm#upt3-CHP-1-SECT-21">Section 1.21</a> and <a href="ch44_09.htm#upt3-CHP-44-SECT-9">Section 44.9</a>. 
gloss.htm:<em class="emphasis">See</em> <a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>.</p>
gloss.htm:processes. <em class="emphasis">See also</em></tt> <a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>. 
gloss.htm:starts. <em class="emphasis">See also</em> <a href="ch24_03.htm#upt3-CHP-24-SECT-3">Section 24.3</a>. This number allows you to refer to a process
gloss.htm:See <a href="ch03_04.htm#upt3-CHP-3-SECT-4">Section 3.4</a>.</p>
gloss.htm:file you want to execute. <em class="emphasis">See also</em> <a href="ch17_29.htm#upt3-CHP-17-SECT-29">Section 17.29</a> and <a href="ch35_06.htm#upt3-CHP-35-SECT-6">Section 35.6</a>.
gloss.htm:programs. <em class="emphasis">See also</em></tt> <a href="ch27_03.htm#upt3-CHP-27-SECT-3">Section 27.3</a>. 
gloss.htm:pathname. <em class="emphasis">See also</em></tt> <a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a>. 
gloss.htm:<a href="ch27_12.htm#upt3-CHP-27-SECT-12">Section 27.12</a> and <a href="ch27_13.htm#upt3-CHP-27-SECT-13">Section 27.13</a>. 
gloss.htm:every tape drive. <em class="emphasis">See also</em></tt> <a href="ch01_19.htm#upt3-CHP-1-SECT-19">Section 1.19</a>. 
gloss.htm:<a href="ch01_16.htm#upt3-CHP-1-SECT-16">Section 1.16</a> and <a href="ch07_07.htm#upt3-CHP-7-SECT-7">Section 7.7</a>. 
gloss.htm:<em class="emphasis">See also</em> <a href="ch39_02.htm#upt3-CHP-39-SECT-2">Section 39.2</a>.
gloss.htm:resources. <em class="emphasis">See also</em> <a href="ch24_20.htm#upt3-CHP-24-SECT-20">Section 24.20</a>. 
