
                                   SMB HOWTO
                                       
@: David Wood, [1]dwood@plugged.net.au
Ķ: J.S. Lin, [2]r6921068@ms.cc.ntu.edu.tw

   v1.0, 10 August 1996
     _________________________________________________________________
   
   oO SMB HOWTO {pϥ SMB}. oyzb Linux Wpϥ Session
   Message Block (SMB) protocol{w}, ]s NetBIOS  LanManager
   protocol.
     _________________________________________________________________
   
1. 

2. i@BT

3. w

4. o daemon

5. @պA]w (/etc/smb.conf)

6.  Linux Ϻе Windows 

7.  Windows Ϻе Linux 

8.  Linux L Windows 

9.  Windows L Linux 

10. v

11. PE
     _________________________________________________________________
   
1. 

   oO SMB HOWTO {pϥ SMB} . oyzb Linux Wpϥ Session
   Message Block (SMB) protocol, ]s NetBIOS  LanManager protocol.
   
   󪺺@̬O David Wood ( [3]dwood@plugged.net.au). A,קέץ
   iHH쨺,HKU@][ih.
   
   SMB protocol QϥΦb Microsoft Windows 3.11, NT M 95 ΨӤɺϺФΦL
   . ϥ Andrew Tridgell Ұ Samba uM, UNIX (]t Linux) 
   ɺϺлPL Windows D.
   
   ^Hϥ Samba |˪FiH:
   
    1.  linux Ϻе Windows .
    2.  Windows Ϻе linux .
    3.  linux L Windows .
    4.  Windows L linux .
       
   oǪF賣w]tb.
   
   Disclaimer: procedures M script n@̬OiH`B@,έnѨ
   (proceduresMscript)Ѫ̳iiH`B@. HboتTP
   ]wi|ॿ`B@.pGADJx,AiH e-mail @,X
   ĳӧi, @̨ä@O.AwO? @̲uOU
   .....
   
2. i@BT

   o HOWTO ]khp]w򥻪 SMBɥHΦCLAȦb linux W.
   Samba OӫD`B㪺]. boӦaSn]khƻsҦ Samba
   .
   
   i@BT,ЬݥHU:
     * Samba , io Samba oM{distribution}. oM
       iob: [4]ftp://nimbus.anu.edu.au/pub/tridge/samba/
     * The linux Printing HOWTO.
     * The Print2Win Mini-HOWTO.
       
