From owner-doc-jp@jp.freebsd.org  Sun Mar 26 19:31:20 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id TAA60038;
	Sun, 26 Mar 2000 19:31:20 +0900 (JST)
	(envelope-from owner-doc-jp@jp.FreeBSD.org)
Received: from sv01.geocities.co.jp (sv01.geocities.co.jp [210.153.89.155])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id TAA60033
	for <doc-jp@jp.freebsd.org>; Sun, 26 Mar 2000 19:31:20 +0900 (JST)
	(envelope-from hrs@geocities.co.jp)
Received: from mail.geocities.co.jp (mail.geocities.co.jp [210.153.89.137]) by sv01.geocities.co.jp (8.9.3+3.2W/3.7W) with ESMTP id TAA29683 for <doc-jp@jp.freebsd.org>; Sun, 26 Mar 2000 19:31:19 +0900 (JST)
Received: from mail.hrs.jp (sutnmax1-ppp31.ed.noda.sut.ac.jp [133.31.173.41]) by mail.geocities.co.jp (1.3G-GeocitiesJ-3.3) with ESMTP id TAA05988 for <doc-jp@jp.freebsd.org>; Sun, 26 Mar 2000 19:31:16 +0900 (JST)
Message-Id: <200003261031.TAA05988@mail.geocities.co.jp>
Received: from localhost (alph.hrs.jp [192.168.0.10])
	by mail.hrs.jp (8.9.3/3.7W/DomainMaster) with ESMTP id RAA65806
	for <doc-jp@jp.freebsd.org>; Sun, 26 Mar 2000 17:41:42 +0900 (JST)
	(envelope-from hrs@hrs.jp)
To: doc-jp@jp.freebsd.org
X-Mailer: Mew version 1.94 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Sun_Mar_26_17:41:10_2000_179)--"
Content-Transfer-Encoding: 7bit
Date: Sun, 26 Mar 2000 17:41:41 +0900
From: Hiroki Sato <hrs@geocities.co.jp>
X-Dispatcher: imput version 990905(IM130)
Lines: 422
Reply-To: doc-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: doc-jp 7229
Subject: [doc-jp 7229] books/handbook/basics/chapter.sgml 1.13 -> 1.15
Errors-To: owner-doc-jp@jp.freebsd.org
Sender: owner-doc-jp@jp.freebsd.org
X-Originator: hrs@geocities.co.jp

----Next_Part(Sun_Mar_26_17:41:10_2000_179)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

