  SMB HOWTO

  : David Wood, dwood@plugged.net.au  :  â,
  chlee@physics.soongsil.ac.kr
  v1.0, 10 August 1996

    SMB HOWTO ̴. NetBIOS Ǵ LanManager Ҹ Session
  Message Block (SMB)   ϴ  Ѵ.
  ______________________________________________________________________

   

  1.      Ұ

  2.       ڼ  ϸ

  3.      ġ

  4.       Ű

  5.      Ϲ (/etc/smb.conf)

  6.       ̺긦 M$ Ű

  7.      M$ ̺긦  Ű

  8.       Ϳ M$ Ű

  9.      M$ ͸  ϱ

  10.     ۱

  11.      
  ______________________________________________________________________

  1.  Ұ

    SMB HOWTO ̴. NetBIOS Ǵ LanManager Ҹ Session
  Message Block (SMB)   ϴ  Ѵ.

    David Wood (dwood@plugged.net.au)  Ѵ.  ǿ
  ԵǱ⸦ ϴ ߰,  Ǵ     ȯѴ.

  SMB  M$ 3.11, 95, NT( M$ Īϰڴ) ũ
  ͸ ϴµ ȴ.  Andrew Tridgell   
  ̿ؼ (н)   ũ,   ϴ.

  ٷ   ִ  Ʒ   ִ.

  1.  Ƽǰ M$ .

  2. M$ Ƽǰ  .

  3.  Ϳ M$ .

  4. M$ Ϳ  .

      ϰڴ.

  2.   ڼ  ϸ

  ٴ ſ ϰ  Ű̴.    Ѵٴ
     ̴.     ȭ, Ʈ
  񽺸   ϴ  ̴.
     ϸ   ϱ ٶ.

  o  ٿ õ   Ű ԵǾ ִ. Ű 
      ִ  : ftp://nimbus.anu.edu.au/pub/tridge/samba/
     <ftp://nimbus.anu.edu.au/pub/tridge/samba/>

  o  The linux Printing HOWTO.

  o  The Print2Win Mini-HOWTO.

  3.  ġ

    ֱ ҽ  Ʈ   ִ.
  ftp://nimbus.anu.edu.au/pub/tridge/samba/
  <ftp://nimbus.anu.edu.au/pub/tridge/samba/>

   ġѴٸ Ű ɼ̹Ƿ  ؾ߸ Ѵ. ٸ
  ǵ  ȭ ϰ ִ.

  Ʒ   ٸ ϱ   ʿ ̴. Ϲ
  /usr/sbin 丮 Ʒ ġǾְ ý ʱ⼳ ũƮ
  inetd ؼ ýÿ ۵Ǿ. `` Ű''
  ũƮ    ִ.

  ______________________________________________________________________
          smbd (SMB )
          nmbd (Ŭ̾Ʈ   NetBIOS nameserver ϴ )
  ______________________________________________________________________

   ȭϵ Ϲ /usr/bin Ʒ ġ ٲ  ִ.

  ______________________________________________________________________
          smbclient       (н   Ŭ̾Ʈ)
          smbprint        ( ȣƮ Ϳ Ʈ ϱ  ũƮ)
          smbprint.sysv   ( smbprint  SVR4 н  ̴)
          smbstatus       (   ¸ ش)
          smbrun          ( ȣƮ α׷  ϰ ϴ ũƮ)
  ______________________________________________________________________

  ߰   ԵǾִ `print' ũƮ smbprint ũƮ
  ۾ غϴµ ϴ.

   Ű ġϱⰡ ϴ.    Ʈ 
  ҽ   ҽ Ե README ȭ оƶ.  ҽ
  doc/INSTALL.txtȭ  ̴.  ȭϿ ġ  ڼ
      ̴.

  ν Ǹ /usr/sbin Ʒ , /usr/bin Ʒ ȭ
  ġȴ. Ŵ  /usr/local/man ġȴ.

   Ű ġ  Makefile  ȭ smb.conf ȭ
  ġ ؾ Ѵ. /etc Ʒ ϴ  Ϲ Ѵٸ 
  ̵ ϴ. ⿡ ټȭ /etc/smb.conf, αȭ
  ġ log file = /var/log/samba-log.%m,  丮 lock
  directory = /var/lock/samba   ϰ  ̴.

  smb.conf ȭ ν. ̹   丮
  ̵϶.  example/simple 丮 캸 README ȭ о
  ƶ. smb.conf ȭ /etc 丮 Ѵ. ̶ Ǹ ؾ
  Ѵ.  ̹ ýۿ ٰ ġǾ ִٸ /etc Ʒ ټ
  ȭ  ٵ  ȭϷ ϱ⸦ Ѵ.

  /etc Ʒ ȭ     ٸ   ϰ
  /etc Ʒ   ɺ ũ .

  ______________________________________________________________________
          ln -s /path/to/smb.conf /etc/smb.conf
  ______________________________________________________________________

  4.   Ű

     /usr/sbin/smbd  /usr/sbin/nmbd ̴.   
  inetd  ؼ   Ǿ  ִ.   ȭ
   ġ Ѵٸ,   ߴܵǸ ٽ   ֵ inetd
   ؼ  ̴.  񽺸  ϰų  ý
   ̿ϱ ؼ /etc/rc.d/init.d ũƮ Űų
   ʿ信  ۾ ų  ִ.

  inetd   Ű ؼ Ʒ ٵ /etc/inetd.conf
  ߰Ѿ Ѵ.

       ______________________________________________________________________
           # SAMBA NetBIOS services (for PC file and print sharing)
           netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd
           netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd
       ______________________________________________________________________

    inetd     Ų.

  ______________________________________________________________________
      kill -HUP 1
  ______________________________________________________________________

  ý ʱ  ũƮ  Ű ؼ Ʒ
  ũƮ /etc/rc/d/init.d/smb   ϰ ּ ִµ
  ɺ ũ ؾѴ.

  ______________________________________________________________________
      #!/bin/sh

      #
      # /etc/rc.d/init.d/smb -  񽺸 , Ѵ.
      #
      # Ʒ   ȭ ɺ ũ Ų.
      # symlinks: /etc/rc.d/rc1.d/K35smb  (Kills SMB services on shutdown)
      #           /etc/rc.d/rc3.d/S91smb  (Starts SMB services in multiuser mode)
      #           /etc/rc.d/rc6.d/K35smb  (Kills SMB services on reboot)
      #

      # Լ ̺귯 ҽ
      . /etc/rc.d/init.d/functions

      # Ʈũ  ҽ
      . /etc/sysconfig/network

      # Ʈũ ɻ¸ Ѵ
      [ ${NETWORKING} = "no" ] && exit 0

      # 񽺸  Ǵ Ų.
      case "$1" in
        start)
          echo -n "Starting SMB services: "
          daemon smbd -D
          daemon nmbd -D
          echo
          touch /var/lock/subsys/smb
          ;;
        stop)
          echo -n "Shutting down SMB services: "
          killproc smbd
          killproc nmbd
          rm -f /var/lock/subsys/smb
          echo ""
          ;;
        *)
          echo "Usage: smb {start|stop}"
          exit 1
      esac
  ______________________________________________________________________

  5.  Ϲ (/etc/smb.conf)

  (Ǵ ٸ н ý) ټ /etc/smb.conf ȭϿ
  ؼ ȴ.  ȭ ܺο ų ý ڿ 
     Ѵ.

     ̺ ͸ M$ Ű  
  ̴. ̹  smb.conf ȭ  Ұ  μ 
  ϴ.   ͵鿡    ʿ .  
  ߿  Ұ ̴.

    global, homes, printer,  Ӹ ۵ȴ.

  global  ٰ  ڿ  ϴµ ϴ 
   Ѵ.

  homes  ڰ    Ȩ 丮
  ϴ  Ѵ. , ڴ ڽ Ȩ 丮 Ӹ
  Ѵ.  , M$ ڰ M$κ   ̺ 
  õѴٸ,    Ȩ 丮  ϴ. ̶
  ߿  ڴ    ־߸ Ѵ.

  Ʒ smb.conf  ȭ ڰ  ǻ  Ȩ 丮
  Ӱ ӽ 丮  Ѵ. M$ ڰ ̵   
  ֱؼ   Ʈũ  ־ Ѵ. ׷ ڴ
   ȭ Ŵ Ž Ʈũ ̺   
  ִ.

    ڿ Ű  ߰ ׸  
  Ѵ.

       ______________________________________________________________________
       ; /etc/smb.conf
       ;
       ;  ȭ  ڿ 񽺸  Ѵ. :
       ; /etc/rc.d/init.d/smb stop
       ; /etc/rc.d/init.d/smb start

       [global]
       ; guest  Ϸ Ʒ ּ ȣ Ѵ.
       ; guest account = nobody
          log file = /var/log/samba-log.%m
          lock directory = /var/lock/samba
          share modes = yes

       [homes]
          comment = Home Directories
          browseable = no
          read only = no
          create mode = 0750

       [tmp]
          comment = Temporary file space
          path = /tmp
          read only = no
          public = yes
       ______________________________________________________________________

  6.   ̺긦 M$ Ű

    smb.conf  M$ ڿ  ̺긦
  Ű . ¶,    ڿ ϴ 
     ϰڴ.

  丮  Ű ؼ  smb.confȭ tmp 
  ؼ Ʒ  ٲ  ȭϿ ߰Ѵ.

  ______________________________________________________________________
  [public]
     comment = Public Stuff
     path = /home/public
     public = yes
     writable = yes
     printable = yes
  ______________________________________________________________________

   丮 staff ׷쿡  ڿԸ   ְ ׿
  Ϲ ڿԴ б   ֱؼ Ʒ  Ѵ.

       ______________________________________________________________________
       [public]
          comment = Public Stuff
          path = /home/public
          public = yes
          writable = yes
          printable = no
          write list = @staff
       ______________________________________________________________________

  ̺   Ǵٸ    Ŵ  
  ٶ.

  7.  M$ ̺긦  Ű

  н   Ŭ̾Ʈ α׷  ҽ ԵǾ ִ.
    ڸǵ ο ftp  ̽ Ѵ. ̰ M$
    Ŭ̾Ʈ  ȭ  ƿƼ   ִ.

  ϴ ȣƮ 밡  Ȯϱ ؼ   
  ƶ.

  ______________________________________________________________________
      /usr/sbin/smbclient -L host
  ______________________________________________________________________

  `host' 캸⸦ ϴ ǻ ̸̴.    
  `' ̸  ̴. ,   ִ ̺곪
   ̸ ش.   ȣ  Ǿִٸ ȣ
   ̴.  `guest' ̳   ȣ ˰
  ־ Ѵ.

  :

  ______________________________________________________________________
      smbclient -L zimmerman
  ______________________________________________________________________

      ó Ÿ ̴.

       ______________________________________________________________________
       Server time is Sat Aug 10 15:58:27 1996
       Timezone is UTC+10.0
       Password:
       Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]

       Server=[ZIMMERMAN] User=[] Workgroup=[WORKGROUP] Domain=[]

               Sharename      Type      Comment
               ---------      ----      -------
               ADMIN$         Disk      Remote Admin
               public         Disk      Public
               C$             Disk      Default share
               IPC$           IPC       Remote IPC
               OReilly        Printer   OReilly
               print$         Disk      Printer Drivers

        ǻʹ   (browse)   ִ.

               Server               Comment
               ---------            -------
               HOPPER               Samba 1.9.15p8
               KERNIGAN             Samba 1.9.15p8
               LOVELACE             Samba 1.9.15p8
               RITCHIE              Samba 1.9.15p8
               ZIMMERMAN
       ______________________________________________________________________

      Ʈ   ڿ   
  ش.

  Ŭ̾Ʈ ϱ ؼ   Ѵ.

  ______________________________________________________________________
      /usr/sbin/smbclient service <password>
  ______________________________________________________________________

  `service' ǻͿ ̴.   `zimmerman' ǻ
  `public'  丮 ϱ ؼ, service
  \\zimmerman\public  ȴ. ׷  ට  뿡
  ణ  ִ. ׷   ؾ Ѵ.

  ______________________________________________________________________
      /usr/sbin/smbclient \\\\zimmerman\\public mypasswd
  ______________________________________________________________________

  `mypasswd' ڽ ȣ̴.

  ϸ   smbclient Ʈ Ÿ.

  ______________________________________________________________________
  Server time is Sat Aug 10 15:58:44 1996
  Timezone is UTC+10.0
  Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]
  smb: \>
  ______________________________________________________________________

  `h' ġ smbclient    ִ.

       ______________________________________________________________________
       smb: \> h
       ls             dir            lcd            cd             pwd
       get            mget           put            mput           rename
       more           mask           del            rm             mkdir
       md             rmdir          rd             prompt         recurse
       translate      lowercase      print          printmode      queue
       cancel         stat           quit           q              exit
       newer          archive        tar            blocksize      tarmode
       setmode        help           ?              !
       smb: \>
       ______________________________________________________________________

   ftp   ִ ڶ    ִ.

  8.   Ϳ M$ Ű

   ͸ M$ Ű ؼ Ͱ 
  ۵ǵ  Ǿ־ Ѵٴ  翬 ̴. 
  Ʈ ϴٸ   ϴ   ̴.

   Ʈ ϴ κп ؼ Printing HOWTO 
  ϱ⸦ ٶ.

    ڴ M$ NT  ͸ ϱ   κ
     ,  ϴ  ϱ ٶ.
    Ϳ M$ Ű ڼ  ˰ ִٸ 
  dwood@plugged.net.au  ֱ ٶ. װ ؼ  κ
  Ϻϰ   ִ.

  smb.conf Ʈ  ߰Ѵ.

  ______________________________________________________________________
  [global]
     printing = bsd
     printcap name = /etc/printcap
     load printers = yes
     log file = /var/log/samba-log.%m
     lock directory = /var/lock/samba

  [printers]
     comment = All Printers
     security = server
     path = /var/spool/lpd/lp
     browseable = no
     printable = yes
     public = yes
     writable = no
     create mode = 0700

  [ljet]
     security = server
     path = /var/spool/lpd/lp
     printer name = lp
     writable = yes
     public = yes
     printable = yes
     print command = lpr -r -h -P %p %s
  ______________________________________________________________________

   ( 쿣 ljet path) /etc/printcap ǵ
  Ǯ丮 ġŰ  ƶ.

  : ٸ ̿ н  Ϳ M$ NT Ű Ϳ
  ణ  ִ.  ϳ  ͸ NT ϰ ν
   ִĿ  ̴.   ġ ؼ  ҽ
  ԵǾ ִ docs/WinNT.txt   ٶ. Ǵٸ  ȣ
  óϴ ̴.   캸     
  ϱ ư Ҵ.

  9.  M$ ͸  ϱ

  M$ ͸ ϱ ؼ Ʒ ۾  ؾ߸ Ѵ.

  a) /etc/printcap ȭϿ  丮 (Ǯ丮 ) Ȯ
  ġϴ  ׵ ־ Ѵ.

  b) /usr/bin/smbprint ȭ ־ Ѵ.  ȭ  ҽ 
  ԵǾ ִµ,   ȭϸ ִ   
  ִ.  ȭ ణ   Ʒ Ǿ ִ.

  c)  ƽŰ ȭ ƮũƮ ȭϷ ȯϱ ؼ
  nenscript ׿   ϴ   ־߸ Ѵ.
  nenscript ƮũƮ ȯ̰  /usr/bin Ʒ ġȴ.

  d) ٷ Ҷ ϱ   ̿ϱ⸦  ̴.
  ƽŰ ȭ, ƮũƮ ȭ óִ, Ǵ ƮũƮ
  ȭ ִ  ũƮ Ʒ ־ ִ.

  M$ NT ȣƮ HP 5MP ͸  /etc/printcap ȭ  Ʒ
  ־ ִ.  ׸  ǹ̰ ִ

  ______________________________________________________________________
          cm - ּ( )
          lp -   ġ
          sd -  ǻ  Ǯ 丮
          af - the accounting file
          mx - ִ ȭ ũ( 0   Ѵ)
          if - Է (ũƮ) ̸
  ______________________________________________________________________

     ϸ Printing HOWTO printcap Ŵ  ٶ

       ______________________________________________________________________
       # /etc/printcap
       #
       # //zimmerman/oreilly via smbprint
       #
       lp:\
               :cm=HP 5MP Postscript OReilly on zimmerman:\
               :lp=/dev/lp1:\
               :sd=/var/spool/lpd/lp:\
               :af=/var/spool/lpd/lp/acct:\
               :mx#0:\
               :if=/usr/bin/smbprint:
       ______________________________________________________________________

  Ǯ 丮 accounting 丮 ϰ Ⱑ  
  ־ Ѵ.  'if' ٿ smbprint ũƮ(Ʒ ־)
  Ȯ ΰ ִ,  ġ Ű ִ(/dev Ʒ
  Ư ȭ) Ȯؾ Ѵ.

   smbprint ũƮ ̴. ũƮ 밳 /usr/bin
  Ʒ ġϰ, ٸ   Andrew Tridgell 
  ̴.  ũƮ ټҽ  ԵǾ ȭ
    ʴ. ׷ ⿡ ٽ   ̴.

   ũƮ Ǳ 캼  µ,  ũƮ ׳
  ״ ϴ ͺٴ ڽ ȯ濡 ˸° ϴ  
  ٶϰ ϴ.

  ______________________________________________________________________
  #!/bin/sh -x

  #  ũƮ н 󿡼 printcap   Է ̴.
  # ̰    񽺿 ȭ Ʈϱ  smbclient
  # α׷ ̿Ѵ.
  #   printcap  Ʒó   ִ
  #
  # smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint
  #
  #    ũƮ  Ʈϴ "smb"  н ͸
  # .   Ѱ   /usr/spool/smb Ǯ丮
  #  Ѵ.

  #
  # ũƮ hamiltom@ecnz.co.nz (Michael Hamilton) ؼ , 
  # ׸ ȣ /usr/var/spool/lpd/PRINTNAME/.config ȭϿ  
  # ֵ ٲ.
  #
  # ̰ ϰ ϱ ؼ /etc/printcap accounting ȭ(af=...) 
  # ԵǾ߸ Ѵ.
  #
  #   cdcolour:\
  #       :cm=CD IBM Colorjet on 6th:\
  #       :sd=/var/spool/lpd/cdcolour:\
  #       :af=/var/spool/lpd/cdcolour/acct:\
  #       :if=/usr/local/etc/smbprint:\
  #       :mx=0:\
  #       :lp=/dev/null:
  #
  # /usr/var/spool/lpd/PRINTNAME/.config ȭϿ  ׵ Ѵ:
  #   server=PC_SERVER
  #   service=PR_SHARENAME
  #   password="password"
  #
  # E.g.
  #   server=PAULS_PC
  #   service=CJET_371
  #   password=""

  #
  # Debugging log file, Ѵٸ /dev/null ٲ㵵 ȴ.
  #
  logfile=/tmp/smb-print.log
  # logfile=/dev/null

  #
  #   Ķʹ accounting ȭ ̸̴.
  #
  spool_dir=/var/spool/lpd/lp
  config_file=$spool_dir/.config

  # config ȭϿ    о δ.
  #   server
  #   service
  #   password
  #   user
  eval `cat $config_file`

  #
  # Some debugging help, change the >> to > if you want to same space.
  #
  echo "server $server, service $service" >> $logfile

  (
  # : Ʈÿ ڵ CR/LF ȯ ϰ Ϸ `echo translate'
  # ߰Ѵ.
    echo translate
          echo "print -"
          cat
  ) | /usr/bin/smbclient "\\\\$server\\$service" $password -U $user -N -P >> $logfile
  ______________________________________________________________________

  κ   ƽŰ  ƮũƮ ȯִ
  nenscript  ִ.  perl ũƮ smbprint 
   Ʈϴ    ش.

  ______________________________________________________________________
  Usage: print [-a|c|p] <filename>
         -a prints <filename> as ASCII
         -c prints <filename> formatted as source code
         -p prints <filename> as Postscript
          If no switch is given, print attempts to
          guess the file type and print appropriately.
  ______________________________________________________________________

  ƽŰ ȭ Ʈϱ ؼ smbprint ̿Ҷ   ߸
  찡 ִ.  ũƮ ϴٸ   ܾ ߰ ߸
  ſ 鿡 ߸ ش.

  nenscript ҽڵ忡  ش.  Ӹ(¥, ȭ̸
  ) ߰Ͽ ƽŰ ȭϰ  Ѵ. , ٹȣ ű.
  Ʒ  ̿Ͽ ٸ  ĵ ϴ.

  ƮũƮ  ̹    Ƿ  
  ȴ.

  ______________________________________________________________________
  #!/usr/bin/perl

  # Script:   print
  # Authors:  Brad Marshall, David Wood
  #           Plugged In Communications
  # Date:     960808
  #
  # Script to print to oreilly which is currently on zimmerman
  # :   ȭϵ ڷμ ޾Ƶ鿩  Ʈ ũƮ
  #  µ ϰ ó Ѵ.
  #
  #  ȭ :
  #
  # ASCII      - $line_length    ڵ   ̸ Ѵ.
  # Postscript - ƹ ó  ʴ´.
  # Code       - ϰ(¹, ڸ ) ϱ ؼ nenscript
  #                                                ̿Ͽ ƮũƮ  .
  #

  # ƽŰ ؽƮ   ٴ ִ ڼ.
  $line_length = 76;

  #  Ʈ ũƮ ο ̸.
  $print_prog = "/usr/bin/smbprint";

  # nenscript ο ̸(ƽŰ-->ƮũƮ ȯ)
  $nenscript = "/usr/bin/nenscript";

  unless ( -f $print_prog ) {
          die "Can't find $print_prog!";
  }
  unless ( -f $nenscript ) {
          die "Can't find $nenscript!";
  }

  &ParseCmdLine(@ARGV);

  # DBG
  print "filetype is $filetype\n";

  if ($filetype eq "ASCII") {
          &wrap($line_length);
  } elsif ($filetype eq "code") {
          &codeformat;
  } elsif ($filetype eq "ps") {
          &createarray;
  } else {
          print "Sorry..no known file type.\n";
          exit 0;
  }
  # smbprint  ٵ ()Ų.
  open(PRINTER, "|$print_prog") || die "Can't open $print_prog: $!\n";
  foreach $line (@newlines) {
          print PRINTER $line;
  }
  # ȭ      쿡 ٹٲ(ǵ) ߰Ѵ.
  print PRINTER "\n";
  close(PRINTER);
  print "Completed\n";
  exit 0;

  # --------------------------------------------------- #
  #        Everything below here is a subroutine        #
  # --------------------------------------------------- #

  sub ParseCmdLine {
          # ڸǵ  мؼ ȭ   ãƳ.

          # $arg $file  ִٸ  ´.
          # and the filename
          if ($#_ < 0) {
                  &usage;
          }
          # DBG
  #       foreach $element (@_) {
  #               print "*$element* \n";
  #       }

          $arg = shift(@_);
          if ($arg =~ /\-./) {
                  $cmd = $arg;
          # DBG
  #       print "\$cmd found.\n";

                  $file = shift(@_);
          } else {
                  $file = $arg;
          }

          # ȭ  Ѵ.
          unless ($cmd) {
                  # ƹ ڰ  .

                  if ($file =~ /\.ps$/) {
                          $filetype = "ps";
                  } elsif ($file =~ /\.java$|\.c$|\.h$|\.pl$|\.sh$|\.csh$|\.m4$|\.inc$|\.html$|\.htm$/) {
                          $filetype = "code";
                  } else {
                          $filetype = "ASCII";
                  }

                  # $file ȭ  ˾Ƴ $filetype Ѱش.
          } else {
                  # We have what type it is in $arg
                  if ($cmd =~ /^-p$/) {
                          $filetype = "ps";
                  } elsif ($cmd =~ /^-c$/) {
                          $filetype = "code";
                  } elsif ($cmd =~ /^-a$/) {
                          $filetype = "ASCII"
                  }
          }
  }

  sub usage {
          print "
  Usage: print [-a|c|p] <filename>
         -a prints <filename> as ASCII
         -c prints <filename> formatted as source code
         -p prints <filename> as Postscript
          If no switch is given, print attempts to
          guess the file type and print appropriately.\n
  ";
          exit(0);
  }

  sub wrap {
          # ٱ̰  ڼ  ȭ   迭 ҴѴ.
          #  ̿ ٱ̸ Ѵ.

          # ٱ̸  ڼ  ´.
          $limit = pop(@_);

          # DBG
          #print "Entering subroutine wrap\n";
          #print "The line length limit is $limit\n";

          # ȭ о鿩 мϰ   迭 ҴѴ.
          open(FILE, "<$file") || die "Can't open $file: $!\n";
          while(<FILE>) {
                  $line = $_;

                  # DBG
                  #print "The line is:\n$line\n";

                  # ѱ̺   ̸ Ѵ.
                  while ( length($line) > $limit ) {

                          # DBG
                          #print "Wrapping...";

                          # $limit +1  ڵ ´.
                          $part = substr($line,0,$limit +1);

                          # DBG
                          #print "The partial line is:\n$part\n";

                          #  ڰ  ƴ Ѵ.
                          $last_char = substr($part,-1, 1);
                          if ( " " eq $last_char ) {
                              # ̶ ״ Ѵ.

                              # DBG
                              #print "The last character was a space\n";

                              substr($line,0,$limit + 1) = "";
                              substr($part,-1,1) = "";
                              push(@newlines,"$part\n");
                          } else {
                               #  ƴ϶   ġ
                               # ã װ Ѵ.

                              # DBG
                              #print "The last character was not a space\n";

                               # $limit  ڸ .
                               substr($part,-1,1) = "";
                               #   ã   ´.
                               $revpart = reverse($part);
                               $index = index($revpart," ");
                               if ( $index > 0 ) {
                                 substr($line,0,$limit-$index) = "";
                                 push(@newlines,substr($part,0,$limit-$index)
                                     . "\n");
                               } else {
                                 #    ̶
                                 # $limit   Ѵ.
                                 substr($line,0,$limit) = "";
                                 push(@newlines,substr($part,0,$limit)
                                     . "\n");
                               }
                          }
                  }
                  push(@newlines,$line);
          }
          close(FILE);
  }
  sub codeformat {
          # ƾ wrap ȣؼ nenscript  ͸ Ѵ.
          &wrap($line_length);

          # ҽ ڵ带 Ʈϱ   ˸ ĵ(,
          # Courier font, ٹȣ) ԽŲ ƮũƮ ȭ 
          # ϱ ؼ nenscript  óѴ.
          # ù° ӽȭϷ Ѵ.
          $tmpfile = "/tmp/nenscript$$";
          open(FILE, "|$nenscript -2G -i$file -N -p$tmpfile -r") ||
                  die "Can't open nenscript: $!\n";
          foreach $line (@newlines) {
                  print FILE $line;
          }
          close(FILE);

          # ӽ ȭ ٽ о鿩  Ʈ ũƮ 
          #  ֵ 迭 Ѵ.
          @newlines = ("");
          open(FILE, "<$tmpfile") || die "Can't open $file: $!\n";
          while(<FILE>) {
                  push(@newlines,$_);
          }
          close(FILE);
          system("rm $tmpfile");
  }

  sub createarray {
          # ƮũƮ  迭 Ѵ.
          open(FILE, "<$file") || die "Can't open $file: $!\n";
          while(<FILE>) {
                  push(@newlines,$_);
          }
          close(FILE);
  }
  ______________________________________________________________________

  10.  ۱

  This HOWTO is copyright 1996 by David Wood.  It may be reproduced in
  any form and freely distributed as long as the file stays intact,
  including this statement.

  11.   

    ִٸ ٷ   ٶ.    ̰
  ſ 縦 ǥϰڴ.