3. w

   ̷s Samba l{iHo:
   
   [5]ftp://nimbus.anu.edu.au/pub/tridge/samba/
   
   M,pGww linux  Redhat ,AiHϥγnM{package} Ӧw
   .ǨL]]t Samba binaries{Gɵ{}.
   
   HU daemon{޲zF}  Samba nM On. ̤@OQw
   b /usr/sbin ,ӥib},qtΰ_ʪ scriptsinetdӰ. script
   ҤlQiܦb [6] Daemons.
     _________________________________________________________________
   
        smbd (The SMB daemon)
        nmbd ( NetBIOS nameserver 䴩 clients)
     _________________________________________________________________
   
   @Ө,HU Samba  binaries Qw˦b /usr/bin, MmOi
   ܩ.
     _________________________________________________________________
   
        smbclient       (@بѵ UNIX Ϊ SMB  client{{})
        smbprint        (@ script ΦbCL SMB D{host}WC)
        smbprint.sysv   (PW, Oѵ SVR4 UNIX Ϊ)
        smbstatus       (CXaDثe SMB sp)
        smbrun          (@ 'glue' script Ψ²aε{ SMB D)
     _________________________________________________________________
   
   A,@إs 'print'  script Q]b HOWTO , Ψӷ@@ئ
    front end{eݤ}  smbprint script.
   
   Samba nMO²w˪.²aqWz}olX, B\ŪboM
   󤤪 README ɮ. boM󤤤]@ docs/INSTALL.txt ɴѤ@²
   檺vBw˫.
   
   ۦw˫,  daemons  /usr/sbin  binaries  /usr/bin. 
   man pages{U} \b /usr/local/man.
   
   Ab Samba nM, Ab Makefile |OպA,smb.conf,
   m. o@Ob /etcU, iH⥦\Aw\Nm. oǨϥΤ
   k{directions}, ڭ̱N]AOոɦm /etc/smb.conf, log ɦm
    log file = /var/log/samba-log.%m , lock ؿ lock directory =
   /var/lock/samba.
   
   w˲պA{configuration}, smb.conf. h Samba Ҧbؿ. ݤ@Ub
   lؿ example/simple ӥBŪ@U README . ƻsbӥؿU
   smb.conf ɨ /etc U. `N! pGA@ linux oMww˦n Samba,
   A]\w Samba պAɦb /etc U. γ\Aӱqɶ}l.
   
   pGAQպAɩb /etc ؿU,iH⥦\bAQn\a,Mb
   /etc U@U symlink{Ÿs}:
     _________________________________________________________________
   
        ln -s /path/to/smb.conf /etc/smb.conf
     _________________________________________________________________
   
4. o daemon

   o daemon O /usr/sbin/smbd M /usr/sbin/nmbd.
   
   AiH Samba daemon q inetd ηW{. pGA]w@ӥä[
   ɮצA,Aӱq inetd Ӱ,ҥHpGL̦,Ns}l.pGAu
   OQnϥ SMB A,Ϊ̥Ψtκ޲zӻU,Aݭn,AiHǥѨ
    /etc/rc.d/init.d script,άƦܪʪ.
   
   nq inetd Ӱ daemon , ЩHUXb inetd պA,
   /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
       ______________________________________________________________
     
   MUOHKsҰ inetd daemon :
     _________________________________________________________________
   
    kill -HUP 1
     _________________________________________________________________
   
   nqtαҰʪ script Ӱ daemon, ЧHU script m@ӥs
   /etc/rc.d/init.d/smb , ӥB symbolically link {comments}һ
   ɮ:
       ______________________________________________________________
     
    #!/bin/sh

    #
    # /etc/rc.d/init.d/smb - starts and stops SMB services.
    #
    # The following files should be synbolic links to this file:
    # 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)
    #

    # Source function library.
    . /etc/rc.d/init.d/functions

    # Source networking configuration.
    . /etc/sysconfig/network

    # Check that networking is up.
    [ ${NETWORKING} = "no" ] && exit 0

    # See how we were called.
    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. @պA]w (/etc/smb.conf)

   b linux (ΨL UNIX)W Samba պA]wOQ@ɮ,
   /etc/smb.conf ,ұ. oɨMwAQnӨtθ귽ɵ~@ɥHΧA
   QL̰򭭨.
   
   ]HU`N|Bz linux ϺлPL Windows , p`Үi
   ܪ smb.conf ɾqOAүo²檺, uOHЩʬت.
   
   ثe٤n߲Ӹ`. ᭱`N|ХDn.
   
   bɮפCq{section}|ӬqY}l, YO [global],
   [homes], [printers] .
   
   [global] qwq@ܼ,  Samba NΨөwqҦ귽.
   
   [homes] q\ݨϥΪ̨Ӧsba(linux)WL̪(BuL
   ) home directories{aؿ}. ]NO, pG@ Windows ϥΪ̱qL̪
   Windows n]ksoӤ, ḺNOsL̦ۤvӤH home
   directiory. no˨Ʊ,ҭn`NO,L̥blinux boxWӱb.
   
   HU smb.conf ɮ׼˥\ݨϥΪ̨ӥηaWL̪ home
   directories ӥBg@ӼȦsؿ. @ Windows ϥΪ,nQݨo
   , linux box Obϰ{local network}. M,ϥΪ²aq
   Windows File Manager  Windows Explorer sϺ.
   
   bHUqn`NO, oɤB~رN|ΨӤ\h귽Q.
       ______________________________________________________________
     
; /etc/smb.conf
;
; Make sure and restart the server after making changes to this file, ex:
; /etc/rc.d/init.d/smb stop
; /etc/rc.d/init.d/smb start

[global]
; Uncomment this if you want a guest account
; 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.  Linux Ϻе Windows 

   HWҮiܪ smb.conf ˥,  linux Ϻе Windows ϥΪ̬Oܮe
   . M,  Samba LF, AiHܤj{. HUǨҤl :
   
   Fɥؿjaϥ, Nإ߭Wz [tmp] q, Y[JoӪF
    smb.conf:
       ______________________________________________________________
     
[public]
   comment = Public Stuff
   path = /home/public
   public = yes
   writable = yes
   printable = yes
       ______________________________________________________________
     
   FϥHWؿѤjiŪ,usզ{group staff}igJ,Эק䶵
   عo:
       ______________________________________________________________
     
[public]
   comment = Public Stuff
   path = /home/public
   public = yes
   writable = yes
   printable = no
   write list = @staff
       ______________________________________________________________
     
   LϺФɪޥ,Ь Samba  man pages.
   
7.  Windows Ϻе Linux 

   @ص UNIX Ϊ SMB client {Q]tb Samba oM󤧤.
   @ئbROCUftp.
   
   QnݦbwDWǤɥio, :
     _________________________________________________________________
   
    /usr/sbin/smbclient -L host
     _________________________________________________________________
   
   oت 'host' OAQnsWl. oN|^@ 'service' W
   - ]NO, ҤɵAϺЩΦLW. D SMB ASwW
   ]w, _hNnDAJKX.  'guest' bKXάOAӤHbx
   WbKX.
   
   |ӨҤl:
     _________________________________________________________________
   
    smbclient -L zimmerman
     _________________________________________________________________
   
   oӫOXӬݰ_ӹOo:
       ______________________________________________________________
     
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


This machine has a browse list:

        Server               Comment
        ---------            -------
        HOPPER               Samba 1.9.15p8
        KERNIGAN             Samba 1.9.15p8
        LOVELACE             Samba 1.9.15p8
        RITCHIE              Samba 1.9.15p8
        ZIMMERMAN
       ______________________________________________________________
     
   o browse list CXL귽ɵ SMB A.
   
   nϥΦ client, а:
     _________________________________________________________________
   
    /usr/sbin/smbclient service <password>
     _________________________________________________________________
   
   oت 'service' O@xMɦW. |ҦӨ,pGA]ks@xs
   zimmerman WH 'public' ɦW٪ؿ , service ns
   \\zimmerman\public. M,] shell , A|ݭn backslashes, 
   HAno˪:
     _________________________________________________________________
   
    /usr/sbin/smbclient \\\\zimmerman\\public mypasswd
     _________________________________________________________________
   
   o˪ 'mypasswd' OAKXr{literal string}.
   
   AN| smbclient ܲŸ{prompt}X{:
       ______________________________________________________________
     
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: \>
       ______________________________________________________________
     
   J 'h' oϥ smbclient  help:
       ______________________________________________________________
     
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: \>
       ______________________________________________________________
     
   pGAϥftp,AӤݭnd smbclient  man pages.
   
8.  Linux L Windows 

   F Linux L Windows , ATwALwg˳]n.
   pGAq linux WCL,]w SMB LɱN|ܪ.
   
   Ш Printing HOWTO ӳ]waCL.
   
   ]@̨ϥγQs Windows NT L, op`ӳQܧ
   ,ӥuOĳ.󦳸ԲӸƥiɥXӪH, бNoǸƱH
   [7]dwood@plugged.net.au ϱoop`.
   
   [JCL]wA 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
       ______________________________________________________________
     
   T{L|(ҤlOb[ljet]U)nP /etc/printcap spool ؿ
   ۲ŦX!
   
   `N: ϥ Samba Ӥ UNIX boxes WL Windows NT @ǰ
   D. 䤤@ӰDOϥ NT AaݨɪL. QnץoӰD, 
    Samba oMW, Y docs/WinNT.txt ɮ.LOBzKX
   D. oZHDFѻPন\ץ,ЬݬۦPW.
   