$B:4F#!wEl5~M}2JBg3X$G$9!#(B

 basics $B$NJ,3d$G$9!#(B

 * $B:n6H$N;EJ}(B

  0) $BE:IU$5$l$F$$$k:9J,%U%!%$%k$+$i:n6H$9$k$b$N$rA*$s$G$/$@$5$$!#(B

     # $B:n6H$K;~4V$,$+$+$k>l9g$K$O!":n6HA0$K!V$3$l$d$j$^$9!A!W(B
     # $B$H0l8@Js9p$7$F$*$/$HNI$$$G$7$g$&!#(B

  1) $BK]Lu$O!":9J,$NCf$N1Q8l$NItJ,$@$1$G9=$$$^$;$s!#(B
     SGML $B%?%0$J$I$N9=B$E*$JItJ,$r5$$K$9$kI,MW$O$"$j$^$;$s!#(B

  2) <screen> $B$H(B <programlisting> $B$G3g$i$l$?Cf?H$O(B
     $B$=$N$^$^;D$7$F$/$@$5$$!#(B

  3) $B@.2LJ*$NDs=P$O!"(B

        $B!&J8=q$NHV9f$,J,$+$k$3$H(B($BHV9f$OKAF,$K=q$+$l$F$$$^$9(B)
        $B!&$3$N%a%$%k$X$NJV?.$K$J$C$F$$$k$3$H(B

     $B$,K~$?$5$l$F$$$l$P!"FC$K7A<0$OLd$$$^$;$s!#(B
     $B%a%$%k%a%C%;!<%8$H$7$FIT@5$J$b$N$G$J$1$l$P!"(B
     $BJ8;z%3!<%I$d05=L$NM-L5$O07$$$d$9$$$b$N$rA*$s$G2<$5$$!#(B


 $B<j=g$KITL@$JE@$,$"$l$P!"1sN8$J$/<ALd$7$F$/$@$5$$!#(B
 $BC1=c$KK]Lu:n6H$,%a%$%s$H$J$k$N$G!"$O$8$a$F:n6H$5$l$kJ}$K$b(B
 $B8~$$$F$$$k$H;W$$$^$9!#(B

--
| $B:4F#(B $B9-@8!wEl5~M}2JBg3X(B <hrs@geocities.co.jp>
|
|                                  j7397067@ed.noda.sut.ac.jp(univ)
|                        hrs@jp.FreeBSD.org(FreeBSD doc-jp Project)

----Next_Part(Sun_Mar_26_17:41:10_2000_179)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="sep.1"


 (basics/chapter.sgml 1.13 -> 1.15 #1)

  <sect1 id="permissions">
    <title>$B5v2DB0@-(B(permissions)</title>

    <para>FreeBSD, having its history rooted in BSD UNIX, has its
      fundamentals based on several key UNIX concepts.  The first, and
      most pronounced, is that FreeBSD is a multi-user operating system.
      The system can handle several users all working simultaneously on
      completely unrelated tasks.  The system is responsible for properly
      sharing and managing requests for hardware devices, preferials,
      memory, and cpu time evenly to each user.</para>

    <para>Because the system is capable of supporting multiple users,
      everything the system manages has a set of permissions governing who
      can read, write, and execute the resource.  These permissions are
      stored as an octet broken into three pieces, one for the owner of
      the file, one for the group that the file belongs to, and one for
      everyone else.  This numerical representation works like
      this:</para>

    <informaltable frame="none">
      <tgroup cols="3">
	<thead>
	  <row>
	    <entry>Value</entry>
	    <entry>Permission</entry>
	    <entry>Directory Listing</entry>
	  </row>
	</thead>

	<tbody>
	  <row>
	    <entry>0</entry>
	    <entry>No read, no write, no execute</entry>
	    <entry><literal>---</literal></entry>
	  </row>

	  <row>
	    <entry>1</entry>
	    <entry>No read, no write, execute</entry>
	    <entry><literal>--x</literal></entry>
	  </row>

	  <row>
	    <entry>2</entry>
	    <entry>No read, write, no execute</entry>
	    <entry><literal>-w-</literal></entry>
	  </row>

	  <row>
	    <entry>3</entry>
	    <entry>No read, write, execute</entry>
	    <entry><literal>-wx</literal></entry>
	  </row>

	  <row>
	    <entry>4</entry>
	    <entry>Read, no write, no execute</entry>
	    <entry><literal>r--</literal></entry>
	  </row>

	  <row>
	    <entry>5</entry>
	    <entry>Read, no write, execute</entry>
	    <entry><literal>r-x</literal></entry>
	  </row>

	  <row>
	    <entry>6</entry>
	    <entry>Read, write, no execute</entry>
	    <entry><literal>rw-</literal></entry>
	  </row>

	  <row>
	    <entry>7</entry>
	    <entry>Read, write, execute</entry>
	    <entry><literal>rwx</literal></entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>

    <para>For the long directory listing by <command>ls -l</command>, a
      column will show a files' permissions for the owner, group, and
      everyone else.  Here's how its broken up:</para>

    <screen>-rw-r--r--</screen>

    <para>The first character, from left to right, is a special character
      that tells if this is a regular file, a directory, a special
      character or block device, a socket, or any other special
      pseudo-file device.  The  next three characters, designated as
      <literal>rw-</literal> gives the permissions for the owner of the
      file.  The next three characters, <literal>r--</literal> gives the
      permissions for the group that the file belongs to.  The final three
      characters, <literal>r--</literal>, gives the permissions for the
      rest of the world.  A dash means that the permission is turned off.
      In the case of this file, the permissions are set so the owner can
      read and write to the file, the group can read the file, and the
      rest of the world can only read the file.  According to the table
      above, the permissions for this file would be
      <literal>644</literal>, where each digit represents the three parts
      of the file's permission.</para>

    <para>This is all well and good files, but how does the system control
      permissions on devices? FreeBSD actually treats most hardware
      devices as a file that programs can open, read, and write data to
      just like any other file.  These special device files are stored on
      the <filename>/dev</filename> directory.</para>

    <para>Directories are also treated as files.  They have read, write,
      and execute permissions.  The executable bit for a directory has a
      slightly different meaning than that of files.  When a directory is
      marked executable, it means it can be searched into, for example,  a
      directory listing can be done in that directory.</para>

    <para>There are more to permissions, but they are primarily used in
      special circumstances such as setuid binaries and sticky
      directories.  If you want more information on file permissions and
      how to set them, be sure to look at the &man.chmod.1; man
      page.</para>
  </sect1>

----Next_Part(Sun_Mar_26_17:41:10_2000_179)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="sep.2"


 (basics/chapter.sgml 1.13 -> 1.15 #2)

  <sect1 id="dirstructure">
    <title>$B%G%#%l%/%H%j9=B$(B</title>

    <para>Since FreeBSD uses its file systems to determine many
      fundamental system operations, the hiarchy of the file system is
      extremely important.  Due to the fact that the &man.hier.7; man page
      provides a complete description of the directory structure, it will
      not be duplicated here.  Please read &man.hier.7; for more
      information.</para>
      
    <para>Of significant importance is the root of all directories, the /
      directory.  This directory is the first directory mounted at boot
      time and it contains the base system necessary at boot time.  The
      root directory also contains mount points for every other file
      system that you want to mount.</para>

    <para>A mount point is a directory where additional file systems can
      be grafted onto the root file system.  Standard mount points include
      <filename>/usr</filename>, <filename>/var</filename>,
      <filename>/mnt</filename>, and <filename>/cdrom</filename>.  These
      directories are usually referenced to entries in the file
      <filename>/etc/fstab</filename>.  <filename>/etc/fstab</filename> is
      a table of various file systems and mount points for refence by the
      system.  Most of the file systems in <filename>/etc/fstab</filename>
      are mounted automatically at boot time from the script &man.rc.8;
      unless they contain the noauto option.  Consult the &man.fstab.5;
      manual page for more information on the format of the
      <filename>/etc/fstab</filename> file and the options it
      contains.</para>
  </sect1>

----Next_Part(Sun_Mar_26_17:41:10_2000_179)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="sep.3"


 (basics/chapter.sgml 1.13 -> 1.15 #3)

  <sect1 id="shells">
    <title>$B%7%'%k(B</title>

    <para>In FreeBSD, a lot of everyday work is done in a command line
      interface called a shell.  A shell's main job is to take commands
      from the input channel and execute them.  A lot of shells also have
      built in functions to help everyday tasks such a file management,
      file globing, command line editing, command mar-cos, and environment
      variables.  FreeBSD comes with a set of shells, such as sh, the
      Bourne Shell, and csh, the C-shell.  Many other shells are available
      from the FreeBSD Ports Collection that have much more power, such as
      tcsh and bash.</para>

    <para>Which shell do you use?  Its really a matter of taste.  If your
      a C programmer you might feel more comfortable with a C-like shell
      such as tcsh.  If you've come from Linux or are new to a UNIX
      command line interface you might try bash.  The point is that each
      shell has unique properties that may or may not work with your
      preferred working environment, and that you have a choice of what
      shell to use.</para>

    <para>One common feature in a shell is file-name completion.  Given
      the typing of the first few letters of a command or filename, you
      can usually have the shell automatically complete the rest of the
      command or filename by hitting the TAB key on the keyboard.  Here is
      an example.  I have two files called <filename>foobar</filename> and
      <filename>foo.bar</filename>.  I want to delete
      <filename>foo.bar</filename>.  So what I would type on the keyboard
      is:  <command>rm fo[TAB].[TAB]</command>.</para>

    <para>The shell would print out <command>rm
      foo[BEEP].bar</command>.</para>

    <para>The [BEEP] is the console bell, which is the shell telling me it
      was unable to totally complete the filename because there is more
      than one match.  Both <filename>foobar</filename> and
      <filename>foo.bar</filename> start with <literal>fo</literal>, but
      it was able to complete to <literal>foo</literal>.  Once I typed in
      <literal>.</literal>, then hit TAB again, the shell was able to fill
      in the rest of the filename for me.</para>

    <para>Another function of the shell is environment variables.
      Environment variables are a variable key pair stored in the shell's
      environment space.  This space can be read by any program invoked by
      the shell, and thus contains a lot of program configuration.  Here
      is a list of common environment variables and what they mean:</para>

    <informaltable frame="none">
      <tgroup cols="2">
	<thead>
	  <row>
	    <entry>Variable</entry>
	    <entry>Description</entry>
	  </row>
	</thead>

	<tbody>
	  <row>
	    <entry><envar>USER</envar></entry>
	    <entry>Current logged in user's name.</entry>
	  </row>

	  <row>
	    <entry><envar>PATH</envar></entry>
	    <entry>Colon separated list of directories to search for
	      binaries.</entry>
	  </row>

	  <row>
	    <entry><envar>DISPLAY</envar></entry>
	    <entry>Network name of the X11 display to connect to, if
	      available.</entry>
	  </row>

	  <row>
	    <entry><envar>SHELL</envar></entry>
	    <entry>The current shell.</entry>
	  </row>

	  <row>
	    <entry><envar>TERM</envar></entry>
	    <entry>The name of the user's terminal.  Used to determine the
	      capabilites of the terminal.</entry>
	  </row>

	  <row>
	    <entry><envar>TERMCAP</envar></entry>
	    <entry>Database entry of the terminal escape codes to perform
	      various terminal functions.</entry>
	  </row>

	  <row>
	    <entry><envar>OSTYPE</envar></entry>
	    <entry>Type of operating system.  E.g., FreeBSD.</entry>
	  </row>

	  <row>
	    <entry><envar>MACHTYPE</envar></entry>
	    <entry>The CPU architecture that the system is running
	      on.</entry>
	  </row>

	  <row>
	    <entry><envar>EDITOR</envar></entry>
	    <entry>The user's preferred text editor.</entry>
	  </row>

	  <row>
	    <entry><envar>PAGER</envar></entry>
	    <entry>The user's preferred text pager.</entry>
	  </row>

	  <row>
	    <entry><envar>MANPATH</envar></entry>
	    <entry>Colon separated list of directories to search for
	      manual pages.</entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>

    <para>To view or set an environment variable differs somewhat from
      shell to shell.  For example, in the C-Style shells such as tcsh
      and csh, you would use <command>setenv</command> to set and view
      environment variables.  Under Bourne shells such as sh and bash, you
      would use <command>set</command> and <command>export</command> to
      view and set your current environment variables.  For example, to
      set or modify the <envar>EDITOR</envar> environment variable, under
      csh or tcsh a command like this would set <envar>EDITOR</envar> to
      <filename>/usr/local/bin/emacs</filename>:</para>

    <para><command>setenv EDITOR /usr/local/bin/emacs</command></para>

    <para>Under Bourne shells:</para>

    <para><command>export EDITOR="/usr/local/bin/emacs"</command></para>

    <para>You can also make most shells expand the environment variable by
      placing a <literal>$</literal> character in front of it on the
      command line.  For example, <command>echo $TERM</command> would
      print out whatever <envar>$TERM</envar> is set to, because the shell
      expands <envar>$TERM</envar> and passes it on to echo.</para>

    <para>Shells treat a lot of special characters, called meta-characters
      as special representations of data.  The most common one is the
      <literal>*</literal> character, which represents any number of
      characters in a filename.  These special meta-characters can be used
      to do file name globing.  For example, typing in
      <command>echo *</command> is almost the same as typing in
      <command>ls</command> because the shell takes all the files that
      match <command>*</command> and puts them on the command line for
      echo to see.</para>

    <para>To prevent the shell from interpreting these special characters,
      they can be escaped from the shell by putting a backslash
      (<literal>\</literal>) character in front of them.  <command>echo
      $TERM</command> prints whatever your terminal is set to.
      <command>echo \$TERM</command> prints <envar>$TERM</envar> as
      is.</para>
  </sect1>

----Next_Part(Sun_Mar_26_17:41:10_2000_179)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="sep.4"


 (basics/chapter.sgml 1.13 -> 1.15 #4)

  <sect1 id="editors">
    <title>$B%F%-%9%H%(%G%#%?(B</title>

    <para>A lot of configuration in FreeBSD is done by editing a text
      file.  Because of this, it would be a good idea to become familiar
      with a text editor.  FreeBSD comes with a few as part of the base
      system, and many more are available in the ports collection.</para>

    <para>The easiest and simplest editor to learn is an editor called
      <application>ee</application>, which stands for easy editor.  To
      start <application>ee</application>, one would type at the command
      line <command>ee filename</command> where
      <literal>filename</literal> is the name of the file to be edited.
      For example, to edit <filename>/etc/rc.conf</filename>, type in
      <command>ee /etc/rc.conf</command>.  Once inside of ee, all of the
      commands for manipulating the editor's functions are listed at the
      top of the display. The caret <literal>^</literal> character means
      the control key on the keyboard, so ^e expands to pressing the
      control key plus the letter <literal>e</literal>.  To leave
      <application>ee</application>, hit the escape key, then choose leave
      editor.  The editor will prompt you to save any changes if the file
      has been modified.</para>

    <para>FreeBSD also comes with more powerful text editors such as
      <application>vi</application> as part of the base system, and
      <application>emacs</application> and <application>vim</application>
      as part of the FreeBSD ports collection.  These editors offer much
      more functionality and power at the expense of being a little more
      complicated to learn.  However if you plan on doing a lot of text
      editing, learning a more powerful editor such as
      <application>vim</application> or <application>emacs</application>
      will save you much more time in the long run.</para>
  </sect1>

----Next_Part(Sun_Mar_26_17:41:10_2000_179)----
