White space fix only. Translators can ignore.

This commit is contained in:
Dru Lavigne 2013-10-23 01:29:29 +00:00
parent 5eaea3cdf8
commit fc12885e26
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=43025

View file

@ -3143,14 +3143,15 @@ Swap: 2048M Total, 2048M Free
<indexterm><primary>shells</primary></indexterm> <indexterm><primary>shells</primary></indexterm>
<indexterm><primary>command line</primary></indexterm> <indexterm><primary>command line</primary></indexterm>
<para>A <firstterm>shell</firstterm> provides a command line interface for interacting with the operating system. A <para>A <firstterm>shell</firstterm> provides a command line
shell receives commands from the input channel and executes interface for interacting with the operating system. A shell
them. Many shells provide built in functions to help with receives commands from the input channel and executes them.
everyday tasks such as file management, file globbing, command Many shells provide built in functions to help with everyday
line editing, command macros, and environment variables. &os; tasks such as file management, file globbing, command line
comes with several shells, including the Bourne shell editing, command macros, and environment variables. &os; comes
(&man.sh.1;) and the extended C shell (&man.tcsh.1;). Other with several shells, including the Bourne shell (&man.sh.1;) and
shells are available from the &os; Ports Collection, such as the extended C shell (&man.tcsh.1;). Other shells are available
from the &os; Ports Collection, such as
<command>zsh</command> and <command>bash</command>.</para> <command>zsh</command> and <command>bash</command>.</para>
<para>The shell that is used is really a matter of taste. A C <para>The shell that is used is really a matter of taste. A C
@ -3162,11 +3163,10 @@ Swap: 2048M Total, 2048M Free
<para>One common shell feature is filename completion. After a <para>One common shell feature is filename completion. After a
user types the first few letters of a command or filename and user types the first few letters of a command or filename and
presses <keycap>Tab</keycap>, the shell automatically presses <keycap>Tab</keycap>, the shell automatically completes
completes the rest of the command or filename. Consider two the rest of the command or filename. Consider two files called
files called <filename>foobar</filename> and <filename>foobar</filename> and <filename>foo.bar</filename>.
<filename>foo.bar</filename>. To delete To delete <filename>foo.bar</filename>, type <command>rm
<filename>foo.bar</filename>, type <command>rm
fo[<keycap>Tab</keycap>].[<keycap>Tab</keycap>]</command>.</para> fo[<keycap>Tab</keycap>].[<keycap>Tab</keycap>]</command>.</para>
<para>The shell should print out <para>The shell should print out
@ -3177,8 +3177,8 @@ Swap: 2048M Total, 2048M Free
is more than one match. Both <filename>foobar</filename> and is more than one match. Both <filename>foobar</filename> and
<filename>foo.bar</filename> start with <literal>fo</literal>. <filename>foo.bar</filename> start with <literal>fo</literal>.
By typing <literal>.</literal>, then pressing By typing <literal>.</literal>, then pressing
<keycap>Tab</keycap> again, the shell is able to fill in <keycap>Tab</keycap> again, the shell is able to fill in the
the rest of the filename.</para> rest of the filename.</para>
<indexterm><primary>environment variables</primary></indexterm> <indexterm><primary>environment variables</primary></indexterm>
@ -3186,9 +3186,9 @@ Swap: 2048M Total, 2048M Free
variables. Environment variables are a variable/key pair stored variables. Environment variables are a variable/key pair stored
in the shell's environment. This environment can be read by any in the shell's environment. This environment can be read by any
program invoked by the shell, and thus contains a lot of program program invoked by the shell, and thus contains a lot of program
configuration. Table 4.3 provides a list of common environment variables configuration. Table 4.3 provides a list of common environment
and their meanings. Note that the names of environment variables and their meanings. Note that the names of
variables are always in uppercase.</para> environment variables are always in uppercase.</para>
<table frame="none" pgwide="1"> <table frame="none" pgwide="1">
<title>Common Environment Variables</title> <title>Common Environment Variables</title>
@ -3296,18 +3296,19 @@ Swap: 2048M Total, 2048M Free
<para>Shells treat special characters, known as meta-characters, <para>Shells treat special characters, known as meta-characters,
as special representations of data. The most common as special representations of data. The most common
meta-character is <literal>*</literal>, which represents any meta-character is <literal>*</literal>, which represents any
number of characters in a filename. Meta-characters can be number of characters in a filename. Meta-characters can be used
used to perform filename globbing. For example, to perform filename globbing. For example, <command>echo
<command>echo *</command> is equivalent to <command>ls</command> because *</command> is equivalent to <command>ls</command> because
the shell takes all the files that match <literal>*</literal> the shell takes all the files that match <literal>*</literal>
and <command>echo</command> lists them on the command line.</para> and <command>echo</command> lists them on the command
line.</para>
<para>To prevent the shell from interpreting a special character, <para>To prevent the shell from interpreting a special character,
escape it from the shell by starting it with a backslash escape it from the shell by starting it with a backslash
(<literal>\</literal>). For example, (<literal>\</literal>). For example, <command>echo
<command>echo $TERM</command> prints the terminal setting $TERM</command> prints the terminal setting whereas
whereas <command>echo \$TERM</command> literally prints the <command>echo \$TERM</command> literally prints the string
string <literal>$TERM</literal>.</para> <literal>$TERM</literal>.</para>
<sect2 id="changing-shells"> <sect2 id="changing-shells">
<title>Changing the Shell</title> <title>Changing the Shell</title>
@ -3316,8 +3317,8 @@ Swap: 2048M Total, 2048M Free
to use <command>chsh</command>. Running this command will to use <command>chsh</command>. Running this command will
open the editor that is configured in the open the editor that is configured in the
<envar>EDITOR</envar> environment variable, which by default <envar>EDITOR</envar> environment variable, which by default
is set to &man.vi.1;. Change the <literal>Shell:</literal> line is set to &man.vi.1;. Change the <literal>Shell:</literal>
to the full path of the new shell.</para> line to the full path of the new shell.</para>
<para>Alternately, use <command>chsh -s</command> which will set <para>Alternately, use <command>chsh -s</command> which will set
the specified shell without opening an editor. For example, the specified shell without opening an editor. For example,
@ -3330,9 +3331,8 @@ Swap: 2048M Total, 2048M Free
<filename>/etc/shells</filename>. If the shell was <filename>/etc/shells</filename>. If the shell was
installed from the &os; Ports Collection as described in installed from the &os; Ports Collection as described in
<xref linkend="ports"/>, it should be automatically added <xref linkend="ports"/>, it should be automatically added
to this file. If it is missing, add it using this to this file. If it is missing, add it using this command,
command, replacing the path with the path of the replacing the path with the path of the shell:</para>
shell:</para>
<screen>&prompt.root; <userinput>echo <replaceable>/usr/local/bin/bash</replaceable> &gt;&gt; /etc/shells</userinput></screen> <screen>&prompt.root; <userinput>echo <replaceable>/usr/local/bin/bash</replaceable> &gt;&gt; /etc/shells</userinput></screen>
@ -3424,98 +3424,97 @@ Swap: 2048M Total, 2048M Free
<sect1 id="basics-more-information"> <sect1 id="basics-more-information">
<title>Manual Pages</title> <title>Manual Pages</title>
<indexterm><primary>manual pages</primary></indexterm> <indexterm><primary>manual pages</primary></indexterm>
<para>The most comprehensive documentation on &os; is in the <para>The most comprehensive documentation on &os; is in the form
form of manual pages. Nearly every program on the system of manual pages. Nearly every program on the system comes with
comes with a short reference manual explaining the basic a short reference manual explaining the basic operation and
operation and available arguments. These manuals can be available arguments. These manuals can be viewed using
viewed using <command>man</command>:</para> <command>man</command>:</para>
<screen>&prompt.user; <userinput>man <replaceable>command</replaceable></userinput></screen> <screen>&prompt.user; <userinput>man <replaceable>command</replaceable></userinput></screen>
<para>where <replaceable>command</replaceable> is the name of <para>where <replaceable>command</replaceable> is the name of the
the command to learn about. For example, to learn more about command to learn about. For example, to learn more about
&man.ls.1;, type:</para> &man.ls.1;, type:</para>
<screen>&prompt.user; <userinput>man ls</userinput></screen> <screen>&prompt.user; <userinput>man ls</userinput></screen>
<para>Manual pages are divided into sections which represent the type of topic. In &os;, <para>Manual pages are divided into sections which represent the
the following type of topic. In &os;, the following sections are
sections are available:</para> available:</para>
<orderedlist> <orderedlist>
<listitem> <listitem>
<para>User commands.</para> <para>User commands.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>System calls and error numbers.</para> <para>System calls and error numbers.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Functions in the C libraries.</para> <para>Functions in the C libraries.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Device drivers.</para> <para>Device drivers.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>File formats.</para> <para>File formats.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Games and other diversions.</para> <para>Games and other diversions.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Miscellaneous information.</para> <para>Miscellaneous information.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>System maintenance and operation commands.</para> <para>System maintenance and operation commands.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>System kernel interfaces.</para> <para>System kernel interfaces.</para>
</listitem> </listitem>
</orderedlist> </orderedlist>
<para>In some cases, the same topic may appear in more than one <para>In some cases, the same topic may appear in more than one
section of the online manual. For example, there is a section of the online manual. For example, there is a
<command>chmod</command> user command and a <command>chmod</command> user command and a
<function>chmod()</function> system call. To tell &man.man.1; <function>chmod()</function> system call. To tell &man.man.1;
which section to display, specify the section number:</para> which section to display, specify the section number:</para>
<screen>&prompt.user; <userinput>man 1 chmod</userinput></screen> <screen>&prompt.user; <userinput>man 1 chmod</userinput></screen>
<para>This will display the manual page for the user command <para>This will display the manual page for the user command
&man.chmod.1;. References to a particular section of the &man.chmod.1;. References to a particular section of the
online manual are traditionally placed in parenthesis in online manual are traditionally placed in parenthesis in
written documentation, so &man.chmod.1; refers to the user written documentation, so &man.chmod.1; refers to the user
command and &man.chmod.2; refers to the system call.</para> command and &man.chmod.2; refers to the system call.</para>
<para>If the name of the manual page is unknown, use <command>man <para>If the name of the manual page is unknown, use <command>man
-k</command> to search for keywords in the manual page -k</command> to search for keywords in the manual page
descriptions:</para> descriptions:</para>
<screen>&prompt.user; <userinput>man -k <replaceable>mail</replaceable></userinput></screen> <screen>&prompt.user; <userinput>man -k <replaceable>mail</replaceable></userinput></screen>
<para>This command displays a list of commands that have the <para>This command displays a list of commands that have the
keyword <quote>mail</quote> in their descriptions. This is keyword <quote>mail</quote> in their descriptions. This is
equivalent to using &man.apropos.1;.</para> equivalent to using &man.apropos.1;.</para>
<para>To read the descriptions for the commands in <para>To read the descriptions for the commands in <filename
<filename class="directory">/usr/bin</filename>, class="directory">/usr/bin</filename>, type:</para>
type:</para>
<screen>&prompt.user; <userinput>cd /usr/bin</userinput> <screen>&prompt.user; <userinput>cd /usr/bin</userinput>
&prompt.user; <userinput>man -f * | more</userinput></screen> &prompt.user; <userinput>man -f * | more</userinput></screen>
<para>or</para> <para>or</para>
<screen>&prompt.user; <userinput>cd /usr/bin</userinput> <screen>&prompt.user; <userinput>cd /usr/bin</userinput>
&prompt.user; <userinput>whatis * |more</userinput></screen> &prompt.user; <userinput>whatis * |more</userinput></screen>
<sect2 id="basics-info"> <sect2 id="basics-info">
@ -3525,14 +3524,13 @@ Swap: 2048M Total, 2048M Free
<primary>Free Software Foundation</primary> <primary>Free Software Foundation</primary>
</indexterm> </indexterm>
<para>&os; includes many applications and utilities produced <para>&os; includes many applications and utilities produced by
by the Free Software Foundation (FSF). In addition to manual the Free Software Foundation (FSF). In addition to manual
pages, these programs may include hypertext documents called pages, these programs may include hypertext documents called
<literal>info</literal> files. These can be viewed using <literal>info</literal> files. These can be viewed using
&man.info.1; or, if &man.info.1; or, if <filename
<filename role="package">editors/emacs</filename> is role="package">editors/emacs</filename> is installed, the
installed, the info mode of info mode of <application>emacs</application>.</para>
<application>emacs</application>.</para>
<para>To use &man.info.1;, type:</para> <para>To use &man.info.1;, type:</para>