9.  Windows L Linux 

   F Windows WL, AHUBJ:
   
   a) Ab /etc/printcap AO,ӥBL̥Paؿc (
   spool ؿ) ۲ŦX.
   
   b) A script  /usr/bin/smbprint. o|Hb Samba source, 
   OHҦ Samba binary oM. @ӵyLק睊bHUQ.
   
   c) pGAQnഫ ASCII ɨ Postscript,Anetscript,λP䵥
   . netscipt O@ Postscript ഫӥB@Ow˦b /usr/bin.
   
   d) AiHƱǥѦϥΪ frond end Ө Samba CLe. @إΩ
   Bz ASCII, Postscript Ϋإ Postscript ² perl script bU
   w.
   
   HU /etc/printcap إΦb Windows NT DW HP 5MP L. oǶئp
   U:
     _________________________________________________________________
   
        cm - comment
             {}
        lp - device name to open for output
             {FX,ӭn}Ҫ]ƦW}
        sd - the printer's spool directory (on the local machine)
             {L spool ؿ (baW)}
        af - the accounting file
             {bɮ}
        mx - the maximum file size (zero is unlimited)
             {̤jɮפjp (sܨS)}
        if - name of the input filter (script)
             {JLoW (script)}
     _________________________________________________________________
   
   nohT,Ь Printing HOWTO Ϊ printcap  man page.
       ______________________________________________________________
     
