[comp.os.minix] V1.3 posting #32 - doc directory

ast@cs.vu.nl (Andy Tanenbaum) (07/14/88)

: This is a shar archive.  Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'USER_GUIDE'
sed 's/^X//' > 'USER_GUIDE' << '+ END-OF-FILE ''USER_GUIDE'
XThe software has undergone some changes since the book was published.  Among
Xother things, the software has been more oriented toward hard disk users,
Xit has been ported to the IBM PC-AT (and clones), and also to the Atari ST.
XThe most significant changes are listed here.
X
X 1. GENERAL
X       There were a number of minor changes made to the code after the book
X    was printed, as mentioned above.  As a result, line X of file Y in the  
X    book may actually appear at X+3, or X-5, etc. on the disk version.  In
X    the event of conflict, believe the disk version over the book version.
X
X 2. PC-AT
X       The distribution for the PC-AT differs from that for the PC in minor
X    ways.  For example, there is no /user diskette.  All the files that would
X    normally be on /user fit on /usr.  Furthermore, the number and organization
X    of the source diskettes is different, but the same programs are available.
X    Two additional special files are present in /dev: /dev/at0 and /dev/at1.
X    These should be used to access 1.2M diskettes.  To access 360K diskettes
X    on the PC-AT, use /dev/fd0 and /dev/fd1.  Special files are used by
X    commands such as mount, mkfs, and df, among others.  For example, to
X    copy part of a 1.2M diskette, type dd if=/dev/at0 of=file count=100.
X    The difference between /dev/at0 and /dev/fd0 is that in MINIX, special
X    files have sizes to prevent access beyond the end.  For /dev/fd0 the
X    size is 360K.  For /dev/at0 it is 1.2M.  Finally, the executable binary
X    for the PC-AT contains at_wini.c instead of xt_wini.c (see below).
X
X 3. HARD DISK DRIVERS
X       MINIX supports the use of the standard IBM hard disks.  Unfortunately,
X    IBM chose to use different (and incompatible) disks and controllers on the
X    XT and AT.  To find out if MINIX works with your disk, give the command:
X		dd if=/dev/hd0 of=/dev/null count=1000
X    If this runs to the end without errors, the driver embedded in your
X    MINIX binary is appropriate for your controller and drive.  If it gives
X    errors, copy kernel/xt_wini.c to wini.c and recompile the operating system.
X    If this fails, then try kernel/at_wini.c and recompile it once more.
X    Usually, one of these will work.  If neither works, your disk is not
X    compatible with either the XT or AT.  You will have to modify the driver.
X    You MUST have a kernel/wini.c to recompile the system, even if you do not
X    have a hard disk (in which case, either one will do).
X
X 4. INSTALLING MINIX ON A HARD DISK
X      After you have made sure that you have a working hard disk driver, as
X    described above, proceed as follows. To use MINIX on a hard disk, you need
X    a MINIX partition.  You may also have MS-DOS, PC-IX, OS/2, XENIX, or other
X    partitions as well if you like.  If you understand about making partitions,
X    make one any way you are used to.  Otherwise use the MINIX fdisk program.
X       Once you have a partition available for MINIX (the type does not matter
X    as MINIX does not check), make a file system by booting MINIX from floppy
X    the usual way and run mkfs.  If, for example, you have chosen partition 2,
X    which has, say, 40 cylinders (i.e., 40 x 68 = 2720 sectors or 1360 1K
X    blocks), type: 
X		mkfs /dev/hd2 1360
X    to make an empty file system.  However, for partition 1 use 1 block less
X    because block 0 is not available (it contains the MS-DOS partition table).
X    In other words, a 40 cylinder partition 1 has 1359 blocks but a 40 cylinder
X    partition 2 or higher has 1360 blocks. Then mount the file system by typing
X		/etc/mount /dev/hd2 /user
X    Next, make whatever directories you like, typically bin, lib, and others,
X    and copy files to the hard disk.  With the /usr floppy in drive 0, the
X    command 
X		cp /usr/bin/* /user/bin
X    will copy all the binaries from /usr/bin to the hard disk, for example.
X       Alternatively, the cpdir program can be used to copy entire trees, e.g.
X		cpdir /usr/bin /user/bin
X    will create a new directory /user/bin, and put /usr/bin with all its files
X    and subdirectories in it.  
X       A few of the files in /usr/bin must be owned by the root (instead of 
X    bin) and have mode 4755. Check to make sure. These files are:  
X		badblocks chgrp df fsck mkdir mv passwd readall rmdir su
X       Finally, edit /etc/rc to have the hard disk mounted when the system
X    is booted.  A line such as
X		/etc/mount /dev/hd2 /usr
X    can be used as a replacement for the mount command initially in /etc/rc.
X    After editing /etc/rc, mount the root file system diskette and copy it
X    to the diskette; otherwise the changes will be lost when the system is
X    rebooted.  (There is nothing special about the root file system except
X    its size; it can be mounted and written on like any other file system.)
X       After these steps have been taken, the system can be booted from
X    floppy in the usual way, and the root file system also read in from
X    floppy.  The hard disk will automatically be mounted by the /etc/rc.
X    The root device remains on the RAM disk, and the boot process still
X    goes via floppy (for compatibility and to prevent disaster in the event
X    that something goes wrong with the hard disk file system).  Hard disk
X    file systems can be checked using fsck, the same as floppies.
X       The special file /dev/hd0 refers to the whole disk, without regard to
X    partitions, whereas /dev/hd1 ... /dev/hd4 refer to partitions 1 to 4.  If
X    you have a second hard disk, you can make /dev/hd5 ... /dev/hd9 with mknod
X    (major device 3, minor device 5 ... 9) for the second drive, with hd5 for
X    the whole drive, hd6 for partition 1, etc.  Fsck also uses this convention.
X
X  5. CONFIGURING MINIX ON A HARD DISK
X       When setting up MINIX on a hard disk, the following set of directories
X    is recommended, although the MINIX source tree can go elsewhere if desired.
X    Be sure to edit the cc.c program to make sure it knows where to find the
X    various compiler passes and libraries, which may be in /bin, lib, /usr/bin,
X    or /usr/bin.  When a large RAM disk is available, put /bin and /lib on the
X    RAM disk, and include the compiler parts in them.  When extracting files
X    from the distribution, note carefully that there is a lib directory on the
X    /usr diskette (for /lib and /usr/lib) and another one among the sources
X    (for /usr/src/minix/lib).  Many of the directories listed below have sub-
X    directories.
X
X	/bin			- most common binaries
X	/dev			- special files
X	/etc			- system administration
X	/lib			- most important libraries
X	/tmp			- scratch files go here
X	/usr			- mount usr file system here
X	/usr/bin		- rest of the binaries
X	/usr/include		- system include files
X	/usr/lib		- rest of the libraries
X	/usr/src		- sources go here
X	/usr/src/minix		- minix sources go here
X	/usr/src/minix/amoeba	- all networking code is here
X	/usr/src/minix/commands	- utility program sources
X	/usr/src/minix/fs	- file system sources
X	/usr/src/minix/h	- operating system header files
X	/usr/src/minix/kernel	- kernel and device driver sources
X	/usr/src/minix/lib	- libc.a sources
X	/usr/src/minix/mm	- memory manager sources
X	/usr/src/minix/test	- test programs
X	/usr/src/minix/tools	- tools for building new operating systems
X	/usr/tmp		- (optional) alternative place for temporaries
X	
X  6. PUTTING THE ROOT FILE SYSTEM ON A HARD DISK
X       To speed up the boot procedure, you may copy the root file system to
X    /dev/hd3 with the commands 
X		cp /dev/fd0 /dev/hd3     or    cp /dev/at0 /dev/hd3
X    The former is for the PC, the latter is for the AT.  /dev/hd3 must not be
X    mounted. When booting, leave the boot diskette in the drive when typing the
X    = sign.  MINIX will see that the diskette is not a valid file system, and
X    take the root file system from the default device, /dev/hd3.  You can 
X    change the choice of default by modifying RAM_IMAGE in fs/main.c
X
X  7. USING MS-DOS AS A DEVELOPMENT SYSTEM
X       MINIX is now completely self supporting, so the C86 and PC-IX 
X    directories have been deleted.  The only time you might need MS-DOS is
X    for formatting blank diskettes.  MINIX does not have a format program.
X
X  8. EDITING LARGE PROGRAMS WITH MINED
X       Mined has a limit on the size of programs it can edit.  To edit
X     larger ones, they must be broken up with split, edited separately and
X     recombined later.  Better yet, use elle, which is a much better editor,
X     is emacs compatible, and can handle files as large as the disk.
X
X  9. MKNOD
X        MINIX differs from UNIX in that block special files (and even some
X    character special files, such as /dev/kmem) can have sizes.  A 360K floppy
X    disk special file, such as /dev/fd0 can have size 360K.  Unfortunately, the
X    mknod system call (and mknod program) have no way to express the size,
X    so it uses size 0, which is equal to infinity.  When you read past the
X    end of a block special file WITH a size, the file system returns zero
X    bytes.  When you go off the end of a device WITHOUT a size, some drivers
X    return end-of-file (e.g., hard disk, RAM disk), but others (e.g., floppy
X    disk) return an I/O error code.  Thus if you make a new block special file
X    for 2/0 and 2/1 (floppy disk) with mknod (i.e., no size) the command
X		cp /dev/fd0 /dev/fd1
X    will terminate with an error on block 360 (but it will copy the disk
X    perfectly).  The only way to make a special file with a size is by making 
X    a file system with mkfs.
X
X 10. NONEXISTENT DEVICES
X       If you try to open /dev/fd1 on a system with only one floppy disk drive,
X    the system may hang.  To avoid this problem, the first time you log in, go
X    to the /dev directory, and rename special files that you do not have to
X    something unusual.  For example, if you do not have a hard disk, rename
X    hd0 to HARD_DISK_0, hd1 to HARD_DISK_1, etc.  Similarly with one one floppy
X    disk, rename fd1 to FLOPPY_DISK_1 to prevent it being typed by accident.
X    You can also remove them, but due to the mknod problem described above, you
X    can not get them back easily, so it is best just to get them out of the 
X    way in case you ever need them again later.
X
X 11. PRINTER
X       In order to accommodate buffered and unbuffered printers, the printer
X    driver uses a combination of delay loops and interrupts.  The net result
X    is that the driver consumes a fair number of CPU cyles when running.  If
X    you expect to do a lot of printing, you might want to consider rewriting 
X    the printer interrupt handler, pr_char, in assembly code.
X
X 12. DISK SPACE
X       The /usr disk as distributed is nearly full.  If you have two floppy
X    disk drives, be sure to mount /user on drive 1 and move your working
X    directory there.  If you have only 1 floppy disk drive, remove some files
X    from /usr/bin to make more space.  If you have a hard disk, there is no
X    problem.
X
X13. RUNNING /USER TESTS ON A FLOPPY
X       Before running the tests in /user/test, remove the files in 
X    /user/commands to create some free space on the disk.  Run the tests as
X    superuser.
X
X14. COMMAND LINE LENGTH
X       The maximum initial stack size is 1K.  Calls to EXEC which require a
X    larger stack will fail.  Thus if you do ls -l * in a large directory,
X    the shell may expand the * so that the command line exceeds 1K and the 
X    EXEC will fail, resulting in the message "Cannot execute ls".
X
X15. ARCHIVES ON THE DISTRIBUTION DISKETTES
X       To save space on the distribution diskettes, some of the sources have
X    been compressed and/or archived.  Files ending with .archive can be
X    de-archived by typing: ar x file.archive.  Files ending with .Z are
X    compressed files, and can be decompressed by typing: compress -d file.Z.
X    Some directories contain archives of compressed files, so first remove
X    the files from the archive and then decompress the resulting .Z files.  
X
X16. RECOMPILING FSCK AND OTHER LARGE PROGRAMS
X      If for some reason you don't like the tools/fsck binary and want to
X    recompile it, make sure you have plenty of free space for the compiler's
X    temporary files.  On a floppy disk system, this may mean putting fsck on
X    an almost empty diskette before compiling it.  When the disk is full, the
X    quality of the compiler's error messages deteriorates rapidly.  If you
X    are compiling fsck and getting strange results, check for disk space.
X    Normally /tmp is used for temporaries, but the -T flag can override that.
X
X17. NEWS GROUP
X      If you have access to USENET, you may be interested in knowing that
X    there is a news group, comp.os.minix devoted to discussions of MINIX.
X    This is one of the largest news groups, with over 10,000 readers.
X    If you have access to the Arpanet, Bitnet, or EARN, the news group is
X    gatewayed there.  Contact info-minix-request@udel.edu to join.
X
X18. SYSTEM PROBLEMS
X      The IBM PC does not have any hardware for checking for stack overflow.
X    The user must allocate the amount of stack for each program with chmem
X    or use the compiler default (64K - program - data size).  Some programs
X    in the distribution have been set to a smaller value, and may, in rare
X    instances with certain arguments, hang.  If the system ever gets into a
X    situation where it echoes keystrokes, but ignores DEL and CTRL-\ and
X    appears otherwise to be hung up, hit F1 to see what is going on.  If
X    some process is running and there is no way to interrupt it, hit F9.
X    This key is equivalent to the super-user typing:  kill -1 9.  The result
X    of F9 is that every process in the system is killed, including update
X    and all the shells.  Although drastic, F9 will dehang the system
X    instantly.  Log in again and then type /etc/update & to restart update.
X
X19. USE OF EXTENDED MEMORY ON ATs
X       If the size of the root file system (either taken from floppy or from
X    /dev/hd3, as described above), is 256K or more, MINIX puts the root
X    device in extended memory, above 1M, leaving the entire 512K or 640K
X    free for MINIX and user programs.  To get full advantage of the extended
X    memory, the size of the root file system should be the same as the amount
X    of extended memory present.  If the root file system is < 256K, MINIX
X    assumes that there is no extended memory, and puts the root file system
X    in "low" core (below 640K).  This feature only works on ATs, so PCs must
X    never have root file systems >= 256K.
X
X20. SOFTWARE SCROLLING FOR EGA CARDS
X       MINIX works with monochrome cards, CGA cards, and IBM EGA cards. 
X    However, it does not work with some nonstandard EGA cards.  With these 
X    cards, the screen will go blank every 25 lines.  MINIX can be made to work 
X    with these EGA cards by hitting the F3 key to enable software scrolling.
X    This is slower than hardware scrolling, so only use it if you have to.  You
X    can toggle between the two modes by hitting F3 repeatedly. If you have a
X    nonstandard EGA card and want F4 to be the default, recompile kernel/tty.c
X    with the variable softscroll initialized to 1, and make a new kernel.
X
X21. NEW FLAGS AND FEATURES
X       Various programs have acquired new flags and features and new programs
X    have been included.  Please read all the files in this directory.
X
X22. ANSI ESCAPE SEQUENCES 
X      The escape sequences used by the tty driver for both input and output
X    have been changed to the ANSI standard ones.  To manipulate the cursor
X    etc., print the following:
X	ESC M:		scroll a line backwards (cursor must be on line 1)
X	ESC [ y ; x H	move to column x, row y;  (1,1) is upper right corner
X	ESC [0J		clear from cursor to end of screen
X	ESC [7m		go to reverse video
X	ESC [0m		go to normal video
X
X    The 9 numeric pad keys, as well as numeric + and - now generate ESC [ x
X    for some x.  Just type them to see which x goes with each key.
X
X23. _CLEANUP NO LONGER NEEDED
X       The exit routine has been changed to call _cleanup automatically.
X    As a result, programs using stdio no longer have to call it explicitly.
X    All calls to _cleanup have been removed from the standard distribution.
X
X24. DISTRIBUTION CHANGES
X       The subdirectories PCIX and C86 have been deleted, as mentioned above.
X    The subdirectories MINIX have been renamed IBM_PC to avoid confusion with
X    files for the ATARI ST (not included here).  Before recompiling anything,
X    remove the relevant files from IBM_PC and move them one directory up, e.g.
X		cd minix/kernel;  cp IBM_PC/* .      
X    In some cases, two makefiles are provided, called pc_makefile and 
X    at_makefile.  Copy the appropriate one to makefile, depending on whether 
X    you have (1) a PC or XT or (2) an AT.  Delete the inappropriate one.
X
X25. LINKS
X       The directory /usr/include now contains several subdirectories and also
X    linked files.  If you copy this directory to hard disk, link the following
X    files, if possible.
X
X        /usr/include/sgtty.h		to	minix/h/sgtty.h
X        /usr/include/signal.h		to	minix/h/signal.h
X        /usr/include/minix/callnr.h	to	minix/h/callnr.h
X        /usr/include/minix/com.h	to	minix/h/com.h
X        /usr/include/minix/const.h	to	minix/h/const.h
X        /usr/include/minix/type.h	to	minix/h/type.h
X        /usr/include/sys/stat.h		to	minix/h/stat.h
X        /usr/include/fs/buf.h		to	minix/fs/buf.h
X        /usr/include/fs/const.h		to	minix/fs/const.h
X        /usr/include/fs/super.h		to	minix/fs/super.h
X        /usr/include/fs/type.h		to	minix/fs/type.h
X
X    In addition, the files dosread, dosdir, and doswrite in /usr/bin should all
X    be links to the same file. It determines which it is by looking at argv[0].
X
X26. SPACE
X    If you are running on a system with limited memory, either 512K RAM
X    or no hard disk, you may encounter difficulties trying to recompile the
X    system.  However, there are steps you can take to improve the situation.
X    First, various passes of the compiler are configured with ample stack
X    space.  Using chmem you can reduce this stack space to reduce the program's
X    memory requirements.  Be careful about not reducing it too much, or strange
X    things will happen.  Second, the compiler flag -T can be used to place
X    temporary files in a place other than /tmp.  This flag may be useful if
X    /tmp is on the RAM disk, which is too small.  Third, the compiler flag -F
X    can be used to run cpp and cem sequentially instead of in parallel.  This
X    approach is slower but uses less memory. Fourth, the library, libc.a
X    contains several large routines that are rarely used.  By removing these,
X    you can reduce the amount of space the library requires. Fifth, if you are
X    able to compile but not link, after having created all the *.s files, you
X    can remove some of the larger *.c files, replacing them with null files to
X    keep make happy, and then link.
X    
X27. MULTIPLE BIN DIRECTORIES IN THE DISTRIBUTION
X       Since the distribution disks are nearly full, a few of the programs that
X    logically ought to be in the /usr/bin directory have been put on one of the
X    other distribution diskettes in a separate bin directory.  On a hard disk
X    system, these programs should be put in /usr/bin.
X
X28. LIBRARY
X       Not all the sources in minix/lib have been included in libc.a (to save
X    space).  If you have a hard disk and enough space, compare the sources and
X    binaries and add the missing files.  Remember to compile all library
X    routines with cc -c -LIB file.c.  The -LIB flag is essential for libraries.
X
X29. RS232 LINES
X       MINIX supports RS232 lines to terminals and modems.  Baudrate, parity,
X    and bits/character are user settable.  The special files /dev/tty[12] are
X    used to access the RS232 lines. They can be opened for reading and writing.
X       As shipped, the system is configured for only one line, /dev/tty1.  To
X    enable the second one, change NR_RS_LINES in tty.c to 2.  Doing so will
X    increase kernel size by 1K, due to the extra table and buffer space needed.
X    Furthermore, change kernel/main.c to setup the vector 11 for the second
X    port.  In the standard configuration, that vector is for the Ethernet.
X       The file /etc/ttys can be configured to have a shell be started for
X    either line, thus making MINIX a multi-terminal system.  The second char
X    of the three-character /etc/ttys entry gives the line parameters.  See
X    the comment at the start of tools/init.c for details.
X       The program stty can be used to set baud rates, bits/character and
X    parity for its standard input, e.g.  stty 9600 8 -even -odd </dev/tty1 
X    sets line 1 to 9600 baud, 8 bits/char, no parity.  The stty program does
X    its work using the ioctl system call.
X
X30. MISSING SOURCES
X       The sources for the C compiler (including all its parts), the editor
X    elle, and patch are not included in the distribution.  The compiler sources
X    are available from Transmediair and UniPress (see below).  The elle and
X    patch sources were too large to be included and are only available via the
X    USENET online archives.
X
X31. PASCAL AND MODULA 2 COMPILERS FOR MINIX
X       A MINIX compiler for Pascal is available.  A MINIX compiler for Modula 2
X    will available during the course of 1988-9. Neither is part of the standard
X    distribution.  They may be purchased from either of:
X
X	Unipress Software		Transmediair Utrecht B.V.
X	2025 Lincoln Highway		Melkweg 3
X	Edison, NJ 08817		3721 RG Bilthoven
X	USA				Holland
X	Tel: (201) 985-8000		Tel: (30) 78 18 20
X
X    These companies also sell the sources to the MINIX C compiler, and the
X    Amsterdam Compiler Kit, from which all the compilers have been derived.
X
+ END-OF-FILE USER_GUIDE
chmod 'u=rw,g=r,o=r' 'USER_GUIDE'
set `wc -c 'USER_GUIDE'`
count=$1
case $count in
21661)	:;;
*)	echo 'Bad character count in ''USER_GUIDE' >&2
		echo 'Count should be 21661' >&2
esac
echo Extracting 'dis88.man'
sed 's/^X//' > 'dis88.man' << '+ END-OF-FILE ''dis88.man'
X
X                           Disassembler Documentation
X
X     "Dis88"  is a symbolic  disassembler for the 8088 CPU.  It was written and
Xcopyrighted  by G.  M.  Harding and is included here by  permission.  It may be
Xfreely  redistributed  provided that complete  source code,  with all copyright
Xnotices,  accompanies  any  redistribution.  This provision also applies to any
Xmodifications  you may make.  You are urged to comment  such  changes,  giving,
Xas a miminum, your name and complete address.
X
X     The program  disassembles 8088 object code to the assembly language format
Xused by MINIX  (which is the same as is used by  PC-IX).  It makes  full use of
Xsymbol table information  (see the ast program),  supports separate instruction
Xand data space,  and generates  synthetic labels when needed.  It does not sup-
Xport 8087 mnemonics, symbolic data segment references, or the ESC mnemonic.
X
X     The program is invoked by:
X
X            dis88 [-o] infile [outfile]
X
XThe -o flag causes object code to be listed.  If no outfile is given,  standard
Xoutput is used.
X
X     The text  segment of an object file is always  padded to an even  address.
XIn addition,  if the file has split I/D space,  the text segment will be padded
Xto a paragraph boundary (i.e., an address divisible by 16). Due to padding, the
Xdisassembler may produce a few spurious, but harmless,  instructions at the end
Xof the text segment.
X
X     Because the information to which  initialized data refers cannot generally
Xbe inferred from context,  the data segment is treated  literally.  Byte values
X(in hexadecimal) are output, and long stretches of null data are represented by
Xappropriate ".zerow" pseudo-ops.  Disassembly of the bss segment,  on the other
Xhand, is quite straightforward, because uninitialized data is all zero by defi-
Xnition.  No data is output in the bss segment,  but symbolic  labels are output
Xas appropriate.
X
X     The output of  operands in symbolic  form is  complicated  somewhat by the
Xexistence of assembler  symbolic constants and segment override opcodes.  Thus,
Xthe  program's  symbol  lookup  routine  attempts to apply a certain  amount of
Xintelligence when it is asked to find a symbol.  If it cannot match on a symbol
Xof the preferred type, it may output a symbol of some other type,  depending on
Xpreassigned  (and somewhat arbitrary)  rankings within each type.  Finally,  if
Xall else fails,  it will output a string containing the address sought as a hex
Xconstant.  For user  convenience,  the targets of branches are also output,  in
Xcomments, as hexadecimal constants.
X
XERROR MESSAGES:
X
X Can't access input file          - Input file cannot be opened or read
X Can't open output file           - Output file cannot be created
X Input file not in object format  - Bad magic number
X Not an 8086/8088 object file     - CPU ID of the file header is incorrect
X Reloc table overflow             - Relocation table exceeds 1500 entries
X Symbol table overflow            - Symbol table exceeds 1500 entries
X Lseek error                      - Input file corrupted (should never happen)
X Warning: no symbols              - Symbol table is missing (use ast)
X Can't reopen input file          - Input file was removed during execution
+ END-OF-FILE dis88.man
chmod 'u=rw,g=r,o=r' 'dis88.man'
set `wc -c 'dis88.man'`
count=$1
case $count in
3239)	:;;
*)	echo 'Bad character count in ''dis88.man' >&2
		echo 'Count should be 3239' >&2
esac
echo Extracting 'man_pages'
sed 's/^X//' > 'man_pages' << '+ END-OF-FILE ''man_pages'
XThis file contains the man pages for those programs not listed in the book or
Xwhich have been significantly modified since the first release.
X---------------------------------------------------------------------------
X
XCommand:	ar - archiver
XSyntax:		ar [qrxdpmt][abivulc] [posname] archive file ...
XFlags:		(none)
XExamples:	ar r libc.a sort.s	# replace sort.s in libc.a
X		ar rb a.s libc.a b.s	# insert b.s before a.s in libc.a
X
X     Ar allows groups of files to be put together into a single archive.
XIt is normally used for libraries of compiled procedures.  The following keys
Xare allowed:
X	  q: quickly append to the end of the archive file.
X	  m: move named files. Ar expects 'a', 'b', or 'i' to be specified.
X	  r: replace (append when not in archive).
X	  d: delete. Ar will delete the name members.
X	  t: print the archive's table of contents.
X	  p: print the named files (list them on standard output)
X	  x: extract
X
XThe keys may optionally concatencated with one or more of the following:
X	  l: local temporary file for work instead of /tmp/ar.$$$$$
X	  v: verbose
X	  a: after 'posname'
X	  b: before 'posname'
X	  i: before 'posname'
X	  c: create  (suppresses creation message)
X	  u: replace only if dated later than member in archive
X
X
XCommand:	ascii - strip all the pure ASCII lines from a file
XSyntax:		ascii [-n] [file]
XFlags:		-n Extract the lines containing nonASCII characters
XExamples:	ascii file >outf	# put all the ASCII lines on outf
X		ascii -n <file >outf	# write nonASCII lines to outf
X
X     Sometimes a file contains some nonASCII characters that are in the way.
XThis program allows the lines containing only ASCII characters to be grepped
Xfrom the file.  With the -n flag, the nonASCII lines are grepped.  No matter
Xwhether the flag is used or not, the program returns an exit status of true
Xif the file is pure ASCII, and false otherwise.
X
X
XCommand:	ast - add symbol table to executable file
XSyntax:		ast -xX [file] [symbol_file]
XFlags:		-x do not preserve local symbols
X		-X preserve local symbols (except compiler generated ones)
XExample:	ast -X a.out		# add symbols from symbol.out to a.out
X
X    Ast adds the symbol table produced by the -s option of asld to the 
Xexecutable file.  If no symbol table file is listed, the default name 
X'symbol.out' is used.  The symbol table can be generated by the command
Xcc -s file.c >symbol.out.
X
X
XCommand:	at - execute commands at a later time
XSyntax:		at time [month day] [file]
XFlags:		(none)
XExamples:	at 2315 Jan 31 myfile	# myfile executed Jan 31 at 11:15 pm
X		at 0900			# job input read from stdin
X		at 0711 4 29 		# read from stdin, exec on April 29
X
X     At prepares a file to be executed later at the specified time by creating
Xa special entry in /usr/spool/at.  The program atrun should be started 
Xperiodically, for example, every minute by cron.  Atrun checks to see if any
Xfiles in /usr/spool/at should now be run, and if so, it runs them and then puts
Xthem in /usr/spool/at/past.  The name of the file created in /usr/spool/at by 
Xat is YY.DDD.HHMM.UU (where YY, DDD, HH, and MM give the time to execute and 
XUU is a unique number).  Note that when the command runs, it will not be able 
Xto use standard input or standard output unless specifically redirected.  In 
Xthe first example above, it might be necessary to put >/dev/tty0 on some lines
Xin the shell script myfile.  The same holds for the commands typed directly to
Xat.
X
X
XCommand:	badblocks - put a list of bad blocks in a file
XSyntax:		badblocks block_special
XFlags:		(none)
XExample:	badblocks /dev/fd1
X
X     If a device develops bad sectors, it is important to not have them
Xallocated to important files.  This program makes it possible to collect
Xup to 7 bad blocks into a file, so they will not be allocated for a "real"
Xfile.  When the program starts up, it asks for a list of bad blocks.  Then
Xit creates a file whose name is of the form .Bad_xxxxx, where xxxxx is a pid.
X
X
XCommand:	cal - print a calendar
XSyntax:		cal [month] year
XFlags:		(none)
XExample:	cal 3 1987		# print March 1987
X
X     Cal prints a calendar for a month or year.  The year can be between 1
Xand 9999.  Note that the year 87 is not a synonym for 1987, but is itself a
Xvalid year about 19 centuries ago.  The calendar produced is the one used
Xby England and her colonies.  Try Sept. 1752, Feb 1900, and Feb 2000.  If
Xyou don't understand what is going on, look up "Calendar, Gregorian" in a
Xgood encyclopedia.
X
X
XCommand:	cdiff - context diff
XSyntax:		cdiff [-c] old new
XFlags:		-cN how much context to provide
XExample:	cdiff old new >f	# write context diff on f
X
X     Cdiff produces a context diff by first running 'diff' and then adding
Xcontext.  Some update programs, like patch, can use context diffs to update
Xfiles, even in the presence of other, independent changes.
X
X
XCommand:	compress - compress a file using modified Lempel-Ziv coding
XSyntax:		compress [-cdfv] [file] ...
XFlags:		-c Put output on standard output instead of on file.Z
X		-d Decompress instead of compress
X		-f Force output even if there is no saving
X		-v Verbose mode
XExamples:	compress <infile >outfile	# compress 1 file
X		compress x y z	# compress 3 files to x.Z, y.Z, and z.Z
X
X     The listed files (or standard input, if none are given) are compressed
Xusing the Ziv-Lempel algorithm.  If the output is smaller than the input,
Xthe output is put on file.Z or standard output if no files are listed.
X
X
XCommand:	cpdir - copy a directory and its subdirectories
XSyntax:		cpdir [-v] srcdir destdir
XFlags:		-v Verbose; cpdir tells what it is doing
XExample:	cpdir dir1 dir2	# creat dir2 and copy dir1's files into it
X
X     Cpdir creates the target directory, goes into it, and copies all the
Xfiles in the source directory to it.  When it is done, the target directory
Xcontains the same files as the source directory.  Subdirectories are copied
XRecursively. Links and special files are ignored.
X
X
XCommand:	cron - clock daemon
XSyntax:		cron
XFlags:		(none)
XExample:	/usr/bin/cron		# use absolute path in /etc/rc
X
X     Cron is clock daemon.  It is typically started up by including the
Xcommand /usr/bin/cron in the /etc/rc file.  Once started, cron puts itself
Xin the background, so no & is needed.  It runs forever, sleeping most of
Xthe time.  Once a minute it wakes up and examines /usr/lib/crontab to see
Xif there is any work to do.  If there is, the work is done.  The entries of
X/usr/lib/crontab contain 6 elements each.  Some examples follow:
X
X   min hr dat mo day   command
X    *  *   *  *   *    /usr/bin/date >/dev/tty0   #print date every minute
X    0  *   *  *   *    /usr/bin/date >/dev/tty0   #print date on the hour
X   30  4   *  *  1-5   /bin/backup /dev/fd1       #do backup Mon-Fri at 0430
X   30 19   *  *  1,3,5 /etc/backup /dev/fd1       #Mon, Wed, Fri at 1930
X    0  9  25 12   *    /usr/bin/sing >/dev/tty0   #Xmas morning at 0900 only
X
X
XCommand:	diff - print differences between two files
XSyntax:		diff file1 file2
XFlags:		(none)
XExample:	diff file1 file2	# print differences between 2 files
X
X     Diff compares two files and generates a list of lines telling how
Xthe two files differ.  Lines may not be longer than 128 characters.
X
X
XCommand:	diskcheck - check a disk for bad sectors
XSyntax:		diskcheck device start count
XFlags:		(none)
XExamples:	diskcheck /dev/at0 0 1200	# check 1.2 MB floppy
X		diskcheck /dev/at0 100 1100	# check floppy from block 100
X
X     Diskcheck checks a disk for bad sectors by reading in each sector,
Xwriting a known bit pattern onto it, reading it back in and comparing with
Xwhat was written.  This check is then a second time.  Bad sectors are reported
XAfter each sector is tested, the original sector is restored.
X
X
XCommand:	dis88 - disassembler
XSyntax:		dis88 [-o] infile [outfile]
XFlags:		-o List the object code along with the assembly code
XExamples:	dis88 a.out >listing		# disassemble a.out
X		dis88 -o a.out listing		# ditto, but with object code
X
X     Dis88 is a disassembler.  It takes an executable file and prints the
Xsymbolic assembly code that corresponds to it.  If the executable file contains
Xa symbol table (added by the program ast), the symbol table information is used
Xto give a more readable asembly listing.
X
X
XCommand:	du - print disk usage
XSyntax:		du [-s] dir
XFlags:		-s Summary only
XExample:	du dir			# list disk space used by files in dir
X
X     Du examines a directory and prints the amount of space occupied by the
Xfiles in that directory and its subdirectories.
X
X
XCommand:	ed - editor
XSyntax:		ed file
XFlags:		(none)
XExample:	ed prog.c		# edit prog.c
X
X    Ed is functionally equivalent to the standard V7 editor, ed.  It supports
Xthe following commands:
X	
X	(.)	a: append
X	(.,.)	c: change
X	(.,.)	d: delete
X		e: edit new file
X		f: print name of edited file
X	(1,$)	g: global command
X	(.)	i: insert
X	(.,.+1)	j: join lines together
X	(.)	k: mark
X	(.)	l: print with special characters in octal
X	(.,.)	m: move
X	(.,.)	p: print
X		q: quit editor
X	(.)	r: read in new file
X	(.,.)	s: substitute
X	(1,$)	v: like g, except select lines that do not match
X	(1,$)	w: write out edited file
X
XMany of the commands can take one or two addresses, as indicated above.  The
Xdefaults are shown in parentheses.  Thus 'a' appends to the current line, and
Xg works on the whole file as default.  The dot refers to the current line.
XBelow is a sample editing session with comments given following the # symbol.
X	ed prog.c		# edit prog.c
X	3,20p			# print lines 3 through 20
X	/whole/			# find next occurence of 'whole'
X	s/whole/while/		# replace 'whole' by 'while'
X	g/MAXBUF/s//MAX_BUF/g	# replace 'MAXBUF' by 'MAX_BUF' everywhere
X	w			# write the file back
X	q			# exit the editor
X	
X
XCommand:	expr - evaluate experession
XSyntax:		expr arg ...
XFlags:		(none)
XExample:	x=`expr $x + 1`		# add 1 to shell variable x
X
X     Expr computes the value of its argument and writes the result on
Xstandard output.  The valid operators, in order of increasing precedence,
Xare listed below.  Operators grouped by {...} have the same precedence.
XOperators: |, &, {<, <=, ==, !=, >=, >}, {+, -}, *.
X     Note that the V7 ":" operator is missing.  Parentheses are permitted.
X
X
XCommand:	factor - factor an integer less than 2**31
XSyntax:		factor number
XFlags:		(none)
XExample:	factor 450180	# print the prime factors of 450180
X
X     Factor prints the prime factors of its argument in increasing order.
XEach factor is printed as many times as it appears in the number.
X
X
XCommand:	fgrep - fast grep
XSyntax:		fgrep [-cfhlnsv] [file] [string] [file] ...
XFlags:		-c count matching lines and only print count, not the lines
X		-f take strings from file named in following argument
X		-h omit file headers from printout
X		-l list file names once only
X		-n each line is preceded by its line number
X		-s status only, no output
X		-v print only lines not matching
XExamples:	fgrep # prog.c			# print lines containing # sign
X		fgrep -f pattern prog.c		# take strings from 'pattern'
X
X     Fgrep is essentially the same as grep, except that it only searches for
Xlines containing literal strings (no wildcard characters), and it is much
Xfaster.
X
X
XCommand:	file - make a guess as to a file's type based on contents
XSyntax:		file name ...
XFlags:		(none)
XExample:	file a.out /usr/include/ar.h	# guess at types
X
X     File reads the first block of a file and tries to make an intelligent
Xguess about what kind of file it is.  It understands about archives, C
Xsource programs, executable binaries, shell scripts, and English text.
X
X
XCommand:	find - find files meeting a given condition
XSyntax:		find directory expression
XFlags:		(none)
XExamples:	find /  -name a.out -print	# print all a.out paths
X		find /usr/ast ! -newer f -ok rm {} \;	# ask before removing
X		find /usr -size +20 -exec mv {} /big \; # move files > 20 blks
X		find / \( -name a.out -o -name `*.o` \) -exec rm {}\;
X
X     Find descends the file tree starting at the given directory checking
Xeach file in that directory and its subdirectories against a predicate.
XIf the predicate is true, an action is taken.  The predicates may be
Xconnected by -a (Boolean and), -o (Boolean or) and ! (Boolean negation).
XEach predicate is true under the conditions specified below.  The integer n
Xmay also be +n to mean any value greater than n, -n to mean any value less than
Xn, or just n for exactly n.
X  -name s	true if current filename is s (include shell wild cards)
X  -size n	true if file size is n blocks
X  -inum n	true if the current file's i-node number is n
X  -mtime n	true if modification time relative to today (in days) is n
X  -links n	true if the number of links to the file is n
X  -newer f	true if the file is newer than f
X  -perm n	true if the file's permission bits = n (n is in octal)
X  -user u	true if the uid = u (a numerical value, not a login name)
X  -grogp g	true if the gid = g (a numerical value, not a group name)
X  -type x	where x is bcdfug (block, char, dir, regular, setuid, setgid)
X
XFollowing the expression can be one of the following, telling what to do
Xwhen a file is found:
X  -print	print the file name on standard output
X  -exec		execute a MINIX command, {} stands for the file name
X  -ok		prompts before executing the command
X
X
XCommand:	fdisk - partition a hard disk
XSyntax:		fdisk file
XFlags:		(none)
XExample:	fdisk /dev/hd1
X
X     When fdisk starts up, it reads in the partition table and displays it.
XIt then presents a menu to allow the user to modify partitions, store the
Xpartition table on a file, or load it from a file.  Partitions can be marked
Xas DOS or non-DOS, and active or not.  MINIX doesn't care what kind of a
Xpartition it uses.  Using fdisk is self-explanatory.  However, be aware that
Xrepartitioning a disk may cause information on it to be lost.  Rebooting the
Xsystem is mandatory after changing partition sizes.  MINIX, XENIX, PC-IX, and
XMS-DOS all have different ideas about how partitions are numbered.
X
X
XCommand:	fix - generate new file from old one and diff listing
XSyntax:		fix oldfile difflist >newfile
XFlags:		(none)
XExample:	fix old difflist >new	# generate new from old and diffs
X
X     Fix accepts a diff listing produced by diff and reconstructs the
Xnew file.  It is common for people to take a file, modify it, and then
Xsend the diff listing between the old and new files to other people.
XUsing fix, the old file, and the diff listing, it is possible to creat
Xthe new file.  For example:
X
X  diff oldfile newfile >difflist
X  fix oldfile difflist >new2
X
Xwill generate a file new2 that is identical to newfile.
X
X
XCommand:	from - input half of a connection
XSyntax:		from port
XFlags:		(none)
XExamples:	from port | sort >x	# fetch and sort an incoming file
X		from port | sh		# primitive sherver
X
X     To and from are used together to provide connection-oriented service.
XOn the sending machine, the last member of a pipeline is 'to port'.  On the
Xreceiving machine, the first member of a pipe line is 'from port'.  The net
Xresult is that the output of the sending pipeline goes into the input of the
Xreceiving pipeline, making pipelines work across the network. 
X
X
XCommand:   	fsck - perform file system consistency check
XSyntax:	   	fsck [-aclmrs] [device] ...
XFlags:	   	-a automatically repair inconsistencies
X	   	-c inode ...	check and list only the specified inodes
X	 	-l list the files and directories in the filesytem
X	  	-m make a new file system
X	   	-r prompt user for repairs if inconsistencies are found
X	  	-s list the superblock of the file system
XExamples: 	fsck /dev/hd4	# check file system on /dev/hd4
X	 	fsck -a /dev/at0	# automatically fix errors on /dev/at0
X	   	fsck -l /dev/fd0	# list the contents of /dev/fd0
X	   	fsck -c 2 3 /dev/hd3	# check and list inodes 2 & 3 on /dev/hd3
X
X     Fsck performs consistency checks on the file systems which reside on the
Xspecified devices.  It may also be used to list the contents of a file system 
Xor to make a new file system.
X
X
XCommand:	lorder - compute the order for library modules
XSyntax:		lorder file ...
XFlags:		(none)
XExample:	lorder proc1.s proc2.s
X
X     Lorder accepts a series of packed or unpacked .s files and libraries,
Xand produces a partial ordering suitable for processing by tsort.
X
X
XCommand:	master - control the creation of shervers
XSyntax:		master count uid gid command
XFlags:		(none)
XExample:	master 2 1 1 /usr/bin/sherver port
X
X     If a machine is intended to be used as a server, its /etc/rc file should
Xhave a command similar to the example above.  When the system is booted, master
Xruns and forks off the required number of shervers (max 4).  They run with the
Xindicated uid and gid, and listen to the indicated port.  When an rsh is done
Xon a client machine, the command is given to one of the shervers for execution.
XWhen the sherver is done, it exits, master, which is always running, sees this,
Xand creates a new sherver.  Thus master is very similar to init, only it makes
Xnew shervers (usually) instead of new login programs.  Master must run as root
Xto be able to do setuid and setgid.
X
XCommand:	more - pager
XSyntax:		more file ...
XFlags:		(none)
XExample:	more file		# display file on the screen
X
X     More is an alternative to mined as a pager, for people used to the
X4.x BSD pager.  This version only implements three commands:
X   <space>  - display next page
X   <return> - display next line
X   q        - exit more
X
X
XCommand:	nm - print name list
XSyntax:		nm [-gnopru] [file] ...
XFlags:		-g print only external symbols.
X		-n sort numerically rather than alphabetically.
X		-o prepend file name to each line rather than only once.
X		-p don't sort, print in symbol-table order.
X		-r sort in reverse order.
X		-u print only undefined symbols.
XExamples:	nm -n a.out		# print all symbols in numerical order
X		nm -g a.out		# print global symbols alphabetically
X
X    Nm prints the symbol table of executable files when it is available.
XIf no file is given, the symbols in a.out are used.  The format of the table 
Xis somewhat compatible with the one produced  by asld when used with the -s 
Xoption. The symbol table can be added with ast.  Archives are not supported. 
XNote that assembly language files don't have symbol tables.
X
X
XCommand:	paste - paste multiple files together
XSyntax:		paste [-s] [-ddelim] file ...
XFlags:		-s print files sequentially, file k on line k
X		-ddelim set delimiter used to separate columns
XExamples:	paste file1 file2	# print file1 in col 1, file2 in col 2
X		paste -s f1 f2 f3 f4	# print f1 on line 1, f2 on line 2, etc
X
X     Paste displays multiple files in parallel.  Suppose a set of k files each
Xhave one word per line.  Then the paste output will have k columns, with the
Xcontents of file j in column j.  The columns are separate by tabs unless the
Xseparator is changed with the -d flag.  If the -s flag is given, then the first
Xfile is on line 1, the second file on line 2, etc.  In effect, -s turns the
Xfiles sideways.
X
X
XCommand:	patch - patches up a file from the original and a diff
XSyntax:		patch [-bcdDefFlnNop]
XFlags:		-b next argument is backup extension, instead of .orig
X		-c interpret the patch file as a context diff
X		-d cd to the next arg (assumed a dir) before doing anything
X		-D mark changes with "#ifdef...#endif"; next arg gives label
X		-e interpret the patch file as an ed script
X		-f forces patch to do its work without asking any questions
X		-F# sets the maximum fuzz factor
X		-l do matching loosely (e.g., all white space is equivalent)
X		-n interpret the patch file as a normal diff
X		-N ignore patches that are reversed or already applied
X		-o next argument is the output file name
X		-p# sets the pathname strip count
XExample:	patch file difflist		# fix up the file
X
X     Patch takes an original file and a diff listing and recreates the new
Xfile.  It is functionally similar to fix, but much more powerful.  Not only
Xcan it handle normal diffs, but also context diffs produced by cdiff.  In
Xaddition, it works even when the file being patched has other changes to it.
XIt deduces the type of difflist itself (unless given -c, -e, or -n).
XThe normal usage is given in the example above.  In this case patch will
Xmodify 'file' to incorporate all the patches.  The original file will be put
Xon 'file~.
X
X
XCommand:	prep - prepare a text file for statistical analysis
XSyntax:		prep [file]
XFlags:		(none)
XExamples:	prep infile >outfile		# prep infile
X		prep <infile >outfile		# prep infile
X
X     Prep strips off most of the troff commands from a text file and then
Xoutputs all the words, one word per line, in the order they occur in the file.
XThis file can then be sorted and compared to a dictionary (as a spelling
Xchecker), or used for statistical analyses.
X
X
XCommand:	printenv - print out the current environment
XSyntax:		printenv
XFlags:		(none)
XExample:	printenv		# print the environment
X
X     Printenv prints out the current environment strings, one per line.
X
X
XCommand:	rcp - remote copy
XSyntax:		rcp [mach1]!file1 [mach2]!file2
XFlags:		(none)
XExamples:	rcp file mach1!/usr/ast/x	# local file to remote machine
X		rcp mach2!/usr/ast/x file	# fetch remote file
X
X     Rcp is not a program.  It is a shell script that does remote copying.  It
Xmakes use of the programs 'to' and 'from'.
X
X
XCommand:	readfs - read a MINIX file system
XSyntax:		readfs [-il] block_special [dir]
XFlags:		-i Give information about the file, but do not extract files
X		-l List the files extracted on standard output
XExample:	readfs -l /dev/fd0
X
X     Readfs reads a floppy disk containing a MINIX file system.  It can
Xextract all the files from it, give a listing of them, or both.  The files
Xextracted can be put in a user-specified directory (default: current
Xdirectory).  If subdirectories are needed, they will be created automatically.
X
X
XCommand:	rsh - remote shell for networking
XSyntax:		rsh port [-beil]
XFlags:		-b start the rsh in the background
X		-e keep stderr separate from stdout
X		-i take input from the local process
XExamples:	rsh machine5 ls -l /usr/bin	# list remote bin directory
X		rsh abc cat /usr/doc/f >f	# fetch remote file
X		rsh foobar			# log onto remote machine
X
X     The remote shell command is the way to have a distant server carry out
Xa command over the Ethernet.  The port given as the first argument can be
Xany string of up to 6 characters, but it must match the port used by some
Xsherver.  The command will be executed and the results returned on stdout.
XUnless the -e flag is given, the remote stderr and stdout are merged onto the
Xlocal stdout.  Giving rsh with just a port and no argument is the standard way
Xto log onto a remote machine.
X
X
XCommand:	sherver - shell server
XSyntax:		sherver port
XFlags:		(none)
XExample:	sherver machine1
X
X     The rsh command does its remote execution by doing a remote procedure call
Xto some sherver.  The sherver executes the command and then exits.  Usually a
Xmaster will be running to make a new one.  Because shervers get their input 
Xfrom a pipe, remote execution cannot handle signals and CTRL-D, because they
Xcannot be sent down a pipe.
X
X
XCommand:	spell - print all words in a file not present in the dictionary
XSyntax:		spell file
XFlags:		(none)
XExample:	spell document		# print the spelling errors on stdout
X
X     Spell is the MINIX spelling checker.  It is actually a short shell script.
XFirst, the program prep strips off the roff, nroff, and troff control lines,
Xand the punctuation, and lists each word on a separate line.  These words are
Xthen sorted.  The resulting output is then compared to the dictionary.  Words
Xpresent in the file but not present in the dictionary are listed.  The
Xdictionary should be located in /usr/lib (or the shell script changed).
X
X
XCommand:	strings - print all the strings in a binary file
XSyntax:		strings file ...
XFlags:		(none)
XExample:	strings a.out		# print the strings in a.out
X
X     Strings looks for sequences of ASCII characters followed by a zero byte.
XThese are usually strings.  This program is typically used to help identify
Xunknown binary programs
X
X
XCommand:	strip - remove symbol table from executable file
XSyntax:		strip [file] ...
XFlags:		(none)
XExample:	strip a.out		# remove symbols from a.out
X
X    For each file argument, strip removes the symbol table.  Strip makes a 
Xcopy of the file being stripped, so links are lost.
X
X
XCommand:	term - turn PC into a dumb terminal
XSyntax:		test [baudrate] [parity] [bits_per_character]
XFlags:		(none)
XExamples:	term 2400		# talk to modem at 2400 baud
X		term 1200 7 even	# 1200 baud, 7 bits/char, even parity
X		term 8 9600		# 9600 baud, 8 bits/char, no parity
X
X     Term allows MINIX to talk to a terminal or modem over RS232 port 1.  The
Xprogram first sets the baudrate, parity and character length, and then forks.
XThe parent sits in a loop copying from standard input (usually the console's
Xkeyboard), to the terminal or modem (/dev/tty1).  The child sits in a loop
Xcopying from the terminal or modem (/dev/tty1) to standard output.  Thus when
XRS232 port 1 is connected to a modem, every keystroke typed on the keyboard
Xis sent to the modem, and every character arriving from the modem is displayed.
XStandard input and output may be redirected, to provide a primitive file
Xtransfer program, with no checking.  To exit term, type three ESC characters.
XImportant note: to use term, it is essential that /etc/ttys is configured so
Xthat there is no shell hanging on /dev/tty1.  If there is, both the shell and
Xterm will try to read from /dev/tty1, and nothing will work.
X
X
XCommand:	termcap - print the current termcap entry
XSyntax:		termcap
XFlags:		(none)
XExample:	termcap			# print the termcap entry
X
X     Termcap reads the /etc/termcap entry corresponding to the current shell
Xvariable $TERM.  It then prints out all the parameters that apply.
X
X
XCommand:	test - test for a condition
XSyntax:		test expr
XFlags:		(none)
XExample:	test -r file		# see if file is readable
X
X     Test checks to see if files exist, are readable, etc. and returns
Xan exit status of zero if true and nonzero if false.  The legal operators are
X  -r file  true if the file is readable
X  -w file  true if the file is writable
X  -x file  true if the file is executable
X  -f file  true if the file is not a directory
X  -d file  true if the file is a directory
X  -s file  true if the file exists and has a size > 0
X  -t fd    true if file descriptor fd (default 1) is a terminal
X  -z s     true if the string s has zero length
X  -n s     true if the string s has nonzero length
X  s1 = s2  true if the strings s1 and s2 are identical
X  s1 != s2 true if the strings s1 and s2 are different
X  m -eq m  true if the integers m and n are numerically equal
X                The operators -gt, -ge, -ne, -le, -lt may be used as well
X
XThese operands may be combined with -a (Boolean and), -o (Boolean or), !
X(negation).  The priority of -a is higher than that of -o.  Parentheses are 
Xpermitted, but must be escaped to keep the shell from trying to interpret them.
X
X
XCommand:	to - output half of a connection
XSyntax:		to port
XFlags:		(none)
XExample:	cat f1 f2 | to mach4	# send the catted files to port
X
X     To and from are used together to provide connection-oriented service.
XOn the sending machine, the last member of a pipeline is 'to port'.  On the
Xreceiving machine, the first member of a pipe line is 'from port'.  The net
Xresult is that the output of the sending pipeline goes into the input of the
Xreceiving pipeline, making pipelines work across the network. As a simple
Xexample, consider:
X	on machine1:	cat f1 f2 | to Johnny
X	on machine2:	from Johnny | sort >x
XThe effect of these two commands is that the files f1 and f2 are concatenated,
Xtransferred to machine 2, and sorted their, with the output going to a file x
Xon machine 2.  The string Johnny is used by the transaction system to identify
Xwhich sender goes with which receiver; any unique string can be used.
X
X
XCommand:	traverse - print directory tree under the named directory
XSyntax:		traverse dir
XFlags:		(none)
XExample:	traverse .		# print tree starting at working dir
X
X     Traverse prints the tree structure starting at the named directory.  All
Xthe subdirectories are listed, with the depth shown by indentation.
X
X
XCommand:	tsort - topological sort
XSyntax:		tsort file
XFlags:		(none)
XExample:	ar cr libc.a `lorder *.s | tsort`	# build library
X
X     Tsort accepts a file of lines containing ordered pairs and builds a
Xtotal ordering from the partial orderings.
X
X
XCommand:	treecmp - recursively list differences in two directory trees
XSyntax:		treecmp [-v] dir1 dir2
XFlags:		-v (verbose) list all directories processed
XExample:	treecmp -v /usr/ast/V1 /usr/ast/V2
X
X     Treecmp recursively descends the directory tree of its first argument
Xand compares all files to those at the corresponding position in the second
Xargument.  If the two trees are identical, i.e., all the corresponding
Xdirectories and files are the same, there is no output.  Otherwise, a list
Xof files missing from one of the trees or present in both but whose contents
Xare not identical in both are printed.
X
X
XCommand:	tty - print the device name of this tty
XSyntax:		tty
XFlags:		(none)
XExample:	tty
X
X     Print the name of the controlling tty.
X
X
XCommand:	vol - split standard input into diskette-sized volumes
XSyntax:		vol [-u] size block-special
XFlags:		-u unsave from diskettes
XExamples:	tar c - . | vol 360 /dev/fd0	# prompt for disk every 360K
X		vol -u 360 /dev/fd0 | tar x -	# restore a saved file system
X
X     It occasionally happens that a program generates an output stream intended
Xfor diskette but the stream is to large to fit on one diskette.  Vol is a
Xprogram that accepts such a stream, and pauses every n blocks to request a
Xnew diskette to be inserted.  This makes it possible to save arbitrarily long
Xstreams on a series of diskettes, as shown in the examples above.
X
X
XCommand:	whereis - examine system directories for a given file
XSyntax:		whereis file
XFlags:		(none)
XExample:	whereis	stat.h		# prints: /usr/include/sys/stat.h
X
X     Whereis searches a fixed set of system directories, /bin, /lib, /usr/bin,
Xand others, and prints all occurrences of the argument name in any of them.
X
X
XCommand:	which - examine $PATH to see which file will be executed
XSyntax:		which name
XFlags:		(none)
XExample:	which a.out		# tells which a.out will be executed
X
X     The $PATH shell variable controls the MINIX search rules. If a command
Xa.out is given, the shell first tries to find an executable file in the working
Xdirectory.  If that fails, it looks in various system directories, such as /bin
Xand /usr/bin.  The which command makes the same search and gives the absolute
Xpath of the program that will be chosen.
X
X
XCommand:	who - print list of currently logged in users
XSyntax:		who
XFlags:		(none)
XExample:	who			# print user names, terminals and times
X
X     Who prints a list of currently logged in users.  For each one, the user
Xname, terminal, and login time is printed.  This program gets its information
Xfrom the file /usr/adm/wtmp, which is updated by init and login.  If the file
Xdoes not exist, neither of these will create it, and 'who' will not work.  Note
Xthat if you decide to create an empty /usr/adm/wtmp to enable the login
Xaccounting, it will grow forever and eventually fill up your disk unless you
Xmanually truncate it from time to time.
X
X
XCommand:	whoami - print current user name
XSyntax:		whoami
XFlags:		(none)
XExample:	whoami			# print user name
X
X     In case you forget who you are logged in as, whoami will tell you.  If
Xyou use 'su' to become somebody else, whoami will give the current effective
Xuser.
X
X
XCommand:	uuencode - encode a binary file to ASCII (e.g., for mailing)
XSyntax:		uuencode [input] output
XFlags:		(none)
XExample:	uuencode infile <infile >outfile	# encode infile
X
X     Uuencode takes an input file, typically a binary file, and converts it
Xto pure ASCII by encoding 3 bytes (24 bits) as 4 bytes in ASCII.  Only 64
Xdifferent characters are used, all of them valid ASCII characters.
X
X
XCommand:	uudecode - decode a binary file encoded with uuencode
XSyntax:		uudecode file 
XFlags:		(none)
XExample:	uudecode encodedfile 	# re-create the original file
X
X     Uudecode takes an input file, typically a uuencoded binary file, and 
Xconverts it back to the original file.  The decoded file is given the name
Xthat the original file had.  The name information is part of the encoded file.
X
X
+ END-OF-FILE man_pages
chmod 'u=rw,g=r,o=r' 'man_pages'
set `wc -c 'man_pages'`
count=$1
case $count in
32104)	:;;
*)	echo 'Bad character count in ''man_pages' >&2
		echo 'Count should be 32104' >&2
esac
exit 0