# /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:
       ______________________________________________________________
     
   нTw spool M accounting{b} ؿsbBigJ. нTHY榳A
   | smbprint script (bU|) ӥBTwA]ƳQ ( /dev
   UY).
   
   UӬO smbprint script . q`Q\b /usr/bin ӥBO] Andrew
   Tridgell tG,ӾڧکҪOLгyF Samba. Hb Samba source o
   M, bY binary oMèS, ҥHboڦAy@.
   
   AiHƱJӦaݳo. YǸpקwgҩ̬OܦΪ.
       ______________________________________________________________
     
#!/bin/sh -x

# This script is an input filter for printcap printing on a unix machine. It
# uses the smbclient program to print the file to the specified smb-based
# server and service.
# For example you could have a printcap entry like this
#
# smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint
#
# which would create a unix printer called "smb" that will print via this
# script. You will need to create the spool directory /usr/spool/smb with
# appropriate permissions and ownerships for your system.

# Set these to the server and service you wish to print to
# In this example I have a WfWg PC called "lapland" that has a printer
# exported called "printer" with no password.

#
# Script further altered by hamiltom@ecnz.co.nz (Michael Hamilton)
# so that the server, service, and password can be read from
# a /usr/var/spool/lpd/PRINTNAME/.config file.
#
# In order for this to work the /etc/printcap entry must include an
# accounting file (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:
#
# The /usr/var/spool/lpd/PRINTNAME/.config file should contain:
#   server=PC_SERVER
#   service=PR_SHARENAME
#   password="password"
#
# E.g.
#   server=PAULS_PC
#   service=CJET_371
#   password=""

#
# Debugging log file, change to /dev/null if you like.
#
logfile=/tmp/smb-print.log
# logfile=/dev/null


#
# The last parameter to the filter is the accounting file name.
#
spool_dir=/var/spool/lpd/lp
config_file=$spool_dir/.config

# Should read the following variables set in the config file:
#   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

(
# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
        echo translate
        echo "print -"
        cat
) | /usr/bin/smbclient "\\\\$server\\$service" $password -U $user -N -P >> $log
file
       ______________________________________________________________
     
   j linux oMH nenscript Ψഫ ASCII 
   Postscript. HU perl script g smbprint ϧeѤ@²椶
   linux CL.
     _________________________________________________________________
   
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 ӦCL ASCII ɮ׫KI_L. pGi઺,o
   script I_ťB(Nbr).
   
   榡ƹLlXOQ nenscript BzL. Bz ASCII ɦӥBέӯS諸
   Y( date,filename)榡Ʀ. ]ip. ϥγo@Ҥl, 
   L榡AiHF.
   
   Postscript wgAa榡ƤF,ҥH̪qL.
       ______________________________________________________________
     
#!/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
# Purpose:  Takes files of various types as arguments and
# processes them appropriately for piping to a Samba print script.
#
# Currently supported file types:
#
# ASCII      - ensures that lines longer than $line_length characters wrap on
#              whitespace.
# Postscript - Takes no action.
# Code       - Formats in Postscript (using nenscript) to display
#              properly (landscape, font, etc).
#

# Set the maximum allowable length for each line of ASCII text.
$line_length = 76;

# Set the path and name of the Samba print script
$print_prog = "/usr/bin/smbprint";

# Set the path and name to nenscript (the ASCII-->Postscript converter)
$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;
}
# Pipe the array to smbprint
open(PRINTER, "|$print_prog") || die "Can't open $print_prog: $!\n";
foreach $line (@newlines) {
        print PRINTER $line;
}
# Send an extra linefeed in case a file has an incomplete last line.
print PRINTER "\n";
close(PRINTER);
print "Completed\n";
exit 0;

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

sub ParseCmdLine {
        # Parses the command line, finding out what file type the file is

        # Gets $arg and $file to be the arguments (if the exists)
        # 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;
        }

        # Defining the file type
        unless ($cmd) {
                # We have no arguments

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

                # Process $file for what type is it and return $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 {
        # Create an array of file lines, where each line is < the
        # number of characters specified, and wrapped only on whitespace

        # Get the number of characters to limit the line to.
        $limit = pop(@_);

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

        # Read in the file, parse and put into an array.
        open(FILE, "<$file") || die "Can't open $file: $!\n";
        while(<FILE>) {
                $line = $_;

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

                # Wrap the line if it is over the limit.
                while ( length($line) > $limit ) {

                        # DBG
                        #print "Wrapping...";

                        # Get the first $limit +1 characters.
                        $part = substr($line,0,$limit +1);

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

                        # Check to see if the last character is a space.
                        $last_char = substr($part,-1, 1);
                        if ( " " eq $last_char ) {
                            # If it is, print the rest.

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

                            substr($line,0,$limit + 1) = "";
                            substr($part,-1,1) = "";
                            push(@newlines,"$part\n");
                        } else {
                             # If it is not, find the last space in the
                             # sub-line and print up to there.

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

                             # Remove the character past $limit
                             substr($part,-1,1) = "";
                             # Reverse the line to make it easy to find
                             # the last space.
                             $revpart = reverse($part);
                             $index = index($revpart," ");
                             if ( $index > 0 ) {
                               substr($line,0,$limit-$index) = "";
                               push(@newlines,substr($part,0,$limit-$index)
                                   . "\n");
                             } else {
                               # There was no space in the line, so
                               # print it up to $limit.
                               substr($line,0,$limit) = "";
                               push(@newlines,substr($part,0,$limit)
                                   . "\n");
                             }
                        }
                }
                push(@newlines,$line);
        }
        close(FILE);
}

sub codeformat {
        # Call subroutine wrap then filter through nenscript
        &wrap($line_length);

        # Pipe the results through nenscript to create a Postscript
        # file that adheres to some decent format for printing
        # source code (landscape, Courier font, line numbers).
        # Print this to a temporary file first.
        $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);

        # Read the temporary file back into an array so it can be
        # passed to the Samba print script.
        @newlines = ("");
        open(FILE, "<$tmpfile") || die "Can't open $file: $!\n";
        while(<FILE>) {
                push(@newlines,$_);
        }
        close(FILE);
        system("rm $tmpfile");
}

sub createarray {
        # Create the array for postscript
        open(FILE, "<$file") || die "Can't open $file: $!\n";
        while(<FILE>) {
                push(@newlines,$_);
        }
        close(FILE);
}
       ______________________________________________________________
     
10. v

   1996 ~ HOWTO vOݩ David Wood. iHΥ󫬦AвͥH
   ۥѪ,unoɭʤ,]toqԭz.
   
11. PE

   unAgHڴѷN, ڱN|bo()U@PEA.

References

   1. mailto:dwood@plugged.net.au
   2. mailto:r6921068@ms.cc.ntu.edu.tw
   3. mailto:dwood@plugged.net.au
   4. ftp://nimbus.anu.edu.au/pub/tridge/samba/
   5. ftp://nimbus.anu.edu.au/pub/tridge/samba/
   6. file://localhost/tmp/zh-sgmltools.8816/SMB-HOWTO.txt.html#sec-daemons
   7. mailto:dwood@plugged.net.au
