3951 lines
170 KiB
Plaintext
3951 lines
170 KiB
Plaintext
echo x - asld.7
|
|
sed '/^X/s///' > asld.7 << '/'
|
|
XName: asld - info about the old Minix 8086 assembler (obsolete)
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.1. ASLD - ASSEMBLER-LOADER [IBM]
|
|
X
|
|
X The assembly language expected by the MINIX assembler for the 8088,
|
|
Xasld, is identical to that of PC-IX, the version of UNIX IBM originally
|
|
Xsupported on the PC.
|
|
X
|
|
X10.1.1. Tokens, Numbers, Character Constants, and Strings
|
|
X
|
|
X The syntax of numbers is the same as in C. The constants 32, 040,
|
|
Xand 0x20 all represent the same number, but are written in decimal,
|
|
Xoctal, and hex, respectively. The rules for character constants and
|
|
Xstrings are also the same as in C. For example, 'a' is a character
|
|
Xconstant. A typical string is '' string''.
|
|
X
|
|
X10.1.2. Symbols
|
|
X
|
|
X Symbols contain letters and digits, as well as three special
|
|
Xcharacters: dot, tilde, and underscore. The first character may not be
|
|
Xa digit or tilde. Only the first 8 characters are significant. Thus
|
|
X``hippopotamus'' and ``hippopotapig'' cannot both be defined as
|
|
Xexternal symbols.
|
|
X The names of the 8088 registers are reserved. These are:
|
|
X al, bl, cl, dl
|
|
X ah, bh, ch, dh
|
|
X ax, bx, cx, dx
|
|
X si, di, bp, sp
|
|
X cs, ds, ss, es
|
|
X bx_si, bx_di, bp_si, bp_di
|
|
XThe last group of 4 are used for base + index mode addressing, in which
|
|
Xtwo registers are added to form the effective address.
|
|
X Names of instructions and pseudo-ops are not reserved. Alphabetic
|
|
Xcharacters in opcodes and pseudo-ops must be in lower case.
|
|
X
|
|
X10.1.3. Separators
|
|
X
|
|
X Commas, blanks, and tabs are separators and can be interspersed
|
|
Xfreely between tokens, but not within tokens. Commas are only legal
|
|
Xbetween operands.
|
|
X
|
|
X10.1.4. Comments
|
|
X
|
|
X The comment character is ``|''. The rest of the line is ignored.
|
|
X
|
|
X10.1.5. Opcodes
|
|
X
|
|
X The opcodes are listed below. Notes: (1) Different names for the
|
|
Xsame instruction are separated by ``/''. (2) Square brackets ([])
|
|
Xindicate that 0 or 1 of the enclosed characters can be included. (3)
|
|
XCurly brackets ({}) work similarly, except that one of the enclosed
|
|
Xcharacters must be included. Thus square brackets indicate an option,
|
|
Xwhereas curly brackets indicate that a choice must be made.
|
|
X
|
|
XData Transfer
|
|
X mov[b] dest, source | Move word/byte
|
|
X mov{bw} dest, source | Move word/byte from source to dest
|
|
X pop dest | Pop stack
|
|
X push source | Push stack
|
|
X xchg op1, op2 | Exchange word/byte
|
|
X xlat | Translate
|
|
X
|
|
XInput/Output
|
|
X in[w] source | Input from source I/O port
|
|
X in[w] | Input from DX I/O port
|
|
X out[w] dest | Output to dest I/O port
|
|
X out[w] | Output to DX I/O port
|
|
X
|
|
XAddress Object
|
|
X lds reg,source | Load reg and DS from source
|
|
X les reg,source | Load reg and ES from source
|
|
X lea reg,source | Load effect address of source to reg and DS
|
|
X seg reg | Specify seg register for next instruction
|
|
X
|
|
XFlag Transfer
|
|
X lahf | Load AH from flag register
|
|
X popf | Pop flags
|
|
X pushf | Push flags
|
|
X sahf | Store AH in flag register
|
|
X
|
|
XAddition
|
|
X aaa | Adjust result of BCD addition
|
|
X add[b] dest,source | Add
|
|
X adc[b] dest,source | Add with carry
|
|
X daa | Decimal Adjust acc after addition
|
|
X inc[b] dest | Increment by 1
|
|
X
|
|
XSubtraction
|
|
X aas | Adjust result of BCD subtraction
|
|
X sub[b] dest,source | Subtract
|
|
X sbb[b] dest,source | Subtract with borrow from dest
|
|
X das | Decimal adjust after subtraction
|
|
X dec[b] dest | Decrement by one
|
|
X neg[b] dest | Negate
|
|
X cmp[b] dest,source | Compare
|
|
X cmp{bw} dest,source | Compare
|
|
X
|
|
XMultiplication
|
|
X aam | Adjust result of BCD multiply
|
|
X imul[b] source | Signed multiply
|
|
X mul[b] source | Unsigned multiply
|
|
X
|
|
XDivision
|
|
X aad | Adjust AX for BCD division
|
|
X cbw | Sign extend AL into AH
|
|
X cwb | Sign extend AX into DX
|
|
X idiv[b] source | Signed divide
|
|
X div[b] source | Unsigned divide
|
|
X
|
|
XLogical
|
|
X and[b] dest,source | Logical and
|
|
X not[b] dest | Logical not
|
|
X or[b] dest,source | Logical inclusive or
|
|
X test[b] dest,source | Logical test
|
|
X xor[b] dest,source | Logical exclusive or
|
|
X
|
|
XShift
|
|
X sal[b]/shl[b] dest,CL| Shift logical left
|
|
X sar[b] dest,CL | Shift arithmetic right
|
|
X shr[b] dest,CL | Shift logical right
|
|
X
|
|
XRotate
|
|
X rcl[b] dest,CL | Rotate left, with carry
|
|
X rcr[b] dest,CL | Rotate right, with carry
|
|
X rol[b] dest,CL | Rotate left
|
|
X ror[b] dest,CL | Rotate right
|
|
X
|
|
XString Manipulation
|
|
X cmp[b] | Compare
|
|
X cmp{bw} | Compare
|
|
X lod{bw} | Load into AL or AX
|
|
X mov[b] | Move
|
|
X mov{bw} | Move
|
|
X rep | Repeat next instruction until CX=0
|
|
X repe/repz | Repeat next instruction until CX=0 and ZF=1
|
|
X repne/repnz | Repeat next instruction until CX!=0 and ZF=0
|
|
X sca{bw} | Compare string element ds:di with AL/AX
|
|
X sto{bw} | Store AL/AX in ds:di
|
|
X
|
|
XControl Transfer
|
|
X Displacement is indicated by opcode; ``jmp'' generates a 16-bit
|
|
Xdisplacement, and ``j'' generates 8 bits only. The provision for
|
|
X``far'' labels is described below.
|
|
X Asld accepts a number of special branch opcodes, all of which begin
|
|
Xwith ``b''. These are meant to overcome the range limitations of the
|
|
Xconditional branches, which can only reach to targets within - 126 to
|
|
X+129 bytes of the branch (``near'' labels). The special ``b''
|
|
Xinstructions allow the target to be anywhere in the 64K-byte address
|
|
Xspace. If the target is close enough, a simple conditional branch is
|
|
Xused. Otherwise, the assembler automatically changes the instruction
|
|
Xinto a conditional branch around a "jmp".
|
|
X The English translation of the opcodes should be obvious, with the
|
|
Xpossible exception of the unsigned operations, where ``lo'' means
|
|
X``lower,'' ``hi'' means ``higher,'' and ``s'' means ``or same''.
|
|
X The ``call'', ``jmp'', and ``ret'' instructions can be either
|
|
Xintrasegment or intersegment. The intersegment versions are indicated
|
|
Xwith the suffix ``i''.
|
|
X
|
|
XUnconditional
|
|
X br dest | jump, 16-bit displacement, to dest
|
|
X j dest | jump, 8-bit displacement, to dest
|
|
X call[i] dest | call procedure
|
|
X jmp[i] dest | jump, 16-bit displacement, to dest
|
|
X ret[i] | return from procedure
|
|
X
|
|
XConditional with 16-bit Displacement
|
|
X beq | branch if equal
|
|
X bge | branch if greater or equal (signed)
|
|
X bgt | branch if greater (signed)
|
|
X bho | branch if higher (unsigned)
|
|
X bhis | branch if higher or same (unsigned)
|
|
X ble | branch if less or equal (signed)
|
|
X blt | branch if less (signed)
|
|
X blo | branch if lower (unsigned)
|
|
X blos | branch if lower or same (unsigned)
|
|
X bne | branch if not equal
|
|
X
|
|
XConditional with 8-bit Displacement
|
|
X ja/jnbe | if above/not below or equal (unsigned)
|
|
X jae/jnb/jnc | if above or equal/not below/not carry (unsigned)
|
|
X jb/jnae/jc | if not above nor equal/below/carry (unsigned)
|
|
X jbe/jna | if below or equal/not above (unsigned)
|
|
X jg/jnle | if greater/not less nor equal (signed)
|
|
X jge/jnl | if greater or equal/not less (signed)
|
|
X jl/jnqe | if less/not greater nor equal (signed)
|
|
X jle/jgl | if less or equal/not greater (signed)
|
|
X je/jz | if equal/zero
|
|
X jne/jnz | if not equal/not zero
|
|
X jno | if overflow not set
|
|
X jo | if overflow set
|
|
X jnp/jpo | if parity not set/parity odd
|
|
X jp/jpe | if parity set/parity even
|
|
X jns | if sign not set
|
|
X js | if sign set
|
|
X
|
|
XIteration Control
|
|
X jcxz dest | jump if CX = 0
|
|
X loop dest | Decrement CX and jump if CX != 0
|
|
X loope/loopz dest| Decrement CX and jump if CX = 0 and ZF = 1
|
|
X loopne/loopnz dest| Decrement CX and jump if CX != 0 and ZF = 0
|
|
X
|
|
XInterrupt
|
|
X int | Software interrupt
|
|
X into | Interrupt if overflow set
|
|
X iret | Return from interrupt
|
|
X
|
|
XFlag Operations
|
|
X clc | Clear carry flag
|
|
X cld | Clear direction flag
|
|
X cli | Clear interrupt enable flag
|
|
X cmc | Complement carry flag
|
|
X stc | Set carry flag
|
|
X std | Set direction flag
|
|
X sti | Set interrupt enable flag
|
|
X
|
|
XExternal Synchronization
|
|
X esc source | Put contents of source on data bus
|
|
X hlt | Halt until interrupt or reset
|
|
X lock | Lock bus during next instruction
|
|
X wait | Wait while TEST line not active
|
|
X
|
|
X
|
|
X10.1.6. Location Counter
|
|
X
|
|
X The special symbol ``.'' is the location counter and its value is
|
|
Xthe address of the first byte of the instruction in which the symbol
|
|
Xappears and can be used in expressions.
|
|
X
|
|
X10.1.7. Segments
|
|
X
|
|
X There are three different segments: text, data and bss. The current
|
|
Xsegment is selected using the .text, .data or .bss pseudo-ops. Note
|
|
Xthat the ``.'' symbol refers to the location in the current segment.
|
|
X
|
|
X10.1.8. Labels
|
|
X
|
|
X There are two types: name and numeric. Name labels consist of a
|
|
Xname followed by a colon (:).
|
|
X Numeric labels consist of one or more digits followed by a dollar
|
|
X($). Numeric labels are useful because their definition disappears as
|
|
Xsoon as a name label is encountered; thus numeric labels can be reused
|
|
Xas temporary local labels.
|
|
X
|
|
X10.1.9. Statement Syntax
|
|
X
|
|
X Each line consists of a single statement. Blank or comment lines
|
|
Xare allowed.
|
|
X
|
|
X10.1.10. Instruction Statements
|
|
X
|
|
X The most general form of an instruction is
|
|
X label: opcode operand1, operand2 | comment
|
|
X
|
|
X10.1.11. Expression Semantics
|
|
X
|
|
X The following operator can be used: + - * / & ! < (shift left) >
|
|
X(shift right) - (unary minus). Sixteen-bit integer arithmetic is used.
|
|
XDivision produces a truncated quotient.
|
|
X
|
|
X10.1.12. Addressing Modes
|
|
X
|
|
X Below is a list of the addressing modes supported. Each one is
|
|
Xfollowed by an example.
|
|
X 8-bit constant mov ax, *2
|
|
X 16-bit constant mov ax, #12345
|
|
X direct access (16 bits) mov ax, counter
|
|
X register mov ax, si
|
|
X index mov ax, (si)
|
|
X index + 8-bit disp. mov ax, *6(bp)
|
|
X index + 16-bit disp. mov ax, #400(bp)
|
|
X base + index movax, (bp_si)
|
|
X base + index + 8-bit disp. mov ax, *14(bp_si)
|
|
X base + index + 16-bit disp. mov ax, #-1000(bp_si)
|
|
X
|
|
XAny the constant or symbol may be replaced by an expression. Direct
|
|
Xaccess, 16-bit constants and displacements may be any type of
|
|
Xexpression. However, 8-bit constants and displacements must be
|
|
Xabsolute expressions.
|
|
X
|
|
X10.1.13. Call and Jmp
|
|
X
|
|
X With the ``call'' and ``jmp'' instructions, the operand syntax shows
|
|
Xwhether the call or jump is direct or indirect; indirection is
|
|
Xindicated with an ``@'' before the operand.
|
|
X call _routine | Direct, intrasegment
|
|
X call @subloc | Indirect, intrasegment
|
|
X call @6(bp) | Indirect, intrasegment
|
|
X call (bx) | Direct, intrasegment
|
|
X call @(bx) | Indirect, intrasegment
|
|
X calli @subloc | Indirect, intersegment
|
|
X calli cseg, offs | Direct, intersegment
|
|
X
|
|
XNote that call (bx) is considered direct, though the register is not
|
|
Xcalled, but rather the location whose address is in the register. With
|
|
Xthe indirect version, the register points to a location which
|
|
Xcontains the location of the routine being called.
|
|
X
|
|
X
|
|
X10.1.14. Symbol Assigment
|
|
X
|
|
X
|
|
X Symbols can acquire values in one of two ways. Using a symbol as a
|
|
Xlabel sets it to ``.'' for the current segment with type relocatable.
|
|
XAlternative, a symbol may be given a name via an assignment of the form
|
|
X symbol = expression
|
|
Xin which the symbol is assigned the value and type of its arguments.
|
|
X
|
|
X
|
|
X10.1.15. Storage Allocation
|
|
X
|
|
X
|
|
X Space can be reserved for bytes, words, and longs using pseudo-ops.
|
|
XThey take one or more operands, and for each generate a value whose
|
|
Xsize is a byte, word (2 bytes) or long (4 bytes). For example:
|
|
X .byte 2, 6 | allocate 2 bytes initialized to 2 and 6
|
|
X .word 3, 0x10 | allocate 2 words initialized to 3 and 16
|
|
X .long 010 | allocate a long initialized to 8
|
|
X .zerow 20 | allocates 20 words of zeroes
|
|
Xallocates 10 (decimal) bytes of storage, initializing the first two
|
|
Xbytes to 2 and 6, the next two words to 3 and 16, and the last 4 bytes
|
|
Xto a long with value 8 (010 octal).
|
|
X
|
|
X10.1.16. String Allocation
|
|
X
|
|
X The pseduo-ops .ascii and .asciz take one string argument and
|
|
Xgenerate the ASCII character codes for the letters in the string. The
|
|
Xlatter automatically terminates the string with a null (0) byte. For
|
|
Xexample,
|
|
X .ascii "hello"
|
|
X .asciz "world\n"
|
|
X
|
|
X10.1.17. Alignment
|
|
X
|
|
X Sometimes it is necessary to force the next item to begin at an even
|
|
Xaddress. The .even pseudo-op generates a null byte if the current
|
|
Xlocation is odd, and nothing if it is even.
|
|
X
|
|
X10.1.18. Segment Control
|
|
X
|
|
X Every item assembled goes in one of the three segments: text, data,
|
|
Xor bss. By using the .text, .data and .bss pseudo-ops, the programmer
|
|
Xcan force the next items to go in a particular segment.
|
|
X
|
|
X10.1.19. External Names
|
|
X
|
|
X A symbol can be given global scope by including it in a .globl
|
|
Xpseudo-op. Multiple names may be listed, separate by commas. It can
|
|
Xbe used for both exporting symbols defined in the current program, or
|
|
Ximporting names defined outside.
|
|
X
|
|
X10.1.20. Common
|
|
X
|
|
X The .comm pseudo-op declares storage that can be common to more than
|
|
Xone module. There are two arguments: a name and an absolute expression
|
|
Xgiving the size in bytes of the area named by the symbol. The type of
|
|
Xthe symbol becomes external. The statement can appear in amy segment.
|
|
XIf you think this has something to do with FORTRAN, you are right.
|
|
X
|
|
X10.1.21. Examples
|
|
X
|
|
X In the kernel directory, there are several assembly code files that
|
|
Xare worth inspecting as examples. However, note that these files,
|
|
Xending with .x, are designed to first be run through the C
|
|
Xpreprocessor. Thus they contain numerous constructs that are not pure
|
|
Xassembler. For true assembler examples, compile any C program provided
|
|
Xwith MINIX using the S flag. This will result in packed assembly
|
|
Xlanguage. The file can be unpacked using the libupack filter.
|
|
X
|
|
X
|
|
/
|
|
echo x - bawk.7
|
|
sed '/^X/s///' > bawk.7 << '/'
|
|
XName: bawk - basic subset of the awk programming language
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.2 BAWK - BASIC AWK
|
|
X
|
|
X AWK is a programming language devised by Aho, Weinberger, and
|
|
XKernighan at Bell Labs (hence the name). Bawk is a basic subset of it.
|
|
XBawk programs search files for specific patterns and performs
|
|
X``actions'' for every occurrence of these patterns. The patterns can
|
|
Xbe ``regular expressions'' as used in the ed editor. The actions are
|
|
Xexpressed using a subset of the C language.
|
|
X The patterns and actions are usually placed in a ``rules'' file
|
|
Xwhose name must be the first argument in the command line, preceded by
|
|
Xthe flag f. Otherwise, the first argument on the command line is
|
|
Xtaken to be a string containing the rules themselves. All other
|
|
Xarguments are taken to be the names of text files on which the rules
|
|
Xare to be applied, with being the standard input. To take rules from
|
|
Xthe standard input, use f .
|
|
X The command:
|
|
X bawk rules prog.* would read the patterns and actions rules from
|
|
Xthe file rules and apply them to all the arguments.
|
|
X The general format of a rules file is:
|
|
X <pattern> { <action> } <pattern> { <action> } ...
|
|
XThere may be any number of these <pattern> { <action> } sequences in
|
|
Xthe rules file. Bawk reads a line of input from the current input file
|
|
Xand applies every <pattern> { <action> } in sequence to the line.
|
|
X If the <pattern> corresponding to any { <action> } is missing, the
|
|
Xaction is applied to every line of input. The default { <action> } is
|
|
Xto print the matched input line.
|
|
X
|
|
X10.2.1. Patterns
|
|
X
|
|
X The <pattern>s may consist of any valid C expression. If the
|
|
X<pattern> consists of two expressions separated by a comma, it is
|
|
Xtaken to be a range and the <action> is performed on all lines of input
|
|
Xthat match the range. <pattern>s may contain ``regular expressions''
|
|
Xdelimited by an @ symbol. Regular expressions can be thought of as a
|
|
Xgeneralized ``wildcard'' string matching mechanism, similar to that
|
|
Xused by many operating systems to specify file names. Regular
|
|
Xexpressions may contain any of the following characters:
|
|
X x An ordinary character
|
|
X \ The backslash quotes any character
|
|
X ^ A circumflex at the beginning of an expr matches the beginning of a
|
|
X line.
|
|
X $ A dollar-sign at the end of an expression matches the end of a line.
|
|
X . A period matches any single character except newline.
|
|
X :x A colon matches a class of characters described by the next character:
|
|
X :a ``:a'' matches any alphabetic;
|
|
X :d ``:d'' matches digits;
|
|
X :n ``:n'' matches alphanumerics;
|
|
X : ``: '' matches spaces, tabs, and other control characters, such as
|
|
X newline.
|
|
X * An expression followed by an asterisk matches zero or more occurrences
|
|
X of that expression: ``fo*'' matches ``f'', ``fo'', ``foo'', ``fooo'',
|
|
X etc.
|
|
X + An expression followed by a plus sign matches one or more occurrences
|
|
X of that expression: ``fo+'' matches ``fo'', ``foo'', ``fooo'', etc.
|
|
X - An expression followed by a minus sign optionally matches the express-
|
|
X ion.
|
|
X [] A string enclosed in square brackets matches any single character in
|
|
X that string, but no others. If the first character in the string is a
|
|
X circumflex, the expression matches any character except newline and
|
|
X the characters in the string. For example, ``[xyz]'' matches ``xx''
|
|
X and ``zyx'', while ``[^xyz]'' matches ``abc'' but not ``axb''. A range
|
|
X of characters may be specified by two characters separated by ``-''.
|
|
X
|
|
X10.2.2. Actions
|
|
X
|
|
X Actions are expressed as a subset of the C language. All variables
|
|
Xare global and default to int's if not formally declared. Only
|
|
Xchar's and int's and pointers and arrays of char and int are allowed.
|
|
XBawk allows only decimal integer constants to be used-no hex (0xnn) or
|
|
Xoctal (0nn). String and character constants may contain all of the
|
|
Xspecial C escapes (\n, \r, etc.).
|
|
X Bawk supports the ``if'', ``else'', ``while'' and ``break'' flow of
|
|
Xcontrol constructs, which behave exactly as in C.
|
|
X Also supported are the following unary and binary operators, listed
|
|
Xin order from highest to lowest precedence:
|
|
X Operator Type Associativity
|
|
X () [] unary left to right
|
|
X ! ++ * & unary right to left
|
|
X * / % binary left to right
|
|
X + binary left to right
|
|
X << >> binary left to right
|
|
X < <= > >= binary left to right
|
|
X == != binary left to right
|
|
X & binary left to right
|
|
X ^ binary left to right
|
|
X | binary left to right
|
|
X && binary left to right
|
|
X || binary left to right
|
|
X = binary right to left
|
|
XComments are introduced by a '#' symbol and are terminated by the first
|
|
Xnewline character. The standard ``/*'' and ``*/'' comment delimiters
|
|
Xare not supported and will result in a syntax error.
|
|
X
|
|
X10.2.3. Fields
|
|
X
|
|
X When bawk reads a line from the current input file, the record is
|
|
Xautomatically separated into ``fields.'' A field is simply a string
|
|
Xof consecutive characters delimited by either the beginning or end of
|
|
Xline, or a ``field separator'' character. Initially, the field
|
|
Xseparators are the space and tab character. The special unary operator
|
|
X'$' is used to reference one of the fields in the current input record
|
|
X(line). The fields are numbered sequentially starting at 1. The
|
|
Xexpression ``$0'' references the entire input line.
|
|
X Similarly, the ``record separator'' is used to determine the end of
|
|
Xan input ``line,'' initially the newline character. The field and
|
|
Xrecord separators may be changed programatically by one of the actions
|
|
Xand will remain in effect until changed again.
|
|
X Multiple (up to 10) field separators are allowed at a time, but only
|
|
Xone record separator. In either case, they must be changed by
|
|
Xstrcpy(), not by a simple equate as in the real AWK.
|
|
X Fields behave exactly like strings; and can be used in the same
|
|
Xcontext as a character array. These ``arrays'' can be considered to
|
|
Xhave been declared as:
|
|
X char ($n)[ 128 ];
|
|
XIn other words, they are 128 bytes long. Notice that the parentheses
|
|
Xare necessary because the operators [] and $ associate from right to
|
|
Xleft; without them, the statement would have parsed as:
|
|
X char $(1[ 128 ]);
|
|
Xwhich is obviously ridiculous.
|
|
X If the contents of one of these field arrays is altered, the ``$0''
|
|
Xfield will reflect this change. For example, this expression:
|
|
X *$4 = 'A';
|
|
Xwill change the first character of the fourth field to an uppercase
|
|
Xletter 'A'. Then, when the following input line:
|
|
X 120 PRINT "Name address Zip"
|
|
Xis processed, it would be printed as:
|
|
X 120 PRINT "Name Address Zip"
|
|
XFields may also be modified with the strcpy() function (see below).
|
|
XFor example, the expression:
|
|
X strcpy( $4, "Addr." );
|
|
Xapplied to the same line above would yield:
|
|
X 120 PRINT "Name Addr. Zip"
|
|
X
|
|
X10.2.4. Predefined Variables
|
|
X
|
|
X The following variables are pre-defined:
|
|
X FS Field separator (see below).
|
|
X RS Record separator (see below also).
|
|
X NF Number of fields in current input record (line).
|
|
X NR Number of records processed thus far.
|
|
X FILENAME Name of current input file.
|
|
X BEGIN A special <pattern> that matches the beginning of input text.
|
|
X END A special <pattern> that matches the end of input text.
|
|
XBawk also provides some useful built-in functions for string
|
|
Xmanipulation and printing:
|
|
X print(arg) Simple printing of strings only, terminated by '\n'.
|
|
X printf(arg...)Exactly the printf() function from C.
|
|
X getline() Reads the next record and returns 0 on end of file.
|
|
X nextfile() Closes the current input file and begins processing the next
|
|
X file
|
|
X strlen(s) Returns the length of its string argument.
|
|
X strcpy(s,t) Copies the string ``t'' to the string ``s''.
|
|
X strcmp(s,t) Compares the ``s'' to ``t'' and returns 0 if they match.
|
|
X toupper(c) Returns its character argument converted to upper-case.
|
|
X tolower(c) Returns its character argument converted to lower-case.
|
|
X match(s,@re@)Compares the string ``s'' to the regular expression ``re'' and
|
|
X returns the number of matches found (zero if none).
|
|
X
|
|
X10.2.5. Limitations
|
|
X
|
|
X The maximum input line is 128 characters. The maximum action is 4K.
|
|
X
|
|
X10.2.6. Author
|
|
X
|
|
X Bawk was written by Bob Brodt.
|
|
X
|
|
X
|
|
/
|
|
echo x - de.7
|
|
sed '/^X/s///' > de.7 << '/'
|
|
XName: de - disk editor
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.3. DE - DISK EDITOR
|
|
X
|
|
X The de program allows a system administrator to examine and modify a
|
|
XMINIX file system device. Commands are available to move to any
|
|
Xaddress on the disk and display the disk block contents. This
|
|
Xinformation may be presented in one of three visual modes: as two-byte
|
|
Xwords, as ASCII characters or as a bit map. The disk may be searched
|
|
Xfor a string of characters. If the w option is given, de will open the
|
|
Xdevice for writing and words may be modified. Without this flag,
|
|
Xwriting is prohibited. Lost blocks and files can be recovered using a
|
|
Xvariety of commands. The r option supports automated recovery of files
|
|
Xremoved by unlink.
|
|
X
|
|
X10.3.1. Positioning
|
|
X
|
|
X Disks are divided into blocks (also called ``zones'') of 1024 bytes.
|
|
XDe keeps a current address on the disk as a block number and a byte
|
|
Xoffset within the block. In some visual modes the offset is rounded
|
|
Xoff, for example, in ``word'' mode the offset must be even.
|
|
X There are different types of blocks on a file system device,
|
|
Xincluding a super block, bit maps, i-nodes and data blocks. De knows
|
|
Xthe type of the current block, but will allow most positioning commands
|
|
Xand visual modes to function anywhere on the disk.
|
|
X The f command (or PGDN on the keypad) moves forward to the next
|
|
Xblock, similarly b (PGUP) moves backwards one block. F (END) moves
|
|
Xto the last block and B (HOME) moves to the first block.
|
|
X The arrow keys (or u, d, l, and r) change the current address by
|
|
Xsmall increments. The size of the increment depends on the current
|
|
Xdisplay mode, as shown below. The various sizes suit each display and
|
|
Xpointers move on the screen to follow each press of an arrow key.
|
|
X Mode Up Down Left Right
|
|
X Word -2 +2 -32 +32
|
|
X Block -64 +64 -1 +1
|
|
X Map -256 +256 -4 +4
|
|
XThe g command allows movement to any specified block. Like all
|
|
Xcommands that take arguments, a prompt and subsequent input are written
|
|
Xto the bottom line of the screen. Numerical entry may be decimal,
|
|
Xoctal or hexadecimal, for example 234, -1, 070, 0xf3, -X3C.
|
|
X While checking an i-node one may want to move to a block listed as a
|
|
Xzone of the file. The G command takes the contents at the current
|
|
Xaddress in the device as a block number and indirectly jumps to that
|
|
Xblock.
|
|
X The address may be set to the start of any i-node using the command
|
|
Xand supplying an i-node number. The I command maps a given file name
|
|
Xinto an i-node address. The file must exist on the current device and
|
|
Xthis device must be mounted.
|
|
X
|
|
X10.3.2. The Display
|
|
X
|
|
X The first line of the display contains the device name, the name of
|
|
Xthe current output file (if one is open) and the current search string.
|
|
XIf de is being run with the w option then the device name is flagged
|
|
Xwith ``(w).'' If a string is too long to fit on the line it is marked
|
|
Xwith ``...''.
|
|
X The second line contains the current block number, the total number
|
|
Xof blocks, and the type of the current block. The types are: boot,
|
|
Xsuper, i-node bit map, zone bit map, i-nodes and data block. If the
|
|
Xcurrent address is within a data block then the string ``in use'' is
|
|
Xdisplayed if the block corresponds to a set in the zone bit map.
|
|
X The third line shows the offset in the current block. If the
|
|
Xcurrent address is within either the i-node or zone bit maps then the
|
|
Xi-node or block number corresponding to the current bit is shown. If
|
|
Xthe current address is within an i-node then the i-node number and ``in
|
|
Xuse'' status is displayed. If the address is within a bit map or
|
|
Xi-node block, but past the last usable entry, then the string
|
|
X``padding'' is shown.
|
|
X The rest of the screen is used to display data from the current
|
|
Xblock. There are three visual display modes: ``word,'' ``block,'' and
|
|
X``map.'' The v command followed by w, b, or m sets the current display
|
|
Xmode.
|
|
X In ``word'' mode 16 words, of two bytes each, are shown in either
|
|
Xbase 2, 8, 10 or 16. The current base is displayed to the far right of
|
|
Xthe screen. It can be changed using the o command followed by either
|
|
Xan h (hexadecimal), d (decimal), o (octal) or b (binary).
|
|
X De knows where i-nodes are, and will display the contents in a
|
|
Xreadable format, including the rwx bits, the user name and the time
|
|
Xfield. If the current page is at the beginning of the super block, or
|
|
Xan executable file or an ar archive, then de will also inform the user.
|
|
XIn all other cases the contents of the 16 words are shown to the right
|
|
Xas equivalent ASCII characters.
|
|
X In ``block'' mode a whole block of 1024 bytes is displayed as ASCII
|
|
Xcharacters, 64 columns by 16 lines. Control codes are shown as
|
|
Xhighlighted characters. If the high order bit is set in any of the
|
|
X1024 bytes then an ``MSB'' flag is shown on the far right of the
|
|
Xscreen, but these bytes are not individually marked.
|
|
X In ``map'' mode 2048 bits (256 bytes) are displayed from the top to
|
|
Xthe bottom (32 bits) and from the left to the right of the screen.
|
|
XBit zero of a byte is towards the top of the screen. This visual mode
|
|
Xis generally used to observe the bit map blocks. The number of set
|
|
Xbits displayed is written on the far right of the screen.
|
|
X
|
|
X10.3.3. Searching
|
|
X
|
|
X A search for an ASCII string is initiated by the / command. Control
|
|
Xcharacters not used for other purposes may be entered in the search
|
|
Xstring, for example CTRL-J is an end-of-line character. The search
|
|
Xis from the current position to the end of the current device.
|
|
X Once a search string has been defined by a use of /, the next search
|
|
Xmay be initiated with the n command, (a / followed immediately by an
|
|
XENTER is equivalent to an n).
|
|
X Whenever a search is in progress de will append one . to the prompt
|
|
Xline for every 500 blocks searched. If the string is found between the
|
|
Xend of the file system and the actual end of the device, then the
|
|
Xcurrent address is set to the end of the file system.
|
|
X Some of the positioning commands push the current address and visual
|
|
Xmode in a stack before going to a new address. These commands are B,
|
|
XF, g, G, i, I, n, x and /. The p (previous) command pops the last
|
|
Xaddress and visual mode from the stack. This stack is eight entries
|
|
Xdeep.
|
|
X
|
|
X10.3.4. Modifying the File System
|
|
X
|
|
X The s command will prompt for a data word and store it at the
|
|
Xcurrent address on the disk. This is used to change information that
|
|
Xcan not be easily changed by any other means.
|
|
X The data word is 16 bits wide, it may be entered in decimal, octal
|
|
Xor hexadecimal. Remember that the w option must be specified for the
|
|
Xs command to operate. Be careful when modifying a mounted file system.
|
|
X
|
|
X10.3.5. Recovering Files
|
|
X
|
|
X Any block on the disk may be written to an output file. This is
|
|
Xused to recover blocks marked as free on the disk. A write command
|
|
Xwill request a file name the first time it is used, on subsequent
|
|
Xwrites the data is appended to the current output file.
|
|
X The name of the current output file is changed using the c command.
|
|
XThis file should be on a different file system, to avoid overwriting an
|
|
Xi-node or block before it is recovered.
|
|
X An ASCII block is usually recovered using the w command. All bytes
|
|
Xwill have their most significant bit cleared before being written to
|
|
Xthe output file. Bytes containing '\0' or '\177' are not copied. The
|
|
XW command writes the current block (1024 bytes exactly) to the output
|
|
Xfile.
|
|
X When a file is deleted using unlink the i-node number in the
|
|
Xdirectory is zeroed, but before its removal, it is copied into the end
|
|
Xof the file name field. This allows the i-node of a deleted file to be
|
|
Xfound by searching through a directory. The x command asks for the
|
|
Xpath name of a lost file, extracts the old i-node number and changes
|
|
Xthe current disk address to the start of the i-node.
|
|
X Once an i-node is found, all of the freed blocks may be recovered by
|
|
Xchecking the i-node zone fields, using 'G' to go to a block, writing it
|
|
Xback out using 'w', going back to the i-node with p and advancing to
|
|
Xthe next block. This file extraction process is automated by using the
|
|
XX command, which goes through the i-node, indirect and double indirect
|
|
Xblocks finding all the block pointers and recovering all the blocks of
|
|
Xthe file.
|
|
X The X command closes the current output file and asks for the name
|
|
Xof a new output file. All of the disk blocks must be marked as free,
|
|
Xif they are not the command stops and the file must be recovered
|
|
Xmanually.
|
|
X When extracting lost blocks de will maintain ``holes'' in the file.
|
|
XThus, a recovered sparse file does not allocate unused blocks and will
|
|
Xkeep its efficient storage scheme. This property of the X command
|
|
Xmay be used to move a sparse file from one device to another.
|
|
X Automatic recovery may be initiated by the r option on the command
|
|
Xline. Also specified is the path name of a file just removed by
|
|
Xunlink. De determines which mounted file system device held the file
|
|
Xand opens it for reading. The lost i-node is found and the file
|
|
Xextracted by automatically performing an x and an X command.
|
|
X The recovered file will be written to /tmp. De will refuse to
|
|
Xautomatically recover a file on the same file system as /tmp. The lost
|
|
Xfile must have belonged to the user. If automatic recovery will not
|
|
Xcomplete, then manual recovery may be performed.
|
|
X
|
|
X10.3.6. Miscellaneous
|
|
X
|
|
X The user can terminate a session with de by typing q, CTRL-D, or the
|
|
Xkey associated with SIGQUIT.
|
|
X The m command invokes the MINIX sh shell as a subprocess.
|
|
X For help while using de use h.
|
|
X
|
|
X10.3.7. Command Summary
|
|
X
|
|
X
|
|
X PGUP b Back one block
|
|
X PGDN f Forward one block
|
|
X HOME B Goto first block
|
|
X END F Goto last block
|
|
X UP u Move back 2/64/256 bytes
|
|
X DOWN d Move forward 2/64/256 bytes
|
|
X LEFT l Move back 32/1/4 bytes
|
|
X RIGHT r Move forward 32/1/4 bytes
|
|
X g Goto specified block
|
|
X G Goto block indirectly
|
|
X i Goto specified i-node
|
|
X I Filename to i-node
|
|
X / Search
|
|
X n Next occurrence
|
|
X p Previous address
|
|
X h Help
|
|
X EOF q Quit
|
|
X m MINIX shell
|
|
X v Visual mode (w b m)
|
|
X o Output base (h d o b)
|
|
X c Change file name
|
|
X w Write ASCII block
|
|
X W Write block exactly
|
|
X x Extract lost directory entry
|
|
X X Extract lost file blocks
|
|
X s Store word
|
|
X
|
|
XNOTES: When entering a line in response to a prompt from de there are a
|
|
Xcouple of editing characters available. The previous character may be
|
|
Xerased by typing CTRL-H and the whole line may be erased by typing
|
|
XCTRL-U. ENTER terminates the input. If DELETE or a non-ASCII
|
|
Xcharacter is typed then the command requesting the input is aborted.
|
|
X The commands G, s and X will only function if the current visual
|
|
Xdisplay mode is ``word.'' The commands i, I and x change the mode to
|
|
X``word'' on completion. The commands G and / change the mode to
|
|
X``block''. These restrictions and automatic mode conversions are
|
|
Xintended to aid the user.
|
|
X The ``map'' mode uses special graphic characters, and only functions
|
|
Xif the user is at the console.
|
|
X De generates warnings for illegal user input or if erroneous data is
|
|
Xfound on the disk, for example a corrupted magic number. Warnings
|
|
Xappear in the middle of the screen for two seconds, then the current
|
|
Xpage is redrawn. Some minor errors, for example, setting an unknown
|
|
Xvisual mode, simply ring the bell. Major errors, for example I/O
|
|
Xproblems on the file system device cause an immediate exit from de.
|
|
X The i-node and zone bit maps are read from the device when de starts
|
|
Xup. These determine whether ``in use'' or ``not in use'' is displayed
|
|
Xin the status field at the top of the screen. The bit maps are not
|
|
Xre-read while using de and will become out-of-date if observing a
|
|
Xmounted file system.
|
|
X De requires termcap definitions for ``cm'' and ``cl''. Furthermore,
|
|
X``so'' and ``se'' will also be used if available. The ANSI strings
|
|
Xgenerated by the keypad arrows are recognized, as well as any single
|
|
Xcharacter codes defined by ``ku'', ``kd'', ``kl'' and ``kr''.
|
|
X
|
|
X10.3.8. Author
|
|
X
|
|
X The de program was written by Terrence Holm.
|
|
X
|
|
X
|
|
/
|
|
echo x - dis88.7
|
|
sed '/^X/s///' > dis88.7 << '/'
|
|
XName: dis88 - disassembler for the Intel 8086/8088
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.4. DIS88 - DISASSEMBLER FOR THE 8088 [IBM]
|
|
X
|
|
X Dis88 disassembles 8088 object code to the assembly language format
|
|
Xused by MINIX. It makes full use of symbol table information, supports
|
|
Xseparate instruction and data space, and generates synthetic labels
|
|
Xwhen needed. It does not support 8087 mnemonics, symbolic data segment
|
|
Xreferences, or the ESC mnemonic.
|
|
X The program is invoked by:
|
|
X dis88 [o] infile [outfile]
|
|
XThe o flag causes object code to be listed. If no outfile is given,
|
|
Xstdout is used.
|
|
X The text segment of an object file is always padded to an even
|
|
Xaddress. In addition, if the file has split I/D space, the text
|
|
Xsegment will be padded to a paragraph boundary (i.e., an address
|
|
Xdivisible by 16). Due to padding, the disassembler may produce a few
|
|
Xspurious, but harmless, instructions at the end of the text segment.
|
|
X Because the information to which initialized data refers cannot
|
|
Xgenerally be inferred from context, the data segment is treated
|
|
Xliterally. Byte values (in hexadecimal) are output, and long stretches
|
|
Xof null data are represented by appropriate .zerow pseudo-ops.
|
|
XDisassembly of the bss segment, on the other hand, is quite
|
|
Xstraightforward, because uninitialized data is all zero by defin-
|
|
Xition. No data is output in the bss segment, but symbolic labels are
|
|
Xoutput as appropriate.
|
|
X The output of operands in symbolic form is complicated somewhat by
|
|
Xthe existence of assembler symbolic constants and segment override
|
|
Xopcodes. Thus, the program's symbol lookup routine attempts to apply a
|
|
Xcertain amount of intelligence when it is asked to find a symbol. If
|
|
Xit cannot match on a symbol of the preferred type, it may output a
|
|
Xsymbol of some other type, depending on preassigned (and somewhat
|
|
Xarbitrary) rankings within each type. Finally, if all else fails, it
|
|
Xwill output a string containing the address sought as a hex constant.
|
|
XFor user convenience, the targets of branches are also output, in com-
|
|
Xments, as hexadecimal constants.
|
|
X
|
|
X10.4.1. Error Messages
|
|
X
|
|
X Various error messages may be generated as a result of problems
|
|
Xencountered during the disassembly. They are listed below
|
|
X Cannot access input file Input file cannot be opened or read
|
|
X Cannot open output file Output file cannot be created
|
|
X Input file not in object format
|
|
X Bad magic number
|
|
X Not an 8086/8088 object file
|
|
X 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 Cannot reopen input file Input file was removed during execution
|
|
X
|
|
X10.4.2. Author
|
|
X
|
|
X Dis88 was written and copyrighted by G. M. Harding and is included
|
|
Xhere by permission. It may be freely redistributed provided that
|
|
Xcomplete source code, with all copyright notices, accompanies any
|
|
Xredistribution. This provision also applies to any modifications you
|
|
Xmay make. You are urged to comment such changes, giving, as a minimum,
|
|
Xyour name and complete address.
|
|
X
|
|
X
|
|
/
|
|
echo x - elle.7
|
|
sed '/^X/s///' > elle.7 << '/'
|
|
XName: elle - full screen, emacs-like editor
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.5. ELLE - FULL-SCREEN EDITOR
|
|
X
|
|
X ELLE (ELLE Looks Like Emacs) is an Emacs clone for MINIX. ELLE
|
|
Xis not full Emacs but it has about 80 commands and is quite fast.
|
|
X
|
|
X10.5.1. Key bindings
|
|
X
|
|
X Mined only has a small number of commands. All of them are either
|
|
Xof the form CTRL-x or are on the numeric keypad. Emacs, in contrast,
|
|
Xhas so many commands, that not only are all the CTRL-x commands used
|
|
Xup, but so are all the ESC x (escape followed by x; escape is not a
|
|
Xshift character, like CTRL). Even this is not enough, so CTRL-X is
|
|
Xused as a prefix for additional commands. Thus CTRL-X CTRL-L is a
|
|
Xcommand, and so is CTRL-X K. Note that what is conventionally
|
|
Xwritten as CTRL-X K really means CTRL-X k. In some contexts it is
|
|
Xtraditional to write CTRL-X as ^X. Please note that they mean the
|
|
Xsame thing.
|
|
X As a result, many Emacs commands need three or four key strokes to
|
|
Xexecute. Some people think 3-4 key strokes is too many. For this
|
|
Xreason, Emacs and ELLE allow users to assign their own key bindings.
|
|
XIn ELLE this is done with ``user profiles.'' A user profile is a file
|
|
Xlisting which function is invoked by which key stroke. The user
|
|
Xprofile is then compiled by a program called ellec into binary form.
|
|
XWhen ELLE starts up it checks to see if a file .ellepro.b1 exists in
|
|
X$HOME. If it does, this file is read in and overrides the default
|
|
Xbindings.
|
|
X A user profile that simulates the mined commands fairly well is
|
|
Xprovided. Its installation is described later. If you have never used
|
|
XEmacs, it is suggested that you use the mined profile. If you normally
|
|
Xuse Emacs, then do not install the mined profile. You can also make
|
|
Xyour own using ellec. There is no Mock Lisp.
|
|
X ELLE has a character-oriented view of the world, not a line oriented
|
|
Xview, like ed. It does not have magic characters for searching.
|
|
XHowever, you can use line feed in search patterns. For example, to
|
|
Xfind a line consisting of the three characters ``foo'' all by
|
|
Xthemselves on a line, using the mined bindings (see below), use the
|
|
Xpattern: CTRL-\ CTRL-J f o o CTRL-\ CTRL-J. The CTRL-\ means to
|
|
Xinterpret the next character literally, in this case it is CTRL-J,
|
|
Xwhich is line feed. You can also search for patterns involving
|
|
Xmultiple lines. For example, to find a line ending in an ``x''
|
|
Xfollowed by a line beginning with a ``y'', use as pattern: x CTRL-
|
|
XCTRL-J y.
|
|
X
|
|
X10.5.2. Mined Key Bindings
|
|
X
|
|
X These are the key bindings if the binary user profile, .ellepro.b1,
|
|
Xis installed in $HOME. The ESCAPE key followed by a number followed by
|
|
Xa command causes that command to be executed ``number'' times. This
|
|
Xapplies both to control characters and insertable characters. CTRL-X
|
|
Xrefers to a ``control character.'' ESC x refers to an escape
|
|
Xcharacter followed by x. In other words, ^X is a synonym for CTRL-X.
|
|
X^X Y refers to CTRL-X followed by y. To abort the current command and
|
|
Xgo back to the main loop of the editor, type CTRL-G, rather than
|
|
XCTRL-\.
|
|
X Only a few commands are of the form CTRL-X Y. All of these are also
|
|
Xbound to CTRL-X CTRL-Y, so you can hold down CTRL and then hit X Y, or
|
|
Xrelease control after the X, as you prefer.
|
|
X The key bindings that are not listed should not be used. Some of
|
|
Xthem actually do things. For example, the ANSI escape codes ESC [ x
|
|
Xare bound to ^X Y for a variety of y.
|
|
X Some commands work on regions. A region is defined as the text
|
|
Xbetween the most recently set mark and the cursor.
|
|
X
|
|
X10.5.3. Mined Commands
|
|
X
|
|
X If the mined profile, .ellepro.b1 is installed in your home
|
|
Xdirectory, the following commands will work.
|
|
X
|
|
X CURSOR MOTION
|
|
X arrows Move the cursor in the indicated direction
|
|
X CTRL-A Move cursor to start of current line
|
|
X CTRL-Z Move cursor to end of current line
|
|
X CTRL-F Move cursor forward word
|
|
X CTRL-B Move cursor backward to start of previous word
|
|
X
|
|
X SCREEN MOTION
|
|
X Home key Move to first character of the file
|
|
X End key Move to last character of the file
|
|
X PgUp key Scroll window up 22 lines (closer to start of the file)
|
|
X PgDn key Scroll window down 22 lines (closer to end of the file)
|
|
X CTRL-U Scroll window up 1 line
|
|
X CTRL-D Scroll window down 1 line
|
|
X ESC , Move to top of screen
|
|
X CTRL-_ Move to bottom of screen
|
|
X
|
|
X MODIFYING TEXT
|
|
X DEL key Delete the character under the cursor
|
|
X Backsp Delete the character to left of the cursor
|
|
X CTRL-N Delete the next word
|
|
X CTRL-P Delete the previous word
|
|
X CTRL-T Delete tail of line (all characters from cursor to end of
|
|
X line)
|
|
X CTRL-O Open up the line (insert line feed and back up)
|
|
X ESC G Get and insert a file at the cursor position (CTRL-G in mined)
|
|
X
|
|
X REGIONS
|
|
X CTRL-^ Set mark at current position for use with CTRL-C and CTRL-K
|
|
X CTRL-C Copy the text between the mark and the cursor into the buffer
|
|
X CTRL-K Delete text between mark and cursor; also copy it to the
|
|
X buffer
|
|
X CTRL-Y Yank contents of the buffer out and insert it at the cursor
|
|
X
|
|
X MISCELLANEOUS
|
|
X numeric + Search forward (prompts for expression)
|
|
X numeric - Search backward (prompts for expression)
|
|
X CTRL-] ESC n CTRL-[ goes to line n (slightly different syntax than
|
|
X mined)
|
|
X CTRL-R Global replace pattern with string (from cursor to end)
|
|
X CTRL-L Replace pattern with string within the current line only
|
|
X CTRL-W Write the edited file back to the disk
|
|
X CTRL-S Fork off a shell (use CTRL-D to get back to the editor)
|
|
X CTRL-G Abort whatever the editor was doing and wait for command
|
|
X (CTRL-)
|
|
X CTRL-E Redraw screen with cursor line positioned in the middle
|
|
X CTRL-V Visit (edit) a new file
|
|
X CTRL-Q Write buffer to a file
|
|
X ESC X Exit the editor
|
|
X
|
|
X10.5.4. Non-Mined Commands
|
|
X
|
|
X CURSOR MOTION
|
|
X ESC P Forward paragraph (a paragraph is a line beginning with a dot)
|
|
X ESC ] Backward paragraph
|
|
X ESC . Indent this line as much as the previous one
|
|
X
|
|
X MODIFYING TEXT
|
|
X CTRL-\ Insert the next character (used for inserting control char-
|
|
X acters)
|
|
X ESC T Transpose characters
|
|
X ESC W Transpose words
|
|
X ESC = Delete white space (horizontal space)
|
|
X ESC | Delete blank lines (vertical space)
|
|
X
|
|
X REGIONS
|
|
X ESC M Mark current paragraph
|
|
X ESC ^ Exchange cursor and mark
|
|
X ESC Y Yank back the next-to-the-last kill (CTRL-Y yanks the last
|
|
X one)
|
|
X ESC A Append next kill to kill buffer
|
|
X
|
|
X KEYBOARD MACROS
|
|
X ESC / Start Keyboard Macro
|
|
X ESC \ End Keyboard Macro
|
|
X ESC * View Keyboard Macro (the PrtSc key on the numeric pad is
|
|
X also a *)
|
|
X ESC E Execute Keyboard Macro
|
|
X
|
|
X WINDOW MANAGEMENT
|
|
X ^X 1 Enter one window mode
|
|
X ^X 2 Enter two window mode
|
|
X ^X L Make the current window larger
|
|
X ^X P Make the window more petit/petite (Yes, Virginia, they are
|
|
X English)
|
|
X ^X N Next window
|
|
X ^X W New window
|
|
X
|
|
X BUFFER MANAGEMENT
|
|
X numeric 5 Display the list of current files and buffers
|
|
X ESC B Select a buffer
|
|
X ESC S Select an existing buffer
|
|
X ESC N Mark a buffer as NOT modified (even if it really is)
|
|
X
|
|
X UPPER AND LOW CASE MANIPULATION
|
|
X ESC I Set first character of word to upper case
|
|
X ESC C Capitalize current word
|
|
X ESC O Make current word ordinary (i.e., lower case)
|
|
X ESC U Set entire region between mark and cursor to upper case
|
|
X ESC L Set entire region between mark and cursor to lower case
|
|
X
|
|
X MISCELLANEOUS
|
|
X ESC F Find file and read it into its own buffer
|
|
X ESC Z Incremental search
|
|
X ESC Q Like CTRL-R, but queries at each occurrence (type ? for
|
|
X options)
|
|
X ESC R Reset the user profile from a file
|
|
X ESC H Help (ELLE prompts for the 1 or 2 character command to
|
|
X describe)
|
|
X ESC ; Insert a comment in a C program (generates /* */ for you)
|
|
X ^X X Exit the editor (same as ESC X and CTRL-X CTRL-X)
|
|
X
|
|
XThe major differences between ELLE with the mined profile and mined
|
|
Xitself are:
|
|
X
|
|
X 1. The definition of a ``word'' is different for forward and backward word
|
|
X 2. The mark is set with CTRL-^ instead of CTRL-@
|
|
X 3. Use CTRL-G to abort a command instead of CTRL-\
|
|
X 4. Use CTRL- to literally insert the next character, instead of ALT
|
|
X 5. CTRL-E adjusts the window to put the cursor in the middle of it
|
|
X 6. To get and insert a file, use ESC G instead of CTRL-G
|
|
X 7. To go to line n, type ESC n CTRL-[ instead of CTRL-[ n
|
|
X 8. You exit with CTRL-X CTRL-X and then answer the question with ``y''.
|
|
X 9. There are many new commands, windows, larger files, etc.
|
|
X
|
|
X
|
|
X10.5.5. Emacs Key Bindings
|
|
X
|
|
X If you do not have the mined profile installed, you get the standard
|
|
XEmacs key bindings. These are listed below. Commands not listed are
|
|
Xnot implemented.
|
|
X
|
|
X CURSOR MOVEMENT
|
|
X CTRL-F Forward one character.
|
|
X CTRL-B Backward one character.
|
|
X CTRL-H Same as CTRL-B: move backward one character.
|
|
X ESC F Forward one word.
|
|
X ESC B Backward one word.
|
|
X CTRL-A Beginning of current line.
|
|
X CTRL-E End of current line.
|
|
X CTRL-N Next line (goes to the next line).
|
|
X CTRL-P Previous line (goes to the previous line).
|
|
X CTRL-V Beginning of next screenful.
|
|
X ESC V Beginning of previous screenful.
|
|
X ESC ] Forward Paragraph.
|
|
X ESC [ Backward Paragraph.
|
|
X ESC < Beginning of whole buffer.
|
|
X ESC > End of whole buffer.
|
|
X
|
|
X DELETING
|
|
X CTRL-D Deletes forward one character (the one the cursor is under).
|
|
X DELETE Deletes backward one character (the one to left of cursor).
|
|
X ESC D Kills forward one word.
|
|
X ESC DEL Kills backward one word.
|
|
X CTRL-K Kills the rest of the line (to the right of the cursor).
|
|
X ESC \ Deletes spaces around the cursor.
|
|
X ^X CTRL-O Deletes blank lines around the cursor.
|
|
X
|
|
X CASE CHANGE
|
|
X ESC C Capitalizes word : first letter becomes uppercase; rest lower
|
|
X ESC L Makes the whole next word lowercase.
|
|
X ESC U Makes the whole next word uppercase.
|
|
X ^X CTRL-L Makes whole region lowercase.
|
|
X ^X CTRL-U Makes whole region uppercase.
|
|
X
|
|
X SEARCHING (If no string is given, previous string is used)
|
|
X CTRL-S Incremental Search forward; prompts ``I-search:''
|
|
X CTRL-R Reverse Incremental Search; prompts ``R-search:'' During an
|
|
X incremental search, the following characters have special
|
|
X effects:
|
|
X ``normal'' - Begin searching immediately.
|
|
X ^G - Cancel I-search, return to start.
|
|
X DEL - Erase last char, return to last match.
|
|
X ^S, ^R - Repeat search (or change direction).
|
|
X ESC or CR - Exit I-search at current point.
|
|
X
|
|
X ESC % Query Replace. Interactive replace. Type ``?'' to see options.
|
|
X ^X % Replace String.Like Query Replace, but not interactive
|
|
X
|
|
X MARKING AREAS
|
|
X CTRL-^ Set mark
|
|
X ^X CTRL-X Exchange cursor and mark.
|
|
X ESC H Mark Paragraph. Sets mark and cursor to surround a para.
|
|
X CTRL-W Wipe-out -- kills a ``region'':
|
|
X ESC W Copy region. Like CTRL-W then CTRL-Y but modifies buffer
|
|
X CTRL-Y Yanks-back (un-kills) whatever you have most recently killed.
|
|
X ESC Y Yanks-back (un-kills) the next most recently killed text.
|
|
X ESC CTRL-W Append Next Kill. Accumulates stuff from several kills
|
|
X
|
|
X FILLING TEXT
|
|
X ESC Q Fill the paragraph to the size of the Fill Column.
|
|
X ESC G Fill the region.
|
|
X ^X F Set Fill Column. ESC Q will use this line size.
|
|
X ^X . Set Fill Prefix. Asks for prefix string
|
|
X ^X T Toggles Auto Fill Mode.
|
|
X
|
|
X WINDOWS
|
|
X ^X 2 Make two windows (split screen).
|
|
X ^X 1 Make one window (delete window) (make one screen).
|
|
X ^X O Go to Other window.
|
|
X ^X ^ Grow window: makes current window bigger.
|
|
X
|
|
X BUFFERS
|
|
X ^X CTRL-F Find a file and make a buffer for it.
|
|
X ^X B Select Buffer: goes to specified buffer or makes new one
|
|
X ^X CTRL-B Show the names of the buffers used in this editing session.
|
|
X ^X K Kill Buffer.
|
|
X ESC tilde Say buffer is not modified.
|
|
X ^X CTRL-M Toggle EOL mode (per-buffer flag).
|
|
X
|
|
X KEYBOARD MACRO
|
|
X ^X ( Start collecting a keyboard macro.
|
|
X ^X ) Stop collecting.
|
|
X ^X E Execute the collected macro.
|
|
X ^X * Display the collected macro.
|
|
X
|
|
X FILES
|
|
X ^X CTRL-I Insert a file where cursor is.
|
|
X ^X CTRL-R Read a new file into current buffer.
|
|
X ^X CTRL-V Same as ^X ^R above (reads a file).
|
|
X ^X CTRL-W Write buffer out to new file name.
|
|
X ^X CTRL-S Save file: write out buffer to its file name.
|
|
X ^X CTRL-E Write region out to new file name.
|
|
X
|
|
X MISCELLANEOUS
|
|
X ^X CTRL-Z Exit from ELLE.
|
|
X ^X ! Escape to shell (CTRL-D to return)
|
|
X CTRL-O Open up line
|
|
X LINEFEED Same as typing RETURN and TAB.
|
|
X CTRL-T Transposes characters.
|
|
X ESC T Transposes words.
|
|
X CTRL-U Makes the next command happen four times.
|
|
X CTRL-U number
|
|
X Makes the next command happen ``number'' times.
|
|
X ESC number Same as CTRL-U number.
|
|
X CTRL-L Refreshes screen.
|
|
X CTRL-U CTRL-L
|
|
X Refresh only the line cursor is on.
|
|
X CTRL-U n CTRL-L
|
|
X Change window so the cursor is on line n
|
|
X CTRL-Q Quote: insert the next character no matter what it is.
|
|
X CTRL-G Quit: use to avoid answering a question.
|
|
X ESC ; Inserts comment (for writing C programs).
|
|
X ESC I Inserts indentation equal to previous line.
|
|
X ESC M Move to end of this line's indentation.
|
|
X CTRL-_ Describe a command (if the command database is online)
|
|
X
|
|
X UNUSED CONTROLS
|
|
X CTRL-C Not used.
|
|
X CTRL-Z Not used.
|
|
X CTRL-] Not used.
|
|
X
|
|
X10.5.6. Installing ELLE on MINIX
|
|
X
|
|
X To install ELLE, you will need the following files:
|
|
X elle executable binary of the editor
|
|
X ellec executable binary of the profile compiler
|
|
X .ellepro.e mined profile in source form
|
|
X .ellepro.b1 mined profile in binary form
|
|
X help.dat help file
|
|
XTo install ELLE, please proceed as follows:
|
|
X 1. Check to see if /etc/termcap is present and has an entry for ``minix''.
|
|
X 2. Set the environment properly by typing:
|
|
X TERM=minix
|
|
X You can also put it in the appropriate .profile, but be sure to also
|
|
X include a line:
|
|
X export TERM
|
|
X You can check the current environment with printenv. If the entry:
|
|
X TERM=minix
|
|
X does not appear, ELLE will not work.
|
|
X 3. Install the files elle and ellec in your /bin or /usr/bin directory.
|
|
X 4. Install help.dat in /usr/src/elle/help.dat
|
|
X 5. If you want to use the mined-like commands, install .ellepro.b1 in your
|
|
X home directory.
|
|
X 6. Type:
|
|
X elle filename
|
|
X and you are up and running.
|
|
X
|
|
X It is possible to create your own user profile. The mechanism is
|
|
Xdifferent from Emacs, since ELLE does not have Mock Lisp. Proceed as
|
|
Xfollows.
|
|
X 1. Modify .ellepro.e to suit your taste.
|
|
X 2. Install .ellepro.e in your home directory.
|
|
X 3. Type:
|
|
X ellec Profile
|
|
X 4. Check to see if .ellepro.b1 has been created. If it has, you are ready
|
|
X to go.
|
|
X
|
|
X
|
|
X10.5.7. Author
|
|
X
|
|
X ELLE was written by Ken Harrenstien of SRI (klh@sri.com).
|
|
X
|
|
X
|
|
/
|
|
echo x - elvis.7
|
|
sed '/^X/s///' > elvis.7 << '/'
|
|
XName: elvis, vi, ex - a clone of the Berkeley vi editor
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.6. ELVIS - A CLONE OF THE BERKELEY VI EDITOR
|
|
X
|
|
X Elvis is a full-screen editor closely modeled on the famous Berkeley
|
|
Xvi editor. It provides essentially the same interface to the user as
|
|
Xvi, but the code is completely new, written from scratch. This
|
|
Xdocument provides a brief introduction to vi. It is not intended as
|
|
Xa tutorial for beginners. Most books on UNIX cover vi.
|
|
X Like vi, elvis can operate as a screen editor (vi mode) or as a line
|
|
Xeditor (ex) mode. It can be called either as elvis vi,or as ex,
|
|
Xdepending on which is desired. They are all links to the same file.
|
|
X
|
|
X10.6.1. Vi Commands
|
|
X
|
|
X Below is a list of the vi commands supported. The following symbols
|
|
Xare used in the table:
|
|
X count Integer parameter telling how many or how much
|
|
X key One character parameter to the command
|
|
X inp Interactive input expected
|
|
X mv Indicates how much for commands like delete and change:
|
|
X ( Previous sentence
|
|
X ) Next sentence
|
|
X { Previous paragraph
|
|
X } Next paragraph (delimited by blank line, .PP, .LP, .IP etc.)
|
|
X [ Previous section (delimited by .SH or .NH)
|
|
X A repeated command character means the scope is this line
|
|
X MOVE Indicates commands that may also be used where mv is specified
|
|
X EDIT These commands affect text and may be repeated by the . command
|
|
X
|
|
XIn addition to the above notation, the caret (^) is used as an
|
|
Xabbreviation for CTRL. For example, ^A means CTRL-A.
|
|
X
|
|
XCount Command Description Type
|
|
X ^A (Not defined)
|
|
X ^B Move toward the top of the file by 1 screenful
|
|
X ^C (Not defined)
|
|
Xcount ^D Scroll down count lines (default 1/2 screen)
|
|
Xcount ^E Scroll up count lines
|
|
X ^F Move toward the bottom of the file by 1 screenful
|
|
X ^G Show file status, and the current line
|
|
Xcount ^H Move left, like h MOVE
|
|
X ^I (Not defined)
|
|
Xcount ^J Move down MOVE
|
|
X ^K (Not defined)
|
|
X ^l Redraw the screen
|
|
Xcount ^M Move to the front of the next lineMOVE
|
|
Xcount ^N Move down MOVE
|
|
X ^O (Not defined)
|
|
Xcount ^P Move up MOVE
|
|
X ^Q (Not defined)
|
|
X ^R Redraw the screen
|
|
X ^S (Not defined)
|
|
X ^T (Not defined)
|
|
Xcount ^U Scroll up count lines (default 1/2 screen)
|
|
X ^V (Not defined)
|
|
X ^W (Not defined)
|
|
X ^X (Not defined)
|
|
Xcount ^Y Scroll down count lines
|
|
X ^Z (Not defined)
|
|
X ESC (Not defined)
|
|
X ^\ (Not defined)
|
|
X ^] If the cursor is on a tag name, go to that tag
|
|
X ^^ (Not defined)
|
|
X ^_ (Not defined)
|
|
Xcount SPACE Move right,like l MOVE
|
|
X ! mv Run the selected lines thru an external filter program
|
|
X `` key Select which cut buffer to use next
|
|
X # (Not defined)
|
|
X $ Move to the rear of the current lineMOVE
|
|
X % move to the matching (){}[] characterMOVE
|
|
X & (Not defined)
|
|
X ' key Move to a marked line MOVE
|
|
Xcount ( Move backward count sentences MOVE
|
|
Xcount ) Move forward count sentences MOVE
|
|
X * (Not defined)
|
|
Xcount + Move to the front of the next lineMOVE
|
|
Xcount , Repeat the previous [fFtT] but the other wayMOVE
|
|
Xcount - Move to the front of the preceding lineMOVE
|
|
X . Repeat the previous ``edit'' command
|
|
X / Text search forward for a given regular exprMOVE
|
|
X 0 If not part of count, move to 1st char of this lineMOVE
|
|
X 1 Part of count
|
|
X 2 Part of count
|
|
X 3 Part of count
|
|
X 4 Part of count
|
|
X 5 Part of count
|
|
X 6 Part of count
|
|
X 7 Part of count
|
|
X 8 Part of count
|
|
X 9 Part of count
|
|
X : Text. Run single ex cmd
|
|
Xcount ; Repeat the previous [fFtT] cmd MOVE
|
|
X < mv Shift text left EDIT
|
|
X = (Not defined)
|
|
X > mv Shift text right EDIT
|
|
X ? text Search backward for a given regular expressionMOVE
|
|
X @ (Not defined)
|
|
Xcount A inp Append at end of the line EDIT
|
|
Xcount B Move back Word MOVE
|
|
X C inp Change text from cursor through end of lineEDIT
|
|
X D Delete text from cursor through end of lineEDIT
|
|
Xcount E Move end of Word MOVE
|
|
Xcount F key Move leftward to a given characterMOVE
|
|
Xcount G Move to line #count (default is the bottom line)MOVE
|
|
Xcount H Move to home row (the line at the top of the screen)
|
|
Xcount I inp Insert at the front of the line (after indents)EDIT
|
|
Xcount J Join lines, to form one big line EDIT
|
|
X K Look up keyword
|
|
Xcount L Move to last row (the line at the bottom of the screen)
|
|
X M Move to middle row (the line in the middle)
|
|
X N Repeat previous search, but the opposite wayMOVE
|
|
Xcount O inp Open up a new line above the current lineEDIT
|
|
X P Paste text before the cursor
|
|
X Q Quit to EX mode
|
|
X R inp Overtype EDIT
|
|
Xcount S inp Change lines, like countcc
|
|
Xcount T key Move leftward almost to a given characterMOVE
|
|
X U Undo all recent changes to the current line
|
|
X V (Not defined)
|
|
Xcount W Move forward count Words MOVE
|
|
Xcount X Delete the character(s) to the left of the cursorEDIT
|
|
Xcount Y Yank text line(s) (copy them into a cut buffer)
|
|
X Z Z Save the file & exit
|
|
X [ [ Move back 1 section MOVE
|
|
X (Not defined)
|
|
X ] ] Move forward 1 section MOVE
|
|
X ^ Move to the front of the current line (after indent)MOVE
|
|
X ~ (Not defined)
|
|
X ` key Move to a marked character MOVE
|
|
Xcount a inp Insert text after the cursor EDIT
|
|
Xcount b Move back count words MOVE
|
|
X c mv Change text EDIT
|
|
X d mv Delete text EDIT
|
|
Xcount e Move forward to the end of the current wordMOVE
|
|
Xcount f key Move rightward to a given characterMOVE
|
|
X g (Not defined)
|
|
Xcount h Move left MOVE
|
|
Xcount i inp Insert text at the cursor EDIT
|
|
Xcount j Move down MOVE
|
|
Xcount k Move up MOVE
|
|
Xcount l Move right MOVE
|
|
X m key Mark a line or character
|
|
X n Repeat the previous search MOVE
|
|
Xcount o inp Open a new line below the current lineEDIT
|
|
X p Paste text after the cursor
|
|
X q (Not defined)
|
|
Xcount r key Replace count chars by a given characterEDIT
|
|
Xcount s inp Replace count chars with text from the userEDIT
|
|
Xcount t key Move rightward almost to a given characterMOVE
|
|
X u Undo the previous edit command
|
|
X v (Not defined)
|
|
Xcount w Move forward count words MOVE
|
|
Xcount x Delete the character that the cursor's onEDIT
|
|
X y mv Yank text (copy it into a cut buffer)
|
|
X z key Scroll current line to the screen's +=top -=bottom .=middle
|
|
Xcount { Move back count paragraphs MOVE
|
|
Xcount | Move to column count (the leftmost column is 1)
|
|
Xcount } Move forward count paragraphs MOVE
|
|
X ~ Switch a character between upper & lower caseEDIT
|
|
X DEL (Not defined)
|
|
X
|
|
X10.6.2. Ex Commands
|
|
X
|
|
X Below is a list of the ex commands supported. All can be abbreviated.
|
|
X
|
|
XGeneral
|
|
X
|
|
X[line] append
|
|
X args [files]
|
|
X cd [directory]
|
|
X chdir [directory]
|
|
X[line][,line] change
|
|
X[line][,line] copyline
|
|
X[line][,line] debug[!]
|
|
X[line][,line] Delete[''x]
|
|
X edit[!] [file]
|
|
X ex[!] [file]
|
|
X file
|
|
X[line][,line] global/regexp/ command
|
|
X[line] Insert
|
|
X[line][,line] join
|
|
X[line][,line] list
|
|
X map[!] key mapped_to
|
|
X[line] mark x
|
|
X mkexrc
|
|
X[line][,line] Moveline
|
|
X next[!] [files]
|
|
X Next[!]
|
|
X previous[!]
|
|
X[line][,line] print
|
|
X[line] put [''x]
|
|
X quit[!]
|
|
X[line] read file
|
|
X rewind[!]
|
|
X set [options]
|
|
X[line][,line] substitute
|
|
X /regexp/replacement/[p][g]
|
|
X tag[!] tagname
|
|
X[line][,line] toline
|
|
X Undo
|
|
X unmap[!] key
|
|
X validate[!]
|
|
X version
|
|
X[line][,line] vglobal/regexp/ command
|
|
X visual
|
|
X wq
|
|
X[line][,line] write[!][[>>]file]
|
|
X xit[!]
|
|
X[line][,line] yank[''x]
|
|
X[line][,line] !command
|
|
X[line][,line] <
|
|
X[line][,line] =
|
|
X[line][,line] >
|
|
X
|
|
XText Entry
|
|
X
|
|
X[line] append
|
|
X[line][,line] change [''x]
|
|
X[line] Insert
|
|
X
|
|
XThe (a)ppend command inserts text after the specified line.
|
|
X
|
|
XThe (i)nsert command inserts text before the specified line.
|
|
X
|
|
XThe (c)hange command copies the range of lines into a cut buffer,
|
|
Xdeletes them, and inserts new text where the old text used to be.
|
|
X
|
|
XFor all of these commands, you indicate the end of the text you're
|
|
Xinserting by hitting ^D or by entering a line which contains only a
|
|
Xperiod.
|
|
X
|
|
XCut & Paste
|
|
X
|
|
X[line][,line] Delete [''x]
|
|
X[line][,line] yank [''x]
|
|
X[line] put[!] [''x]
|
|
X[line][,line] copy line
|
|
X[line][,line] to line
|
|
X[line][,line] Move line
|
|
X
|
|
XThe (d)elete command copies the specified range of lines into a cut
|
|
Xbuffer, and then deletes them.
|
|
X
|
|
XThe (y)ank command copies the specified range of lines into a cut
|
|
Xbuffer, but does not delete them.
|
|
X
|
|
XThe (pu)t command inserts text from a cut buffer after the specified
|
|
Xline - or before it if the ! is present.
|
|
X
|
|
XThe (co)py and (t)o commands yank the specified range of lines and then
|
|
Ximmediately paste them after some other line.
|
|
X
|
|
XThe (m)ove command deletes the specified range of lines and then
|
|
Ximmediately pastes them after some other line. If the destination line
|
|
Xcomes after the deleted text, then it will be adjusted automatically to
|
|
Xaccount for the deleted lines.
|
|
X
|
|
XDisplaying Text
|
|
X
|
|
X[line][,line] print
|
|
X[line][,line] list
|
|
X
|
|
XThe (p)rint command displays the specified range of lines.
|
|
X
|
|
XThe (l)ist command also displays them, but it is careful to make
|
|
Xcontrol characters visible.
|
|
X
|
|
XGlobal Operations
|
|
X
|
|
X[line][,line] global /regexp/ command
|
|
X[line][,line] vglobal /regexp/ command
|
|
X
|
|
XThe (g)lobal command searches through the lines of the specified range
|
|
X(or through the whole file if no range is specified) for lines that
|
|
Xcontain a given regular expression. It then moves the cursor to each
|
|
Xof these lines and runs some other command on them.
|
|
X
|
|
XThe (v)global command is similar, but it searches for lines that do not
|
|
Xcontain the regular expression.
|
|
X
|
|
XLine Editing
|
|
X
|
|
X[line][,line] join
|
|
X[line][,line] ! program
|
|
X[line][,line] <
|
|
X[line][,line] >
|
|
X[line][,line] substitute /regexp/replacement/[p][g]
|
|
X
|
|
XThe (j)oin command concatenates all lines in the specified range
|
|
Xtogether to form one big line. If only a single line is specified,
|
|
Xthen the following line is catenated onto it.
|
|
X
|
|
XThe ! command runs an external filter program, and feeds the specified
|
|
Xrange of lines to its stdin. The lines are then replaced by the
|
|
Xoutput of the filter. A typical example would be ``:'a,'z!sort -n'' to
|
|
Xsort the lines 'a,'z according to their numeric values.
|
|
X
|
|
XThe < and > commands shift the specified range of lines left or right,
|
|
Xnormally by the width of 1 tab character. The ``shiftwidth'' option
|
|
Xdetermines the shifting amount.
|
|
X
|
|
XThe (s)ubstitute command finds the regular expression in each line, and
|
|
Xreplaces it with the replacement text. The ``p'' option causes the
|
|
Xaltered lines to be printed, and the ``g'' option permits all instances
|
|
Xof the regular expression to be found & replaced. (Without ``g'', only
|
|
Xthe first occurrence is replaced.)
|
|
X
|
|
XUndo
|
|
X
|
|
X undo
|
|
X
|
|
XThe (u)ndo command restores the file to the state it was in before your
|
|
Xmost recent command which changed text.
|
|
X
|
|
XConfiguration & Status
|
|
X
|
|
X map[!] [key mapped_to]
|
|
X unmap[!] key
|
|
X set [options]
|
|
X mkexrc
|
|
X[line] mark x
|
|
X visual
|
|
X version
|
|
X[line][,line] =
|
|
X file
|
|
X
|
|
XThe (ma)p command allows you to configure elvis to recognize your
|
|
Xfunction keys, and treat them as though they transmitted some other
|
|
Xsequence of characters. Normally this mapping is done only when in the
|
|
Xvisual command mode, but with the [!]present it will map keys under all
|
|
Xcontexts. When this command is given with no arguments, it prints a
|
|
Xtable showing all mappings currently in effect. When called with two
|
|
Xarguments, the first is the sequence that your function key really
|
|
Xsends, and the second is the sequence that you want elvis to treat it
|
|
Xas having sent.
|
|
X
|
|
XThe (unm)ap command removes key definitions that were made via the map
|
|
Xcommand.
|
|
X
|
|
XThe (se)t command allows you examine or set various options. With no
|
|
Xarguments, it displays the values of options that have been changed.
|
|
XWith the single argument ``all'' it displays the values of all
|
|
Xoptions, regardless of whether they've been explicitly set or not.
|
|
XOtherwise, the arguments are treated as options to be set.
|
|
X
|
|
XThe (mk)exrc command saves the current configuration to a file called
|
|
X.exrc in the current directory.
|
|
X
|
|
XThe mar(k) command defines a named mark to refer to a specific place in
|
|
Xthe file. This mark may be used later to specify lines for other
|
|
Xcommands.
|
|
X
|
|
XThe (vi)sual command puts the editor into visual mode. Instead of
|
|
Xemulating ex, elvis will start emulating vi.
|
|
X
|
|
XThe (ve)rsion command tells you that what version of elvis this is.
|
|
X
|
|
XThe = command tells you what line you specified, or, if you specified a
|
|
Xrange of lines, it will tell you both endpoints and the number of lines
|
|
Xincluded in the range.
|
|
X
|
|
XThe file command tells you the name of the file, whether it has been
|
|
Xmodified, the number of lines in the file, and the current line number.
|
|
X
|
|
XMultiple Files
|
|
X
|
|
X args [files]
|
|
X next[!] [files]
|
|
X Next[!]
|
|
X previous[!]
|
|
X rewind[!]
|
|
X
|
|
XWhen you invoke elvis from your shell's command line, any filenames
|
|
Xthat you give to elvis as arguments are stored in the args list. The
|
|
X(ar)gs command will display this list, or define a new one.
|
|
X
|
|
XThe (n)ext command switches from the current file to the next one in
|
|
Xthe args list. You may specify a new args list here, too.
|
|
X
|
|
XThe (N)ext and (pre)vious commands (they're really aliases for the same
|
|
Xcommand) switch from the current file to the preceding file in the args
|
|
Xlist.
|
|
X
|
|
XThe (rew)ind command switches from the current file to the first file
|
|
Xin the args list.
|
|
X
|
|
X
|
|
XSwitching Files
|
|
X
|
|
X
|
|
X edit[!] [file]
|
|
X tag[!] tagname
|
|
X
|
|
XThe (e)dit command allows youto switch from the current file to some
|
|
Xother file. This has nothing to do with the args list, by the way.
|
|
X
|
|
XThe (ta)g command looks up a given tagname in a file called ``tags".
|
|
XThis tells it which file the tag is in, and how to find it in that
|
|
Xfile. Elvis then switches to the tag's file and finds the tag.
|
|
X
|
|
X
|
|
XExiting
|
|
X
|
|
X
|
|
X quit[!]
|
|
X wq
|
|
X xit
|
|
X
|
|
XThe (q)uit command exits from the editor without saving your file.
|
|
X
|
|
XThe (wq) and (x)it commands (really two names for the same command)
|
|
Xboth write the file before exiting.
|
|
X
|
|
XFile I/O
|
|
X
|
|
X[line] read file
|
|
X[line][,line] write[!][[>>]file]
|
|
X
|
|
XThe (r)ead command gets text from another file and inserts it after the
|
|
Xspecified line.
|
|
X
|
|
XThe (w)rite command writes the whole file, or just part of it, to some
|
|
Xother file. The !, if present, will permit the lines to be written
|
|
Xeven if you've set the readonly option. If you precede the filename by
|
|
X>> then the lines will be appended to the file.
|
|
X
|
|
XDirectory
|
|
X
|
|
X cd [directory]
|
|
X chdir [directory]
|
|
X shell
|
|
X
|
|
XThe (cd) and (chd)ir commands (really two names for one command) switch
|
|
Xthe current working directory.
|
|
X
|
|
XThe (sh)ell command starts an interactive shell.
|
|
X
|
|
XDebugging
|
|
X
|
|
X[line][,line] debug[!]
|
|
X validate[!]
|
|
X
|
|
XThese commands are only available if you compile elvis with the -DDEBUG
|
|
Xflag.
|
|
X
|
|
XThe de(b)ug command lists stats for the blocks which contain the
|
|
Xspecified range of lines. If the ! is present, then the contents of
|
|
Xthose blocks is displayed, too.
|
|
X
|
|
XThe (va)lidate command checks certain variables for internal
|
|
Xconsistency. Normally it does not output anything unless it detects
|
|
Xa problem. With the !, though, it will always produce *some* output.
|
|
X
|
|
X10.6.3. Extensions
|
|
X
|
|
X In addition to the standard commands, a variety of extra features are
|
|
Xpresent in elvis that are not present in vi. They are described below.
|
|
X
|
|
X.exrc
|
|
X Elvis first runs a .exrc file (if there is one) from your $HOME
|
|
X directory. After that, it runs a .exrc (if there is one) from the
|
|
X current directory. The one in the current directory may override
|
|
X settings made by the one in the $HOME directory.
|
|
X
|
|
X:mkexrc
|
|
X:mk
|
|
X This EX command saves the current :set and :map configurations in the
|
|
X ``.exrc'' file in your current directory.
|
|
X
|
|
X:args
|
|
X:ar
|
|
X You can use the :args command to define a new args list, as in:
|
|
X
|
|
X :args *.h
|
|
X
|
|
X After you have defined a new args list, the next time you issue a
|
|
X :next command elvis will switch to the first file of the new list.
|
|
X
|
|
X:Next
|
|
X:previous
|
|
X:N
|
|
X:pre
|
|
X These commands move backwards through the args list.
|
|
X
|
|
Xzz
|
|
X In VI, the (lowercase) ``zz'' command will center the current line on
|
|
X the screen, like ``z="
|
|
X
|
|
X.
|
|
X The default count value for . is the same as the previous command
|
|
X which . is meant to repeat. However, you can supply a new count if
|
|
X you wish. For example, after ``3dw'', ``.'' will delete 3 words, but
|
|
X ``5.'' will delete 5 words.
|
|
X
|
|
X
|
|
X The text which was most recently input (via a ``cw'' command, or
|
|
X something similar) is saved in a cut buffer called ``. (which is a
|
|
X pretty hard name to write in an English sentence). You can use this
|
|
X with the ``p'' or ``P'' commands thusly:
|
|
X ".p
|
|
X
|
|
XK
|
|
X You can move the cursor onto a word and press shift-K to have elvis
|
|
X run a reference program to look that word up. This command alone is
|
|
X worth the price of admission! See the ctags and ref programs.
|
|
X
|
|
Xinput
|
|
X You can backspace back past the beginning of the line. If you type
|
|
X CTRL-A, then the text that you input last time is inserted. You will
|
|
X remain in input mode, so you can backspace over part of it, or add more
|
|
X to it. (This is sort of like CTRL-@ on the real vi, except that CTRL-A
|
|
X really works.)
|
|
X
|
|
X Real vi can only remember up to 128 characters of input, but elvis
|
|
X can remember any amount.
|
|
X
|
|
X:set charattr
|
|
X:se ca
|
|
X Elvis can display ``backslash-f'' style character attributes on the
|
|
X screen as you edit. The following example shows the recognized
|
|
X attributes:
|
|
X
|
|
X normal \fBboldface\fR \fIitalics\fR
|
|
X [Elvis can do this better than can be shown in this ASCII text]
|
|
X
|
|
X NOTE: you must compile elvis without the DSET_NOCHARATTR flag for
|
|
X this to work.
|
|
X
|
|
X10.6.4. Omissions
|
|
X
|
|
X A few vi features are missing. The replace mode is a hack. It does
|
|
Xnot save the text that it overwrites.
|
|
X Long lines are displayed differently-where the real vi would wrap a
|
|
Xlong line onto several rows of the screen, elvis simply displays part
|
|
Xof the line, and allows you to scroll the screen sideways to see the
|
|
Xrest of it.
|
|
X The ``:preserve'' and ``:recover'' commands are missing, as is the r
|
|
Xflag. ``:Preserve" is practically never used and since use of
|
|
X``:recover\*(CQ is so rare, it was decided to implement it as a
|
|
Xseparate program. There's no need to load the recovery code into
|
|
Xmemory every time you edit a file.
|
|
X LISP support is missing. The ``@'' and ``:@'' commands are missing.
|
|
XYou cannot APPEND to a cut buffer.
|
|
X
|
|
X10.6.5. Options
|
|
X
|
|
X A variety of options can be set as described below:
|
|
X Name Abbr Type Default Description
|
|
X autoindent as Bool FALSE autoindent during input?
|
|
X autowrite aw Bool FALSE write file for :n command?
|
|
X charattr ca Bool FALSE display bold & underline chars?
|
|
X columns co Number 80 width of screen, in characters
|
|
X directory dir String /usr/tmp where tmp files are kept
|
|
X errorbells eb Bool TRUE ring bell on error?
|
|
X exrefresh er Bool TRUEEX mode calls write() often?
|
|
X ignorecase ic Bool FALSE searches: upper/lowercase OK?
|
|
X keytime kt Number 1 allow slow receipt of ESC seq?
|
|
X keywordprg kp String /usr/bin/ref
|
|
X program to run for shift-K
|
|
X lines ln Number 25 height of screen, in lines
|
|
X list li Bool FALSE show tabs as ``^I''?
|
|
X magic ma Bool TRUE searches: allow metacharacters?
|
|
X paragraphs pa String PPppPApa paragraphs start with .PP, etc.
|
|
X readonly ro Bool FALSE no file should be written back?
|
|
X report re Number 5 report changes to X lines?
|
|
X scroll sc Number 12 default #lines for ^U and ^D
|
|
X sections se String SEseSHsh sections start with .SE, etc.
|
|
X shell sh String /bin/sh shell program, from environment
|
|
X shiftwidth sw Number 8 width of < or > commands
|
|
X sidescroll ss Number 8 #chars to scroll sideways by
|
|
X sync sy Bool FALSE call sync() after each change?
|
|
X tabstop ts Number 8 width of a tab character
|
|
X term te String "?" terminal type, from environment
|
|
X vbell vb Bool TRUE use visible bell if possible?
|
|
X warn wa Bool TRUE warn if file not saved for :!cmd
|
|
X wrapmargin wm Number 0 Insert newline after which col?
|
|
X wrapscan ws Bool TRUE searches: wrap at EOF?
|
|
X
|
|
Xautoindent
|
|
X During input mode, the autoindent option will cause each added line
|
|
X to begin with the same amount of leading whitespace as the line above
|
|
X it. Without autoindent, added lines are initially empty.
|
|
X
|
|
Xautowrite
|
|
X When you're editing one file and decide to switch to another-via the
|
|
X :tag command, or :next command, perhaps-if your current file has been
|
|
X modified, then elvis will normally print an error message and refuse to
|
|
X switch.
|
|
X
|
|
X However, if the autowrite option is on, then elvis will write the
|
|
X modified version of the current file and successfully switch to the new
|
|
X file.
|
|
X
|
|
Xcharattr
|
|
X Many text formatting programs allow you to designate portions of your
|
|
X text to be underlined, italicized, or boldface by embedding the special
|
|
X strings \fU, \fI, and \fB in your text. The special string \fR marks
|
|
X the end of underlined or boldface text.
|
|
X
|
|
X Elvis normally treats those special strings just like any other text.
|
|
X However, if the charattr option is on, then elvis will interpret those
|
|
X special strings correctly, to display underlined or boldface text on
|
|
X the screen. (This only works, of course, if your terminal can
|
|
X display underlined and boldface, and if the TERMCAP entry says how to
|
|
X do it.)
|
|
X
|
|
Xcolumns
|
|
X This is a ``read only'' option. You cannot change its value, but you
|
|
X can have elvis print it. It shows how wide your screen is.
|
|
X
|
|
Xdirectory
|
|
X Elvis uses temporary files to store changed text. This option allows
|
|
X you to control where those temporary files will be. Ideally, you
|
|
X should store them on in fast non-volatile memory, such as a hard
|
|
X disk.
|
|
X
|
|
X This option can only be set in the ".exrc" file.
|
|
X
|
|
Xerrorbells
|
|
X Normally, elvis will ring your terminal's bell if you make an error.
|
|
X However, in noerrorbells mode, your terminal will remain silent.
|
|
X
|
|
Xexrefresh
|
|
X The EX mode of elvis writes many lines to the screen. You can make
|
|
X elvis either write each line to the screen separately, or save up many
|
|
X lines and write them all at once.
|
|
X
|
|
X The exrefresh option is normally on, so each line is written to the
|
|
X screen separately.
|
|
X
|
|
X You may wish to turn the exrefresh option off (:se noer) if the
|
|
X ``write'' system call is costly on your machine, or if you're using a
|
|
X windowing environment. (Windowing environments scroll text a lot
|
|
X faster when you write many lines at once.)
|
|
X
|
|
X This option has no effect in vi mode.
|
|
X
|
|
Xignorecase
|
|
X Normally, when elvis searches for text, it treats uppercase letters
|
|
X as being different for lowercase letters.
|
|
X
|
|
X When the ignorecase option is on, uppercase and lowercase are treated
|
|
X as equal.
|
|
X
|
|
Xkeytime
|
|
X The arrow keys of most terminals send a multi-character sequence. It
|
|
X takes a measurable amount of time for these sequences to be
|
|
X transmitted. The keytime option allows you to control the maximum
|
|
X amount of time to allow for an arrow key (or other mapped key) to be
|
|
X received in full.
|
|
X
|
|
X The default keytime value is 2. Because of the way UNIX timekeeping
|
|
X works, the actual amount of time allowed will vary slightly, but it
|
|
X will always be between 1 and 2 seconds.
|
|
X
|
|
X If you set keytime to 1, then the actual amount of time allowed will
|
|
X be between 0 and 1 second. This will generally make the keyboard's
|
|
X response be a little faster (mostly for the ESC key), but on those
|
|
X occasions where the time allowed happens to be closer to 0 than 1
|
|
X second, elvis may fail to allow enough time for an arrow key's sequence
|
|
X to be received fully. Ugh.
|
|
X
|
|
X As a special case, you can set keytime to 0 to disable this time
|
|
X limit stuff altogether. The big problem here is: If your arrow keys'
|
|
X sequences start with an ESC, then every time you hit your ESC key elvis
|
|
X will wait... and wait... to see if maybe that ESC was part of an
|
|
X arrow key's sequence.
|
|
X
|
|
X NOTE: this option is a generalization of the timeout option of the real vi.
|
|
X
|
|
Xkeywordprg
|
|
X Elvis has a special keyword lookup feature. You move the cursor onto
|
|
X a word, and hit shift-K, and elvis uses another program to look up the
|
|
X word and display information about it.
|
|
X
|
|
X This option says which program gets run. It should contain the full
|
|
X pathname of the program; your whole execution path is not checked.
|
|
X
|
|
X The default value of this option is /usr/bin/ref, which is a program
|
|
X that looks up the definition of a function in C. It looks up the
|
|
X function name in a file called ``refs'' which is created by ctags.
|
|
X
|
|
X You can substitute other programs, such as an English dictionary
|
|
X program or the online manual. elvis runs the program, using the
|
|
X keyword as its only argument. The program should write information to
|
|
X stdout. The program's exit status should be 0, unless you want elvis
|
|
X to print ``<<< failed >>>".
|
|
X
|
|
Xlines
|
|
X This ``read only'' option shows how many lines you screen has.
|
|
X
|
|
Xlist
|
|
X Normally (in ``nolist" mode) elvis will expand tabs to the proper
|
|
X number of spaces on the screen, so that the file appears the same would
|
|
X it would be if you printed it or looked at it with more.
|
|
X
|
|
X Sometimes, though, it can be handy to have the tabs displayed as
|
|
X ``^I". In ``list" mode, elvis does this, and also displays a ``$"
|
|
X after the end of the line.
|
|
X
|
|
Xmagic
|
|
X The search mechanism in elvis can accept ``regular expressions'' -
|
|
X strings in which certain characters have special meaning. The magic
|
|
X option is normally on, which causes these characters to be treated
|
|
X specially. If you turn the magic option off (:se noma), then all
|
|
X characters except ^ and $ are treated literally. ^ and $ retain their
|
|
X special meanings regardless of the setting of magic.
|
|
X
|
|
Xparagraphs
|
|
X The { and } commands move the cursor forward or backward in
|
|
X increments of one paragraph. Paragraphs may be separated by blank
|
|
X lines, or by a ``dot'' command of a text formatter. Different text
|
|
X formatters use different ``dot'' commands. This option allows you to
|
|
X configure elvis to work with your text formatter.
|
|
X
|
|
X It is assumed that your formatter uses commands that start with a
|
|
X ".'' character at the front of a line, and then have a one- or
|
|
X two-character command name.
|
|
X
|
|
X The value of the paragraphs option is a string in which each pair of
|
|
X characters is one possible form of your text formatter's paragraph
|
|
X command.
|
|
X
|
|
Xreadonly
|
|
X Normally, elvis will let you write back any file to which you have
|
|
X write permission. If you do not have write permission, then you can
|
|
X only write the changed version of the file to a different file.
|
|
X
|
|
X If you set the readonly option, then elvis will pretend you do not
|
|
X have write permission to any file you edit. It is useful when you
|
|
X really only mean to use elvis to look at a file, not to change it.
|
|
X This way you cannot change it accidentally.
|
|
X
|
|
X This option is normally off, unless you use the ``view'' alias of
|
|
X elvis. ``View'' is like vi except that the readonly option is on.
|
|
X
|
|
Xreport
|
|
X Commands in elvis may affect many lines. For commands that affect a
|
|
X lot of lines, elvis will output a message saying what was done and how
|
|
X many lines were affected. This option allows you to define what ``a
|
|
X lot of lines'' means. The default is 5, so any command which affects 5
|
|
X or more lines will cause a message to be shown.
|
|
X
|
|
Xscroll
|
|
X The CTRL-U and CTRL-D keys normally scroll backward or forward by
|
|
X half a screenful, but this is adjustable. The value of this option
|
|
X says how many lines those keys should scroll by.
|
|
X
|
|
Xsections
|
|
X The [[ and ]] commands move the cursor backward or forward in
|
|
X increment of 1 section. Sections may be delimited by a { character in
|
|
X column 1 (which is useful for C source code) or by means of a text
|
|
X formatter's ``dot'' commands.
|
|
X
|
|
X This option allows you to configure elvis to work with your text
|
|
X formatter's ``section'' command, in exactly the same way that the
|
|
X paragraphs option makes it work with the formatter's ``paragraphs"
|
|
X command.
|
|
X
|
|
Xshell
|
|
X When elvis forks a shell (perhaps for the :! or :shell commands)
|
|
X this is the program that is uses as a shell. This is /bin/sh by
|
|
X default, unless you have set the SHELL environment variable, it which
|
|
X case the default value is copied from the environment.
|
|
X
|
|
Xshiftwidth
|
|
X The < and > commands shift text left or right by some uniform number
|
|
X of columns. The shiftwidth option defines that uniform number. The
|
|
X default is 8.
|
|
X
|
|
Xsidescroll
|
|
X For long lines, elvis scrolls sideways. (This is different from the
|
|
X real vi, which wraps a single long line onto several rows of the
|
|
X screen.) To minimize the number of scrolls needed, elvis moves the
|
|
X screen sideways by several characters at a time. The value of this
|
|
X option says how many characters' widths to scroll at a time.
|
|
X Generally, the faster your screen can be redrawn, the lower the value
|
|
X you will want in this option.
|
|
X
|
|
Xsync
|
|
X If the system crashes during an edit session, then most of your work
|
|
X can be recovered from the temporary file that elvis uses to store
|
|
X changes. However, sometimes MINIX will not copy changes to the hard
|
|
X disk immediately, so recovery might not be possible. The [no]sync
|
|
X option lets you control this. In nosync mode (which is the default),
|
|
X elvis lets the operating system control when data is written to the
|
|
X disk. This is generally faster. In sync mode, elvis forces all
|
|
X changes out to disk every time you make a change. This is generally
|
|
X safer, but slower.
|
|
X
|
|
Xtabstop
|
|
X Tab characters are normally 8 characters wide, but you can change
|
|
X their widths by means of this option.
|
|
X
|
|
Xterm
|
|
X This ``read only'' option shows the name of the termcap entry that
|
|
X elvis is using for your terminal.
|
|
X
|
|
Xvbell
|
|
X If your termcap entry describes a visible alternative to ringing your
|
|
X terminal's bell, then this option will say whether the visible version
|
|
X gets used or not. Normally it will be.
|
|
X
|
|
X If your termcap does NOT include a visible bell capability, then the
|
|
X vbell option will be off, and you cannot turn it on.
|
|
X
|
|
Xwarn
|
|
X Elvis will normally warn you if you run a shell command without
|
|
X saving your changed version of a file. The ``nowarn" option prevents
|
|
X this warning.
|
|
X
|
|
Xwrapmargin
|
|
X Normally (with wrapmargin=0) elvis will let you type in extremely
|
|
X long lines, if you wish. However, with wrapmargin set to something
|
|
X other that 0 (wrapmargin=65 is nice), elvis will automatically cause
|
|
X long lines to be ``wrapped" on a word break for lines longer than
|
|
X wrapmargin's setting.
|
|
X
|
|
Xwrapscan
|
|
X Normally, when you search for something, elvis will find it no matter
|
|
X where it is in the file. elvis starts at the cursor position, and
|
|
X searches forward. If elvis hits EOF without finding what you're
|
|
X looking for, then it wraps around to continue searching from line 1.
|
|
X
|
|
X If you turn off the wrapscan option (:se nows), then when elvis hits
|
|
X EOF during a search, it will stop and say so.
|
|
X
|
|
X10.6.6. Cflags
|
|
X
|
|
X Elvis uses many preprocessor symbols to control compilation. Most
|
|
Xof these flags allow you to disable small sets of features. MINIX-ST
|
|
Xusers will probably want all features enabled, but MINIX-PC users will
|
|
Xhave to disable one or two feature sets because otherwise elvis would
|
|
Xbe too large to compile and run.
|
|
X
|
|
XThese symbols can be defined via flags passed to the compiler. The
|
|
Xbest way to do this is to edit the Makefile, and append the flag to the
|
|
X``CFLAGS='' line. After you do that, you must recompile elvis
|
|
Xcompletely by saying
|
|
X make clean
|
|
X make
|
|
X
|
|
X_DM_SYSV
|
|
X This flag causes elvis to use System-V ioctl() calls for controlling
|
|
X your terminal; normally it uses v7/BSD/MINIX ioctl() calls.
|
|
X
|
|
X_DDATE
|
|
X The symbol DATE should be defined to look like a string constant,
|
|
X giving the date when elvis was compiled. This date is reported by the
|
|
X ``:version'' command.
|
|
X
|
|
X You can also leave DATE undefined, in which case ``:version'' will
|
|
X not report the compilation date.
|
|
X
|
|
X_DCRUNCH
|
|
X This flag causes several large often-used macros to be replaced by
|
|
X equivalent functions. This saves about 4K of space in the ``.text''
|
|
X segment, and it does not cost you any features.
|
|
X
|
|
X_DDEBUG
|
|
X This adds many internal consistency checks and the ``:debug'' and
|
|
X ``:validate'' commands. It increases the size of ``text'' by about
|
|
X 5K bytes.
|
|
X
|
|
X_DNO_CHARATTR
|
|
X This permanenently disables the ``charattr'' option. It reduces the
|
|
X size of ``.text'' by about 850 bytes.
|
|
X
|
|
X_DNO_RECYCLE
|
|
X Normally, elvis will recycle space in the temporary file which
|
|
X contains totally obsolete text. The DNO_RECYCLE option disables this,
|
|
X making your ``.text'' segment smaller by about 1K but also permitting
|
|
X the temporary file to grow very quickly. If you have less than two
|
|
X megabytes of free space on your disk, then do not even consider using
|
|
X this flag.
|
|
X
|
|
X_DNO_SENTENCE
|
|
X This leaves out the ``('' and ``)'' visual commands, and removes the
|
|
X code that allows the ``[['', ``]]'', ``{'', and ``}'' commands to
|
|
X recognize nroff macros. The ``[['' and ``]]'' commands will still move
|
|
X to the start of the previous/next C function source code, though, and
|
|
X ``{'' and ``}'' will move to the previous/next blank line. This saves
|
|
X about 650 bytes from the ``.text'' segment.
|
|
X
|
|
X_DNO_CHARSEARCH
|
|
X This leaves out the visual commands which locate a given character in
|
|
X the current line: ``f'', ``t'', ``F'', ``T'', ``;'', and ``,''. This
|
|
X saves about 900 bytes.
|
|
X
|
|
X_DNO_EXTENSIONS
|
|
X This leaves out the ``:mkexrc'' command, and the ``K'' and ``#''
|
|
X visual commands. Other extensions are either inherent in the design of
|
|
X elvis, or are too tiny to be worth removing. This saves about 500
|
|
X bytes.
|
|
X
|
|
X_DNO_MAGIC
|
|
X This permanently disables the ``magic'' option, so that most
|
|
X meta-characters in a regular expression are not recognized. This saves
|
|
X about 3K bytes from the ``.text'' segment.
|
|
X
|
|
X10.6.7. Termcap
|
|
X
|
|
XElvis can use standard termcap entries, but it also recognizes and uses
|
|
Xseveral extra capabilities, if you give them. All of these are
|
|
Xoptional.
|
|
X Capability Description
|
|
X :PU=: sequence received from the <PgUp> key
|
|
X :PD=: sequence received from the <PgDn> key
|
|
X :HM=: sequence received from the <Home> key
|
|
X :EN=: sequence received from the <End> key
|
|
X :VB=: sequence sent to start bold printing
|
|
X :Vb=: sequence sent to end bold printing
|
|
X
|
|
X10.6.8. Author
|
|
X
|
|
X Elvis was written by Steve Kirkendall. He can be reached by email
|
|
Xat: kirkenda@cs.pdx.edu, or ...!uunet!tektronix!psueea!eecs!kirkenda
|
|
Xfor comments regarding elvis.
|
|
X
|
|
X
|
|
/
|
|
echo x - ic.7
|
|
sed '/^X/s///' > ic.7 << '/'
|
|
XName: ic - integer calculator
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.7. IC - INTEGER CALCULATOR
|
|
X
|
|
X Ic is a simple RPN (Reverse Polish Notation) calculator, used for
|
|
Xsmall calculations and base conversions. All calculations are done
|
|
Xusing 32 bit integers. The standard input is usually a keyboard and
|
|
Xthe standard output requires a device with a ``termcap'' entry. The
|
|
Xprogram starts by interpreting any <args> as commands, where the
|
|
Xseparation between arguments is considered to be the same as the ENTER
|
|
Xkey. For example,
|
|
X ic 692 784+
|
|
XAfter reading the arguments input is from the keyboard.
|
|
X
|
|
X10.7.1. Stack Operations
|
|
X
|
|
X The operation of this program is similar to an RPN calculator. A
|
|
Xsix level stack is used. The ENTER key pushes the stack up one level.
|
|
XFor example, ``12+5'' is entered as ``12 ENTER 5 +".
|
|
X The top two entries on the stack are exchanged by the x command, and
|
|
Xthe stack is rolled down one (popped) by the p key. The top of the
|
|
Xstack may be cleared by pressing the back-space key. The whole stack
|
|
Xand the registers are initialized by a z.
|
|
X
|
|
X10.7.2. Numeric Entry
|
|
X
|
|
X The input and output bases are initially decimal, but they may be
|
|
Xchanged using the i and o commands. The i command changes both bases,
|
|
Xbut the o command changes just the output base. These commands take a
|
|
Xone character argument of h, d, o or b to change to Hexadecimal,
|
|
XDecimal, Octal or Binary. While the input base is hexadecimal the
|
|
Xletters a through f are used to represent the decimal values 10 through
|
|
X15.
|
|
X When the input base is decimal: multiply, divide and remainder are
|
|
Xsigned, otherwise they are performed unsigned.
|
|
X The output base may also be changed to ASCII (a), this causes the
|
|
Xleast significant 7 bits of a value to be displayed as a character.
|
|
XTo input an ASCII value the translate (t) command may be used, it
|
|
Xaccepts one character as its argument.
|
|
X
|
|
X10.7.3. Calculations
|
|
X
|
|
X The arithmetic operations supported are: Negate (``.''), Add
|
|
X(``+''), Subtract (`` - ''), Multiply (``*''), Divide (``/''), and
|
|
XRemainder (``%''). The logical (Boolean) operations available are: NOT
|
|
X(`` ''), AND (``&''), OR (``|''), and EXCLUSIVE-OR (``^'').
|
|
X After one of these operations the last top of stack value is saved.
|
|
XIt may be restored by pressing l (L).
|
|
X
|
|
X10.7.4. Saving Results
|
|
X
|
|
X Ten temporary registers are available. The Store (s) command
|
|
Xfollowed by a digit (``0''..``9'') will copy the top of the stack to
|
|
Xthe specified register. The Recall (r) command pushes the contents of
|
|
Xa register onto the top of the stack.
|
|
X If the Store command is followed by a ``+'' preceding the digit,
|
|
Xthen the top of the stack will be added to the specified
|
|
X``accumulator'' register.
|
|
X Values may also be written to a file. The w command writes the top
|
|
Xof the stack, using the current output base, to a file called ``pad''
|
|
Xin the current directory. If the user does not have write access to
|
|
Xthe current directory then the file /tmp/pad_$USER is used as the
|
|
Xscratch pad. The scratch pad file is erased on the first use of the w
|
|
Xcommand within each new invocation of ``ic''.
|
|
X
|
|
X10.7.5. Miscellaneous
|
|
X
|
|
X The Quit (q) key causes an immediate exit. The m command
|
|
Xtemporarily leaves ic by invoking the shell as a sub-process. For help
|
|
Xwhile using ic, hit the h key. If an erroneous key is pressed the bell
|
|
Xwill sound.
|
|
X
|
|
X10.7.6. Command Summary
|
|
X
|
|
X Note that many commands have an alternative key-code available on
|
|
Xthe extended AT keyboard. This aids entry by including most commands
|
|
Xon the right side of the keyboard.
|
|
X ENTER Enter (push up)
|
|
X BS (DEL) Clear top of stack
|
|
X h Help
|
|
X i Input base (h, d, o, b)
|
|
X l (PGDN) Last top of stack
|
|
X m MINIX shell
|
|
X o Output base (h, d, o, b, a)
|
|
X p (DOWN) Pop stack (roll down)
|
|
X q (END) Quit
|
|
X r (LEFT) Recall (0-9)
|
|
X s (RIGHT) Store [+] (0-9)
|
|
X t Translate (char)
|
|
X w (PGUP) Write top of stack to scratch pad
|
|
X x (UP) Exchange top of stack
|
|
X z (HOME) Zero all state
|
|
X . Change sign
|
|
X + (+) Add
|
|
X - (-) Subtract
|
|
X * Multiply
|
|
X / Divide
|
|
X % (sh/5) Remainder
|
|
X (tilde) Not
|
|
X & And
|
|
X | Or
|
|
X ^ Exclusive-or
|
|
X
|
|
X10.7.7. Author
|
|
X
|
|
X Ic was written by Terrence W. Holm.
|
|
X
|
|
/
|
|
echo x - indent.7
|
|
sed '/^X/s///' > indent.7 << '/'
|
|
XName: indent - indent and format C programs
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.8. INDENT - INDENT AND FORMAT C PROGRAMS
|
|
X
|
|
X Indent reads a C program in, rearranges the layout, and outputs a
|
|
Xnew C program that will compile to the same executable binary as the
|
|
Xoriginal one. The difference between the input and output is that the
|
|
Xoutput is in a standard layout determined by a large number of
|
|
Xoptions. For most of the options there are two choices, one that
|
|
Xenables it and one that disables it.
|
|
X If indent is called with no file files, it operates as a filter. If
|
|
Xcalled with one file name, that file is reformatted and the result
|
|
Xreplaces the original file. A backup is created, however, with the
|
|
Xsuffix .BAK. If it is called with two file names, the first one is the
|
|
Xinput file and the second one is the output file. Only one file can be
|
|
Xreformatted at a time (e.g., one cannot call indent with *.c as
|
|
Xargument; this is an error and will not work.).
|
|
X
|
|
X10.8.1. Options
|
|
X
|
|
X Many options are available. If you want to format a program to the
|
|
X``official'' MINIX format, use pretty, which calls indent with the
|
|
Xproper options and then postprocesses the output. The options listed
|
|
Xbelow control the formatting style.
|
|
X
|
|
XOPTION: bad, nbad
|
|
X If bad is specified, a blank line is forced after every block of
|
|
Xdeclarations. Default: nbad.
|
|
X
|
|
XOPTION: bap, nbap
|
|
X If bap is specified, a blank line is forced after every procedure
|
|
Xbody. Default: nbap.
|
|
X
|
|
XOPTION: bbb, nbbb
|
|
X If bbb is specified, a blank line is forced before every block
|
|
Xcomment. Default: nbbb.
|
|
X
|
|
XOPTION: bc, nbc
|
|
X If bc is specified, then a newline is forced after each comma in a
|
|
Xdeclaration. nbc turns off this option. The default is nbc.
|
|
X
|
|
XOPTION: bl, br
|
|
X Specifying bl lines up compound statements like this:
|
|
X if (...)
|
|
X {
|
|
X code
|
|
X }
|
|
XSpecifying br (the default) makes them look like this:
|
|
X if (...) {
|
|
X code
|
|
X }
|
|
X
|
|
XOPTION: cn
|
|
X The column in which comments on code start. The default is 33.
|
|
X
|
|
XOPTION: cdn
|
|
X The column in which comments on declarations start. The default is
|
|
Xfor these comments to start in the same column as those on code.
|
|
X
|
|
XOPTION: cdb, ncdb
|
|
X Enables (disables) the placement of comment delimiters on blank
|
|
Xlines. With this option enabled, comments look like this:
|
|
X /*
|
|
X * this is a comment
|
|
X */
|
|
XRather than like this:
|
|
X /* this is a comment */ This only affects block comments, not
|
|
Xcomments to the right of code. The default is cdb.
|
|
X
|
|
XOPTION: ce, nce
|
|
X Enables (disables) forcing ``else''s to cuddle up to the immediately
|
|
Xpreceding ``}''. The default is ce.
|
|
X
|
|
XOPTION: cin
|
|
X Sets the continuation indent to be n. Continuation lines will be
|
|
Xindented that far from the beginning of the first line of the
|
|
Xstatement. Parenthesized expressions have extra indentation added to
|
|
Xindicate the nesting, unless lp is in effect. ci defaults to the same
|
|
Xvalue as i.
|
|
X
|
|
XOPTION: clin
|
|
X Causes case labels to be indented n tab stops to the right of the
|
|
Xcontaining switch statement. cli0.5 causes case labels to be indented
|
|
Xhalf a tab stop. The default is cli0. (This is the only option that
|
|
Xtakes a fractional argument.)
|
|
X
|
|
XOPTION: dn
|
|
X Controls the placement of comments which are not to the right of
|
|
Xcode. Specifying d1 means that such comments are placed one
|
|
Xindentation level to the left of code. The default d0 lines up these
|
|
Xcomments with the code. See the section on comment indentation below.
|
|
X
|
|
XOPTION: din
|
|
X Specifies the indentation, in character positions, from a
|
|
Xdeclaration keyword to the following identifier. The default is di16.
|
|
X
|
|
XOPTION: dj, ndj
|
|
X dj left justifies declarations. ndj indents declarations the same
|
|
Xas code. The default is ndj.
|
|
X
|
|
XOPTION: ei, nei
|
|
X Enables (disables) special elseif processing. If enabled, ifs
|
|
Xfollowing elses will have the same indentation as the preceding if
|
|
Xstatement. The default is ei.
|
|
X
|
|
XOPTION: fc1, nfc1
|
|
X Enables (disables) the formatting of comments that start in column
|
|
X1. Often, comments whose leading ``/'' is in column 1 have been
|
|
Xcarefully hand formatted by the programmer. In such cases, nfc1 should
|
|
Xbe used. The default is fc1.
|
|
X
|
|
XOPTION: in
|
|
X The number of spaces for one indentation level. The default is 8.
|
|
X
|
|
XOPTION: ip, nip
|
|
X Enables (disables) the indentation of parameter declarations from
|
|
Xthe left margin. The default is ip.
|
|
X
|
|
XOPTION: ln
|
|
X Maximum length of an output line. The default is 78.
|
|
X
|
|
XOPTION: lp, nlp
|
|
X Lines up code surrounded by parenthesis in continuation lines. If a
|
|
Xline has a left paren which is not closed on that line, then
|
|
Xcontinuation lines will be lined up to start at the character position
|
|
Xjust after the left paren.
|
|
X
|
|
XOPTION: npro
|
|
X Causes the profile files, .indent.pro in both the current directory
|
|
Xand the user's home directory to be ignored.
|
|
X
|
|
XOPTION: pcs, npcs
|
|
X If true (pcs) all procedure calls will have a space inserted between
|
|
Xthe name and the ``(''. The default is npcs.
|
|
X
|
|
XOPTION: ps, nps
|
|
X If true (ps) the pointer following operator ``>'' will be surrounded
|
|
Xby spaces on either side. The default is nps.
|
|
X
|
|
XOPTION: psl, npsl
|
|
X If true (psl) the names of procedures being defined are placed in
|
|
Xcolumn 1 their types, if any, will be left on the previous lines. The
|
|
Xdefault is psl.
|
|
X
|
|
XOPTION: sc, nsc
|
|
X Enables (disables) the placement of asterisks (*) at the left edge
|
|
Xof all comments. The default is sc.
|
|
X
|
|
XOPTION: sob, nsob
|
|
X If sob is specified, indent will swallow optional blank lines. You
|
|
Xcan use this to get rid of blank lines after declarations. The default
|
|
Xis nsob.
|
|
X
|
|
XOPTION: st
|
|
X Causes indent to take its input from stdin, and put its output to
|
|
Xstdout.
|
|
X
|
|
XOPTION: Ttypename
|
|
X Adds typename to the list of type keywords. Names accumulate: T can
|
|
Xbe specified more than once. You need to specify all the typenames
|
|
Xthat appear in your program that are defined by #typedefs. Nothing
|
|
Xwill be harmed if you miss a few, but the program will not be formatted
|
|
Xas nicely as it should. This sounds like a painful thing to have to
|
|
Xdo, but it is really a symptom of a problem in C: typedef causes a
|
|
Xsyntactic change in the language and indent cannot find all typedefs.
|
|
X
|
|
XOPTION: troff
|
|
X Causes indent to format the program for processing by troff. It
|
|
Xwill produce a fancy listing in much the same spirit as vgrind. If the
|
|
Xoutput file is not specified, the default is standard output, rather
|
|
Xthan formatting in place.
|
|
X
|
|
XOPTION: v, nv
|
|
X The v flag turns on verbose mode; nv turns it off. When in verbose
|
|
Xmode, indent reports when it splits one line of input into two or more
|
|
Xlines of output, and gives some size statistics at completion. The
|
|
Xdefault is nv.
|
|
X
|
|
X10.8.2. User Profiles
|
|
X
|
|
X You may set up your own profile of defaults to indent by creating a
|
|
Xfile called .indent.pro in either your login directory and/or the
|
|
Xcurrent directory and including whatever switches you like. Switches
|
|
Xin .indent.pro in the current directory override those in your login
|
|
Xdirectory (with the exception of T type definitions, which just
|
|
Xaccumulate). If indent is run and a profile file exists, then it is
|
|
Xread to set up the program's defaults. The switches should be
|
|
Xseparated by spaces, tabs or newlines. Switches on the command line,
|
|
Xhowever, override profile switches.
|
|
X
|
|
X10.8.3. Comments
|
|
X
|
|
X Indent assumes that any comment with a dash or star immediately
|
|
Xafter the start of comment (that is, ``/*'' or ``/**'') is a comment
|
|
Xsurrounded by a box of stars. Each line of such a comment is left
|
|
Xunchanged, except that its indentation may be adjusted to account for
|
|
Xthe change in indentation of the first line of the comment.
|
|
X All other comments are treated as straight text. Indent fits as
|
|
Xmany words (separated by blanks, tabs, or newlines) on a line as
|
|
Xpossible. Blank lines break paragraphs.
|
|
X If a comment is on a line with code it is started in the comment
|
|
Xcolumn, which is set by the cn command line parameter. Otherwise, the
|
|
Xcomment is started at n indentation levels less than where code is
|
|
Xcurrently being placed, where n is specified by the dn command line
|
|
Xparameter. If the code on a line extends past the comment column, the
|
|
Xcomment starts further to the right, and the right margin may be
|
|
Xautomatically extended in extreme cases.
|
|
X
|
|
X10.8.4. Preprocessor Lines
|
|
X
|
|
X In general, indent leaves preprocessor lines alone. The only
|
|
Xreformatting that it will do is to straighten up trailing comments. It
|
|
Xleaves embedded comments alone. Conditional compilation
|
|
X(#ifdef...#endif) is recognized and indent attempts to correctly
|
|
Xcompensate for the syntactic peculiarities introduced.
|
|
X
|
|
X10.8.5. C Syntax
|
|
X
|
|
X Indent understands a substantial amount about the syntax of C, but
|
|
Xit has a forgiving parser. It attempts to cope with the usual sorts of
|
|
Xincomplete and misformed syntax. In particular, the use of macros
|
|
Xlike:
|
|
X #define forever for(;;)
|
|
Xis handled properly.
|
|
X
|
|
X
|
|
/
|
|
echo x - kermit.7
|
|
sed '/^X/s///' > kermit.7 << '/'
|
|
XName: kermit - communications and file transfer program
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.9. KERMIT - A FILE TRANSFER PROGRAM
|
|
X
|
|
X This is a slightly lobotomized kermit. The help command, the script
|
|
Xfacility, and the automatic dial support have been removed. The ?
|
|
Xand ESC commands still work, so there is still reasonable built-in
|
|
Xhelp. The only V7 kermit feature that does not work is the ability to
|
|
Xsee whether there are input characters waiting. This means that you
|
|
Xwill not be able to ask for status during a file transfer (though this
|
|
Xis not critical, because kermit prints a dot every so often and other
|
|
Xspecial characters whenever there is an error or timeout).
|
|
X To use kermit on an IBM PC, you must first set the line speed
|
|
X(because kermit cannot do this) although it cannot hurt to set it on
|
|
Xthe 68000 as well. To set it to 2400 baud, for example, type:
|
|
X stty 2400 </dev/tty1
|
|
XNow start kermit, and then type
|
|
X set line /dev/tty1
|
|
X set speed 2400
|
|
X connect (It is more convenient if you put these commands in
|
|
X.kermrc in your home directory, so that they get done automatically
|
|
Xwhenever you run kermit.) This will connect you to the modem or
|
|
Xwhatever on the serial port. Now log into the other system.
|
|
X When you want to transfer files, run kermit on the other system. To
|
|
Xit, type
|
|
X server
|
|
XThis puts its kermit into a sort of ``slave mode'' where it expects
|
|
Xcommands from the kermit running on your MINIX system. Now come back
|
|
Xto the command level on MINIX kermit, by typing the escape character
|
|
Xfollowed by c. (Kermit will tell you the current escape character when
|
|
Xyou do the connect command.) At this point you can issue various
|
|
Xcommands. Your kermit will coordinate things with kermit on the other
|
|
Xmachine so that you only have to type commands at one end. Common
|
|
Xcommands are
|
|
X get filename
|
|
X put filename
|
|
X remote dir
|
|
X
|
|
XFilenames can include wildcards. By default, kermit works in a system-
|
|
Xindependent, text mode. (In effect it assumes that the whole world is
|
|
XMS-DOS and converts end of line and file names accordingly.) To send
|
|
Xbinary files, you will want to type
|
|
X set file type bin on both ends before starting any transfers.
|
|
XThis disables CR LF to newline conversion. If both of your systems are
|
|
Xsome flavor of UNIX, you might as well put this in .kermrc on both ends
|
|
Xand run in binary mode all the time. Also, if both systems are UNIX it
|
|
Xis recommended that you use
|
|
X set file name lit on both ends. This causes it to keep file names
|
|
Xunchanged, rather than mapping to legal MS-DOS names.
|
|
X Here is a typical .kermrc for use on MINIX:
|
|
X set line /dev/tty1
|
|
X set speed 1200
|
|
X set esc 29
|
|
X set file type bin
|
|
X set file name lit
|
|
X set retry 90
|
|
X set prompt MINIX kermit>
|
|
X connect
|
|
X On the other end of the line, for example, the host at your local
|
|
Xcomputer center to which you want to transfer files, a typical profile
|
|
Xmight be:
|
|
X set rec packet 1000
|
|
X set fil name lit
|
|
X set fil type bin
|
|
X server
|
|
X On the IBM PC, It is not possible to recompile kermit on MINIX
|
|
Xbecause it is so large that the assembler runs out of memory. However,
|
|
Xyou may be able to recompile it on MS-DOS using one of the C compilers
|
|
Xthere. You will have to convert the binary to MINIX format, however.
|
|
X[With Minix 1.7 it can now be compiled on Minix]
|
|
X Kermit has many other options and features. For a pleasant and
|
|
Xhighly readable description of it, see the following book:
|
|
X Title: Kermit: A File Transfer Protocol
|
|
X Author: Frank da Cruz
|
|
X Publisher: Digital Press
|
|
X Date: 1987
|
|
X ISBN: 0-932376-88
|
|
X For information about recent kermit developments, versions for other
|
|
Xsystems, and so forth, please contact:
|
|
X Christine M. Gianone
|
|
X Manager, Kermit Development and Distribution
|
|
X University Center for Computing Activities
|
|
X Columbia University
|
|
X 612 West 115th Street
|
|
X New York, N.Y. 10025
|
|
XOver 400 versions of kermit are available, so it is likely there is one
|
|
Xfor any computer your MINIX system might want to talk to. Columbia
|
|
XUniversity also publishes a newsletter about kermit that can be
|
|
Xrequested from the above address.
|
|
X
|
|
X
|
|
/
|
|
echo x - m4.7
|
|
sed '/^X/s///' > m4.7 << '/'
|
|
XName: m4 - macro processor
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.10. M4 - MACRO PROCESSOR
|
|
X
|
|
X M4 is a macro processor intended as a front end for Ratfor, Pascal,
|
|
Xand other languages that do not have a built-in macro processing
|
|
Xcapability. M4 reads standard input, the processed text is written on
|
|
Xthe standard output.
|
|
X The options and their effects are as follows:
|
|
X
|
|
X D name[=val] Defines name to val, or to null in val's absence.
|
|
X U name Undefines name.
|
|
X
|
|
X Macro calls have the form: name(arg1,arg2, ..., argn)
|
|
X
|
|
XThe ``('' must immediately follow the name of the macro. If the name
|
|
Xof a defined macro is not followed by a ( it is taken to be a call of
|
|
Xthat macro with no arguments, i.e. name(). Potential macro names
|
|
Xconsist of alphabetic letters and digits.
|
|
X Leading unquoted blanks, tabs and newlines are ignored while
|
|
Xcollecting arguments. Left and right single quotes are used to quote
|
|
Xstrings. The value of a quoted string is the string stripped of the
|
|
Xquotes.
|
|
X When a macro name is recognized, its arguments are collected by
|
|
Xsearching for a matching ). If fewer arguments are supplied than are
|
|
Xin the macro definition, the trailing arguments are taken to be null.
|
|
XMacro evaluation proceeds normally during the collection of the
|
|
Xarguments, and any commas or right parentheses which happen to turn up
|
|
Xwithin the value of a nested call are as effective as those in the
|
|
Xoriginal input text. (This is typically referred as inside-out macro
|
|
Xexpansion.) After argument collection, the value of the macro is pushed
|
|
Xback onto the input stream and rescanned.
|
|
XB M4 makes available the following built-in macros. They may be
|
|
Xredefined, but once this is done the original meaning is lost. Their
|
|
Xvalues are null unless otherwise stated.
|
|
X
|
|
X define "(name [, val])" the second argument is installed as the
|
|
Xvalue of the macro whose name is the first argument. If there is no
|
|
Xsecond argument, the value is null. Each occurrence of $ n in the
|
|
Xreplacement text, where n is a digit, is replaced by the n -th
|
|
Xargument. Argument 0 is the name of the macro; missing arguments are
|
|
Xreplaced by the null string.
|
|
X
|
|
X defn "(name [, name ...])" returns the quoted definition of its
|
|
Xargument(s). Useful in renaming macros.
|
|
X
|
|
X undefine "(name [, name ...])" removes the definition of the
|
|
Xmacro(s) named. If there is more than one definition for the named
|
|
Xmacro, (due to previous use of pushdef) all definitions are removed.
|
|
X
|
|
X pushdef "(name [, val])" like define, but saves any previous
|
|
Xdefinition by stacking the current definition.
|
|
X
|
|
X popdef "(name [, name ...])" removes current definition of its
|
|
Xargument(s), exposing the previous one if any.
|
|
X
|
|
X ifdef "(name, if-def [, ifnot-def])" if the first argument is
|
|
Xdefined, the value is the second argument, otherwise the third. If
|
|
Xthere is no third argument, the value is null. A word indicating the
|
|
Xcurrent operating system is predefined. (e.g. unix or vms).
|
|
X
|
|
X shift "(arg, arg, arg, ...)" returns all but its first argument.
|
|
XThe other arguments are quoted and pushed back with commas in between.
|
|
XThe quoting nullifies the effect of the extra scan that will
|
|
Xsubsequently be performed.
|
|
X
|
|
X changequote "(lqchar, rqchar)" change quote symbols to the first and
|
|
Xsecond arguments. With no arguments, the quotes are reset back to the
|
|
Xdefault characters. (i.e., `').
|
|
X
|
|
X changecom "(lcchar, rcchar)" change left and right comment markers
|
|
Xfrom the default # and newline. With no arguments, the comment
|
|
Xmechanism is reset back to the default characters. With one argument,
|
|
Xthe left marker becomes the argument and the right marker becomes
|
|
Xnewline. With two arguments, both markers are affected.
|
|
X
|
|
X divert "(divnum)" maintains 10 output streams, numbered 0-9.
|
|
XInitially stream 0 is the current stream. The divert macro changes the
|
|
Xcurrent output stream to its (digit-string) argument. Output diverted
|
|
Xto a stream other than 0 through 9 is lost.
|
|
X
|
|
X undivert "([divnum [, divnum ...]])" causes immediate output of text
|
|
Xfrom diversions named as argument(s), or all diversions if no argument.
|
|
XText may be undiverted into another diversion. Undiverting discards
|
|
Xthe diverted text. At the end of input processing, M4 forces an
|
|
Xautomatic undivert unless is defined.
|
|
X
|
|
X divnum "()" returns the value of the current output stream.
|
|
X
|
|
X dnl "()" reads and discards characters up to and including the next newline.
|
|
X
|
|
X ifelse "(arg, arg, if-same [, ifnot-same | arg, arg ...])" has three
|
|
Xor more arguments. If the first argument is the same string as the
|
|
Xsecond, then the value is the third argument. If not, and if there are
|
|
Xmore than four arguments, the process is repeated with arguments 4, 5,
|
|
X6 and 7. Otherwise, the value is either the fourth string, or, if it
|
|
Xis not present, null.
|
|
X
|
|
X incr "(num)" returns the value of its argument incremented by 1.
|
|
XThe value of the argument is calculated by interpreting an initial
|
|
Xdigit-string as a decimal number.
|
|
X
|
|
X decr "(num)" returns the value of its argument decremented by 1.
|
|
X
|
|
X eval "(expression)" evaluates its argument as a constant expression,
|
|
Xusing integer arithmetic. The evaluation mechanism is very similar to
|
|
Xthat of cpp (#if expression). The expression can involve only integer
|
|
Xconstants and character constants, possibly connected by the binary
|
|
Xoperators
|
|
X * / % + - >> << < > <= >= == != & ^ | && ||
|
|
X
|
|
Xor the unary operators - ! or tilde or by the ternary operator ? : . Parentheses may be
|
|
Xused for grouping. Octal numbers may be specified as in C.
|
|
X
|
|
X len "(string)" returns the number of characters in its argument.
|
|
X
|
|
X index "(search-string, string)" returns the position in its first
|
|
Xargument where the second argument begins (zero origin), or 1 if the
|
|
Xsecond argument does not occur.
|
|
X
|
|
X substr "(string, index [, length])" returns a substring of its first
|
|
Xargument. The second argument is a zero origin number selecting the
|
|
Xfirst character (internally treated as an expression); the third
|
|
Xargument indicates the length of the substring. A missing third
|
|
Xargument is taken to be large enough to extend to the end of the first
|
|
Xstring.
|
|
X
|
|
X translit "(source, from [, to])" transliterates the characters in
|
|
Xits first argument from the set given by the second argument to the set
|
|
Xgiven by the third. If the third argument is shorter than the second,
|
|
Xall extra characters in the second argument are deleted from the first
|
|
Xargument. If the third argument is missing altogether, all
|
|
Xcharacters in the second argument are deleted from the first argument.
|
|
X
|
|
X include "(filename)" returns the contents of the file that is named
|
|
Xin the argument.
|
|
X
|
|
X sinclude "(filename)"is identical to include, except that it says
|
|
Xnothing if the file is inaccessable.
|
|
X
|
|
X paste "(filename)" returns the contents of the file named in the
|
|
Xargument without any processing, unlike include.
|
|
X
|
|
X spaste "(filename)" is identical to paste, except that it says
|
|
Xnothing if the file is inaccessibl[De.
|
|
X
|
|
X syscmd "(command)" executes the UNIX command given in the first
|
|
Xargument. No value is returned.
|
|
X
|
|
X sysval "()" is the return code from the last call to syscmd.
|
|
X
|
|
X maketemp ``(string)" fills in a string of XXXXXX in its argument
|
|
Xwith the current process ID.
|
|
X
|
|
X m4exit "([exitcode])" causes immediate exit from M4. Argument 1, if
|
|
Xgiven, is the exit code; the default is 0.
|
|
X
|
|
X m4wrap "(m4-macro-or-built-n)" argument 1 will be pushed back at
|
|
Xfinal EOF; example: m4wrap(`dumptable()').
|
|
X
|
|
X errprint "(str [, str, str, ...])" prints its argument(s) on stderr.
|
|
XIf there is more than one argument, each argument is separated by a
|
|
Xspace during the output. An arbitrary number of arguments may be
|
|
Xsupplied.
|
|
X
|
|
X dumpdef "([name, name, ...])" prints current names and definitions,
|
|
Xfor the named items, or for all if no arguments are given.
|
|
X
|
|
X
|
|
X10.10.1. Author
|
|
X
|
|
X
|
|
X M4 was written by Ozan S. Yigif.
|
|
X
|
|
X
|
|
/
|
|
echo x - mdb.7
|
|
sed '/^X/s///' > mdb.7 << '/'
|
|
XName: mdb - Minix debugger [68000]
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.11. MDB - MINIX DEBUGGER [68000]
|
|
X
|
|
X Mdb provides a means of debugging MINIX programs on the 68000. No
|
|
XIBM debugger is available at present. Mdb supports symbolic debugging.
|
|
XThe argument to mdb is a MINIX executable file. This file defaults to
|
|
Xa.out.
|
|
X Once started, mdb will display an asterisk (*) as command prompt. A
|
|
Xcommand may be entered in the following form:
|
|
X
|
|
X [<expression>][<command> [<argument>]]"
|
|
X
|
|
X<expression> is a symbolic expression representing a location in memory
|
|
Xor a register, and should be in the form:
|
|
X
|
|
X [<value> [+|- <value>]]
|
|
X
|
|
XA <value> may be a symbol, a register, or a constant. The symbol may
|
|
Xbe any external symbol found in the executable file, or start if the
|
|
Xexecutable file is stripped. _start represents the beginning address
|
|
Xof the program. A register is specified by a ``$'' followed by the
|
|
Xregister's name, while a constant may be either an octal, decimal or
|
|
Xhex unsigned long integer expressed using standard C notation (no ``L''
|
|
Xsuffix should be used). A character constant is represented by a
|
|
Xsingle quote followed by the character.
|
|
X Not all commands use an address, but those that do have a default
|
|
Xvalue of the current program counter with the exception of the continue
|
|
Xcommand: ``c'' and ``C''. Not all commands use an argument list, but
|
|
Xthose that do default to an empty list. If the argument contains a
|
|
Xsemi-colon (``;''), then except for the breakpoint command (``b'') the
|
|
Xstring following the semi-colon is assumed to be a new command.
|
|
X Following is the list of valid commands. When mdb is first started,
|
|
Xno process is active. Most of the following commands require an
|
|
Xactive process which may be created using the run (``r'') command.
|
|
X
|
|
X!
|
|
X If the exclamation point begins the command line, then the MINIX
|
|
Xprogram that follows it is executed. The default command is /bin/sh.
|
|
XNote: full path names are required.
|
|
X Example: * !vi mdb.c
|
|
X If the expression preceding the exclamation point is a valid data
|
|
Xaddress, then the arguments specify how to modify its contents. The
|
|
Xargument is to be in the form:
|
|
X [<constant>] [<size>] [<expression>]
|
|
X and are interpreted as: ``fill the data space starting at the
|
|
Xspecified address with <constant> values given by <expression> and are
|
|
Xof size byte (b), half word (h, i.e. short), or long word (l).'' The
|
|
Xdefault value of constant is 1, of size is ``h'', and of expression is
|
|
X0.
|
|
X Example: * _buf ! 20b ``a''
|
|
X
|
|
XT
|
|
X This command prints the current active function in the program with
|
|
Xits arguments.
|
|
X Example: * T
|
|
X
|
|
Xt
|
|
X This command prints the current function invocation hierarchy with
|
|
Xtheir arguments.
|
|
X Example: * t
|
|
X
|
|
X/
|
|
X This command prints the values starting at the address specified.
|
|
XThe argument is to be in the form:
|
|
X [<constant>][<size>][<format>]
|
|
Xformat may have the values:
|
|
X a - Displays chars until a zero is found
|
|
X c - Displays <constant> values as characters.
|
|
X d - Displays <constant> values as signed decimal numbers.
|
|
X i - Disassembles <constant> instructions (<size> ignored).
|
|
X I - Disassembles <constant> instructions (<size> ignored).
|
|
X o - Displays <constant> vlaues as octal numbers.
|
|
X s - Displays string at the location specified
|
|
X u - Displays <constant> vlaues as unsigned decimal numbers.
|
|
X x - Displays <constant> vlaues as hexadecimal numbers.
|
|
X Example: * $a6-2/hx
|
|
X
|
|
Xx
|
|
X This command prints the registers and the instructions starting at the
|
|
Xspecified address. An optional constant argument limits the number of
|
|
Xinstructions printed to the value given by the final argument.
|
|
X Example: * x
|
|
X
|
|
XX
|
|
X This command prints the instructions starting at the specified
|
|
Xaddress. An optional constant argument limits the number of
|
|
Xinstructions printed to the value given by the final argument.
|
|
X Example: * _start X 10
|
|
X
|
|
XR
|
|
X This command starts a process using the executable given as mdb's
|
|
Xfirst argument. The process will have no arguments and will be stopped
|
|
Xprior to executing any instructions.
|
|
X Example: * R
|
|
X
|
|
Xr
|
|
X This command starts a process using the executable given as mdb's
|
|
Xfirst argument. The process will be given the arguments on the command
|
|
Xline up to the first semi-colon. If no arguments are specified, then
|
|
Xthe arguments supplied with the last ``r'' command are used. The
|
|
Xprocesses' standard input and output may be redirected. The process
|
|
Xwill be stopped prior to executing any instructions.
|
|
X Example: * r 3 <input >output
|
|
X
|
|
XC
|
|
X This command results in the stopped process being restarted with a
|
|
Xpending signal specified by the constant argument. A breakpoint is
|
|
Xplaced at the address specified if one is not already there, and if
|
|
Xplaced it is deleted when the process stops for any reason. No default
|
|
Xaddress is assumed.
|
|
X Example: * C 2
|
|
X
|
|
Xc
|
|
X This command results in the stopped process being restarted with all
|
|
Xpending signals canceled. A breakpoint is placed at the address
|
|
Xspecified if one is not already there, and if placed it is deleted when
|
|
Xthe process stops for any reason. No default address is assumed.
|
|
X Example: * _func+4 c
|
|
X
|
|
XI
|
|
X This command results in the stopped process executing instructions in
|
|
Xsingle step mode. The number of instructions executed is given in the
|
|
Xconstant argument. The signal that stopped the process will be sent
|
|
Xwhen execution begins.
|
|
X Example: * I 10
|
|
Xi
|
|
X This command results in the stopped process executing instructions in
|
|
Xsingle step mode. The number of instructions executed is given in the
|
|
Xconstant argu ment. All pending signals are canceled before execution
|
|
Xbegins.
|
|
X Example: * i 10
|
|
X
|
|
XM
|
|
X This command results in the stopped process resuming execution until
|
|
Xthe long word at the location specified by the address is modified or
|
|
Xuntil the number of instructions specified in the optional constant
|
|
Xargument are executed. The default number is 65,536. Each executed
|
|
Xinstruction is displayed prior to execution.
|
|
X Example: * _var M 100
|
|
X
|
|
Xm
|
|
X This command results in the stopped process resuming execution until
|
|
Xthe long word at the location specified by the address is modified or
|
|
Xuntil the number of instructions specified in the obtional constant
|
|
Xargument are executed. The default number is 65,536.
|
|
X Example: * _var m
|
|
X
|
|
Xk
|
|
X This command results in the current active process being terminated.
|
|
X Example: * k
|
|
X
|
|
XB
|
|
X This command results in all the currently active breakpoints being listed.
|
|
X Example: * B
|
|
X
|
|
Xb
|
|
X This command results in a breakpoint being placed at the location
|
|
Xspecified by the address in program space. The string that follows the
|
|
Xcommand contains the command(s) that are executed when the breakpoint
|
|
Xis hit. It is recommended that breakpoints be placed at an offset of 4
|
|
Xbytes from the function entry point to permit a valid frame to be set
|
|
Xup for back-tracing.
|
|
X Example: * _func+4 b t;_var/lx
|
|
X
|
|
Xd
|
|
X This command results in the breakpoint at the address specified being
|
|
Xdeleted.
|
|
X Example: * _func+4 d
|
|
X
|
|
XD
|
|
X This command results in all breakpoints being deleted.
|
|
X Example: * D
|
|
X
|
|
Xq
|
|
X This command results in the currently active process being terminated
|
|
Xand mdb exiting.
|
|
X Example: * q
|
|
X
|
|
X10.11.1. Author
|
|
X
|
|
X Mdb was written by Bruce D. Szablak
|
|
X
|
|
X
|
|
X
|
|
/
|
|
echo x - mined.7
|
|
sed '/^X/s///' > mined.7 << '/'
|
|
XName: mined - a simple screen editor
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.12. MINED - A SIMPLE SCREEN EDITOR
|
|
X
|
|
X
|
|
X Mined is a simple screen editor. At any instant, a window of 24
|
|
Xlines is visible on the screen. The current position in the file is
|
|
Xshown by the cursor. Ordinary characters typed in are inserted at the
|
|
Xcursor. Control characters and keys on the numeric keypad (at the
|
|
Xright-hand side of the keyboard) are used to move the cursor and
|
|
Xperform other functions.
|
|
X Commands exist to move forward and backward a word, and delete words
|
|
Xeither in front of the cursor or behind it. A word in this context is
|
|
Xa sequence of characters delimited on both ends by white space (space,
|
|
Xtab, line feed, start of file, or end of file). The commands for
|
|
Xdeleting characters and words also work on line feeds, making it
|
|
Xpossible to join two consecutive lines by deleting the line feed
|
|
Xbetween them.
|
|
X The editor maintains one save buffer (not displayed). Commands are
|
|
Xpresent to move text from the file to the buffer, from the buffer to
|
|
Xthe file, and to write the buffer onto a new file. If the edited text
|
|
Xcannot be written out due to a full disk, it may still be possible to
|
|
Xcopy the whole text to the save buffer and then write it to a different
|
|
Xfile on a different disk with CTRL-Q. It may also be possible to
|
|
Xescape from the editor with CTRL-S and remove some files.
|
|
X Some of the commands prompt for arguments (file names, search
|
|
Xpatterns, etc.). All commands that might result in loss of the file
|
|
Xbeing edited prompt to ask for confirmation.
|
|
X A key (command or ordinary character) can be repeated n times by
|
|
Xtyping ESC n key where ESC is the ``escape'' key.
|
|
X Forward and backward searching requires a regular expression as the
|
|
Xsearch pattern. Regular expressions follow the same rules as in the
|
|
XUNIX editor, ed. These rules can be stated as:
|
|
X 1. Any displayable character matches itself.
|
|
X 2. . (period) matches any character except line feed.
|
|
X 3. ^ (circumflex) matches the start of the line.
|
|
X 4. $ (dollar sign) matches the end of the line.
|
|
X 5. \c matches the character c (including period, circumflex, etc).
|
|
X 6. [string] matches any of the characters in the string.
|
|
X 7. [^string] matches any of the characters except those in the string.
|
|
X 8. [xy] matches any characters between x and y (e.g., [az]).
|
|
X 9. Pattern* matches any number of occurrences of pattern.
|
|
X
|
|
XSome examples of regular expressions are:
|
|
X The boy matches the string ``The boy''
|
|
X ^$ matches any empty line.
|
|
X ^.$ matches any line containing exactly 1 character
|
|
X ^A.*\.$ matches any line starting with an A, ending with a period.
|
|
X ^[AZ]*$ matches any line containing only capital letters (or empty).
|
|
X [AZ09] matches any line containing either a capital letter or a digit.
|
|
X .*X matches any line ending in ``X''
|
|
X A.*B matches any line containing an ``A'' and then a ``B''
|
|
X
|
|
X Control characters cannot be entered into a file simply by typing
|
|
Xthem because all of them are editor commands. To enter a control
|
|
Xcharacter, depress the ALT key, and then while holding it down, hit the
|
|
XESC key. Release both ALT and ESC and type the control character.
|
|
XControl characters are displayed in reverse video.
|
|
X The mined commands are as follows.
|
|
X
|
|
XCURSOR MOTION
|
|
X arrows Move the cursor in the indicated direction
|
|
X CTRL-A Move cursor to start of current line
|
|
X CTRL-Z Move cursor to end of current line
|
|
X CTRL-^ Move cursor to top of screen
|
|
X CTRL-_ Move cursor to end of screen
|
|
X CTRL-F Move cursor forward to start of next word
|
|
X CTRL-B Move cursor backward to start of previous word
|
|
X
|
|
XSCREEN MOTION
|
|
X Home key Move to first character of the file
|
|
X End key Move to last character of the file
|
|
X PgUp key Scroll window up 23 lines (closer to start of the file)
|
|
X PgDn key Scroll window down 23 lines (closer to end of the file)
|
|
X CTRL-U Scroll window up 1 line
|
|
X CTRL-D Scroll window down 1 line
|
|
X
|
|
XMODIFYING TEXT
|
|
X Del key Delete the character under the cursor
|
|
X Backspace Delete the character to left of the cursor
|
|
X CTRL-N Delete the next word
|
|
X CTRL-P Delete the previous word
|
|
X CTRL-T Delete tail of line (all characters from cursor to end of line)
|
|
X CTRL-O Open up the line (insert line feed and back up)
|
|
X CTRL-G Get and insert a file at the cursor position
|
|
X
|
|
XBUFFER OPERATIONS
|
|
X CTRL-@ Set mark at current position for use with CTRL-C and CTRL-K
|
|
X CTRL-C Copy the text between the mark and the cursor into the buffer
|
|
X CTRL-K Delete text between mark and cursor; also copy it to the buffer
|
|
X CTRL-Y Yank contents of the buffer out and insert it at the cursor
|
|
X CTRL-Q Write the contents of the buffer onto a file
|
|
X
|
|
XMISCELLANEOUS
|
|
X numeric + Search forward (prompts for regular expression)
|
|
X numeric - Search backward (prompts for regular expression)
|
|
X numeric 5 Display the file status
|
|
X CTRL-] Go to specific line
|
|
X CTRL-R Global replace pattern with string (from cursor to end)
|
|
X CTRL-L Line replace pattern with string
|
|
X CTRL-W Write the edited file back to the disk
|
|
X CTRL-X Exit the editor
|
|
X CTRL-S Fork off a shell (use CTRL-D to get back to the editor)
|
|
X CTRL-\ Abort whatever the editor was doing and wait for command
|
|
X CTRL-E Erase screen and redraw it
|
|
X CTRL-V Visit (edit) a new file
|
|
X
|
|
X The key bindings on the Atari ST are different. The table below
|
|
Xsummarizes the mined commands with the corresponding ST keys, and the
|
|
XPC keys if they differ.
|
|
X
|
|
X ________________________________________________
|
|
X CURSOR MOTION ST key PC key
|
|
X ________________________________________________
|
|
X up,down,left,right arrows
|
|
X start of line CTRL-A
|
|
X end of line CTRL-Z
|
|
X top of screen CTRL-^
|
|
X end of screen CTRL-_
|
|
X next word CTRL-F
|
|
X previous word CTRL-B
|
|
X ________________________________________________
|
|
X ________________________________________________
|
|
X SCREEN MOTION ST key PC key
|
|
X ________________________________________________
|
|
X first char of file Home
|
|
X last char of file F6 End
|
|
X scroll window up F4 PgUp
|
|
X scroll window down F3 PgDn
|
|
X scroll line up CTRL-U
|
|
X scroll line down CTRL-D
|
|
X ________________________________________________
|
|
X ________________________________________________
|
|
X MODIFYING TEXT ST key PC key
|
|
X ________________________________________________
|
|
X delete this char Delete
|
|
X delete previous char Backspace
|
|
X delete next word CTRL-N
|
|
X delete previous word CTRL-P
|
|
X delete tail of line CTRL-T
|
|
X open up line CTRL-O
|
|
X get file at cursor CTRL-G
|
|
X ________________________________________________
|
|
X ________________________________________________
|
|
X MISCELLANEOUS ST key PC key
|
|
X ________________________________________________
|
|
X search forward F1 numeric +
|
|
X search backward F2 numeric -
|
|
X file status F5 numeric 5
|
|
X repeat Esc
|
|
X goto line CTRL-]
|
|
X global replace CTRL-R
|
|
X line replace CTRL-L
|
|
X write file CTRL-W
|
|
X exit CTRL-X
|
|
X fork shell CTRL-S
|
|
X abort CTRL-\
|
|
X redraw CTRL-E
|
|
X new file CTRL-V
|
|
X escape next char F8 ALT-ESC
|
|
X ________________________________________________
|
|
X ________________________________________________
|
|
X BUFFER OPERATIONS ST key PC key
|
|
X ________________________________________________
|
|
X set mark F7 CTRL-@
|
|
X copy to buffer CTRL-C
|
|
X delete to buffer CTRL-K
|
|
X insert buffer CTRL-Y
|
|
X write buffer to file CTRL-Q
|
|
X ________________________________________________
|
|
X
|
|
X10.12.1. Author
|
|
X
|
|
X Mined was designed by Andy Tanenbaum and written by Michiel Huisjes.
|
|
X
|
|
X
|
|
/
|
|
echo x - nroff.7
|
|
sed '/^X/s///' > nroff.7 << '/'
|
|
XName: nroff - text processor and formatter
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.13. NROFF - A TEXT PROCESSOR
|
|
X
|
|
X Nroff is a text processor and formatter based on the design provided
|
|
Xin Software Tools by Kernighan and Plauger. It has been modified to
|
|
Xresemble the UNIX nroff command. The text and commands found in the
|
|
Xfile(s) are processed to generate formatted text. Note that one (and
|
|
Xonly one) of the files can be "-" which reads input from stdin at that
|
|
Xpoint. The output always goes to stdout which can be redirected by the
|
|
Xshell. The o option lets you redirect error output to the specified
|
|
Xfile rather than stderr.
|
|
X The following command line options are available:
|
|
X mname Process macro file tmac.name.
|
|
X ofile Set error log file (default is stderr).
|
|
X pon Shift output right n spaces (like .po).
|
|
X pnn Initial page number (like .pn).
|
|
X v Prints the version information to stdout.
|
|
X +n Causes output to start with page n.
|
|
X n Causes output to stop after page n.
|
|
X Input from stdin.
|
|
X Nroff recognizes the following environment variables from the shell.
|
|
XTMACDIR is alternate directory to find the files tmac.* (``.'' for
|
|
Xexample). The default is /usr/lib/tmac. TMPDIR is an alternate
|
|
Xdirectory to place any temporary files. The default is the current
|
|
Xdirectory.
|
|
X
|
|
X10.13.1. Commands
|
|
X
|
|
X Commands typically are distinguished by a period in column one of
|
|
Xthe input followed by a two character abbreviation for the command
|
|
Xfunction. The abbreviation may then be followed by an optional
|
|
Xnumeric or character argument. The numeric argument may be an absolute
|
|
Xvalue such as setting the right margin to a particular column, or the
|
|
Xargument may be preceded by a plus sign or a minus sign to indicate
|
|
Xthat the parameter should be modified relative to a previous setting.
|
|
XThe following commands are recognized (those marked ``extension'' are
|
|
Xrequests that may be added some day in the distant future).
|
|
X
|
|
X.ad
|
|
X Begin line adjustment. If fill mode is not on, adjustment is
|
|
Xdeferred until it is back on. If a type indicator is present, the
|
|
Xadjustment type is changed as follows:
|
|
X Indicator Type
|
|
X l adjust left margin only
|
|
X r adjust right margin only
|
|
X c center
|
|
X b or n adjust both margins (default)
|
|
X absent unchanged
|
|
X.af
|
|
X Assign format to number register. The available formats are:
|
|
X Format Numbering Sequence
|
|
X 1 0,1,2,3,4,...
|
|
X 001 000,001,002,...
|
|
X i 0,i,ii,iii,iv,v,...
|
|
X I 0,I,II,III,IV,V,...
|
|
X a 0,a,b,...,z,aa,ab,...zz,aaa,...
|
|
X A 0,A,B,...,Z,AA,AB,...ZZ,AAA,...
|
|
XThe second format above indicates that the field width, i.e. number of
|
|
Xdigits, is specified by the number of digits in the format type.
|
|
X
|
|
X.bd
|
|
XIgnored by nroff.
|
|
X
|
|
X.bo (extension)
|
|
XCauses the following lines of text to appear in boldface. The optional
|
|
Xargument specifies the number of lines to be typed in boldface.
|
|
XBoldface and underlining are mutually exclusive features. The
|
|
Xappearance of a boldface command will cause any underlining to cease.
|
|
X
|
|
X.bp (extension)
|
|
XCauses succeeding text to appear at the top of a new page. The
|
|
Xoptional argument specifies the page number for the new page. The
|
|
Xinitial value is one and the default value is one more than the
|
|
Xprevious page number.
|
|
X
|
|
X.br
|
|
XCauses succeeding text to start on a new line at the current left
|
|
Xmargin. There is no numeric argument for this command.
|
|
X
|
|
X.bs (extension)
|
|
XEnables or disables the appearance of backspaces in the output text.
|
|
XUnderlining and boldface options are implemented by inserting
|
|
Xcharacter-backspace-character combinations into the output buffer.
|
|
XThis is fine for devices which properly recognize the backspace
|
|
Xcharacter. Some printers, however, do not recognize backspaces, so the
|
|
Xoption is provided to overprint one line buffer with another. The
|
|
Xfirst line buffer is terminated with just a carriage return rather than
|
|
Xthe carriage return-linefeed combination. A zero argument or no
|
|
Xargument to the backspace command removes backspaces from the output.
|
|
XA non-zero argument leaves them in the output. The default is to
|
|
Xremove backspaces.
|
|
X
|
|
X.cc
|
|
XChanges the nroff command character to that specified by the character
|
|
Xargument. If no argument is provided, the default is a period (.).
|
|
X
|
|
X.ce
|
|
XCauses the next line of text to appear centered on the output. The
|
|
Xoptional argument specifies if more than one line is to be centered.
|
|
X
|
|
X.cs
|
|
XIgnored by nroff.
|
|
X
|
|
X.cu
|
|
XCauses the next line(s) of text to be continuously underlined. Unlike
|
|
Xthe underline command (see .ul) which underlines only alphanumerics,
|
|
Xcontinuous underlining underlines all printable characters. The
|
|
Xoptional argument specifies the number of lines of text to
|
|
Xunderlined. Any normal underlining or boldface commands currently in
|
|
Xeffect will be terminated.
|
|
X
|
|
X.c2
|
|
XChanges the nroff no break character to that specified by the character
|
|
Xargument. If no argument is provided, the default is a single quote.
|
|
X
|
|
X.de
|
|
XCauses all text and commands following to be used to define a macro.
|
|
XThe definition is terminated by a .en command or the default ..
|
|
Xterminator. The first two characters of the argument following the .de
|
|
Xcommand become the name of the new command. It should be noted that
|
|
Xupper and lower case arguments are considered different. Thus, the
|
|
Xcommands .PP and .pp could define two different macros. Care should be
|
|
Xexercised since existing commands may be redefined.
|
|
X
|
|
XA macro may contain up to ten arguments. In the macro definition, the
|
|
Xplacement of arguments is designated by the two character sequences,
|
|
X$1, $2, ... $9. When the macro is invoked, each argument of the macro
|
|
Xcommand line is substituted for its corresponding designator in the
|
|
Xexpansion. The first argument of the macro command is substituted for
|
|
Xthe $1 in the expansion, the second argument for the $2, and so forth.
|
|
XArguments are typically strings which do not contain blanks or tabs.
|
|
XIf an argument is to contain blanks, then it should be surrounded by
|
|
Xeither single or double quotes.
|
|
X
|
|
X.ds
|
|
XDefine a string. To initiate the string with a blank or include blanks
|
|
Xin the string, start it with a single or double quote. The string can
|
|
Xcontain other defined strings or number registers as well as normal
|
|
Xtext. Strings are stored on the macro name space.
|
|
X
|
|
X.ec
|
|
XChanges the nroff escape character to that specified by the character
|
|
Xargument. If no argument is provided, the default is a backslash.
|
|
X
|
|
X.ef (extension)
|
|
XSpecifies the text for the footer on even numbered pages. The format
|
|
Xis the same as for the footer command (see .fo).
|
|
X
|
|
X.eh (extension)
|
|
XSpecifies the text for the header on even numbered pages. The format
|
|
Xis the same as for the footer command (see .fo).
|
|
X
|
|
X.en (extension)
|
|
XDesignates the end of a macro definition.
|
|
X
|
|
X.eo
|
|
XTurn the escape mechanism off.
|
|
X
|
|
X.fi
|
|
XCauses the input text to be rearranged or filled to obtain the maximum
|
|
Xword count possible between the previously set left and right margins.
|
|
XNo argument is expected.
|
|
X
|
|
X.fl
|
|
XCauses the output buffer to be flushed immediately.
|
|
X
|
|
X.fo (extension)
|
|
XSpecifies text to be used for a footer. The footer text contains three
|
|
Xstrings separated by a delimiter character. The first non-blank
|
|
Xcharacter following the command is designated as the delimiter. The
|
|
Xfirst text string is left justified to the current indentation value
|
|
X(specified by .in). The second string is centered between the current
|
|
Xindentation value and the current right margin value (specified by
|
|
X.rm). The third string is right justified to the current right margin
|
|
Xvalue. The absence of footer text will result in the footer being
|
|
Xprinted as one blank line. The presence of the page number character
|
|
X(set by .pc) in the footer text results in the current page number
|
|
Xbeing inserted at that position. Multiple occurrences of the page
|
|
Xnumber character are allowed.
|
|
X
|
|
X.ft
|
|
XChanges the current font. The choices are R (Times Roman), I (Times
|
|
XItalic), B (Times Bold), S (math special), and P used to request the
|
|
Xprevious font. P resets the next previous font to be the one just
|
|
Xchanged, amounting to a swap.
|
|
X
|
|
X.he (extension)
|
|
XSpecifies text to be used for a header. The format is the same as for
|
|
Xthe footer (see .fo).
|
|
X
|
|
X.in
|
|
XIndents the left margin to the column value specified by the argument.
|
|
XThe default left margin is set to zero.
|
|
X
|
|
X.ju (extension)
|
|
XCauses blanks to be inserted between words in a line of output in order
|
|
Xto align or justify the right margin. The default is to justify.
|
|
X
|
|
X.ll
|
|
XSets the current line length. The default is eighty.
|
|
X
|
|
X.ls
|
|
XSets the line spacing to the value specified by the argument. The
|
|
Xdefault is for single spacing.
|
|
X
|
|
X.lt
|
|
XSet length of three-part titles. Line length and title length are
|
|
Xindependent. Indents do not apply to titles but page offsets do.
|
|
X
|
|
X.m1 (extension)
|
|
XSpecifies the number of lines in the header margin. This is the space
|
|
Xfrom the physical top of page to and including the header text. A
|
|
Xvalue of zero causes the header to not be printed. A value of one
|
|
Xcauses the header to appear at the physical top of page. Larger
|
|
Xargument values cause the appropriate number of blank lines to appear
|
|
Xbefore the header is printed.
|
|
X
|
|
X.m2 (extension)
|
|
XSpecifies the number of blank lines to be printed between the header
|
|
Xline and the first line of the processed text.
|
|
X
|
|
X.m3 (extension)
|
|
XSpecifies the number of blank lines to be printed between the last line
|
|
Xof processed text and the footer line.
|
|
X
|
|
X.m4 (extension)
|
|
XSpecifies the number of lines in the footer margin. This command
|
|
Xaffects the footer the same way the .m1 command affects the header.
|
|
X
|
|
X.na
|
|
XNoadjust. Adjustment is turned off; the right margin is ragged. The
|
|
Xadjustment type for .ad is not changed. Output line filling still
|
|
Xoccurs if fill mode is on.
|
|
X
|
|
X.ne
|
|
XSpecifies a number of lines which should not be broken across a page
|
|
Xboundary. If the number of lines remaining on a page is less than the
|
|
Xvalue needed, then a new output page is started.
|
|
X
|
|
X.nf
|
|
XSpecifies that succeeding text should be printed without rearrangement,
|
|
Xor with no fill. No argument is expected.
|
|
X
|
|
X.nj (extension)
|
|
XSpecifies that no attempt should be made to align or justify the right
|
|
Xmargin. No argument is expected.
|
|
X
|
|
X.nr
|
|
XCauses the value of a number register to be set or modified. A total
|
|
Xof twenty-six number registers are available designated \na through \nz
|
|
X(either upper or lower case is allowed). When the sequence \nc is
|
|
Ximbedded in the text, the current value of number register c replaces
|
|
Xthe sequence, thus, such things as paragraph numbering can be
|
|
Xaccomplished with relative ease.
|
|
X
|
|
X.of (extension)
|
|
XSpecifies the text for the footer on odd numbered pages. The format is
|
|
Xthe same as the footer command (see .fo).
|
|
X
|
|
X.oh (extension)
|
|
XSpecifies the text for the header on odd numbered pages. The format is
|
|
Xthe same as the footer command (see .fo).
|
|
X
|
|
X.pc
|
|
XSpecifies the page number character to be used in headers and footers.
|
|
XThe occurrence of this character in the header or footer text results
|
|
Xin the current page number being printed. The default for this
|
|
Xcharacter is the percent sign (%).
|
|
X
|
|
X.pl
|
|
XSpecifies the page length or the number of lines per output page. The
|
|
Xdefault is sixty-six.
|
|
X
|
|
X.pm
|
|
XPrint macros. The names and sizes of the macros are printed to stdout.
|
|
XThis is useful when building a macro package to see how much of the
|
|
Xtotal namespace is consumed by the package.
|
|
X
|
|
X.pn
|
|
XChanges the page number of the current page and all subsequent pages to
|
|
Xits argument. If no argument is given, the command is ignored.
|
|
X
|
|
X.po
|
|
XSpecifies a page offset value. This allows the formatted text to be
|
|
Xshifted to the right by the number of spaces specified. This feature
|
|
Xmay also be invoked by a switch on the command line.
|
|
X
|
|
X.ps
|
|
XIgnored by nroff.
|
|
X
|
|
X.rr
|
|
XRemoves a number register.
|
|
X
|
|
X.so
|
|
XCauses input to be retrieved from the file specified by the command's
|
|
Xcharacter string argument. The contents of the new file are inserted
|
|
Xinto the output stream until an EOF is detected. Processing of the
|
|
Xoriginal file is then resumed. Command nesting is allowed.
|
|
X
|
|
X.sp
|
|
XSpecifies a number of blank lines to be output before printing the next
|
|
Xline of text.
|
|
X
|
|
X.ti
|
|
XTemporarily alters the indentation or left margin value for a single
|
|
Xsucceeding input line.
|
|
X
|
|
X.tl
|
|
XSpecifies text to be used for a page title. The format is the same as
|
|
Xfor the header (see .he).
|
|
X
|
|
X.ul
|
|
XCauses the next line(s) of text to be underlined. Unlike the .cu
|
|
Xcommand, this command causes only alphanumerics to be underlined,
|
|
Xskipping punctuation and white space. Underline and boldface are
|
|
Xmutually exclusive.
|
|
X
|
|
X The following nroff commands, normally available, are currently not
|
|
Ximplemented in this version:
|
|
X
|
|
X.fp, .mk, .rt, .vs, .sv, .os, .ns, .rs, .am, .as, .rm, .rn, .di, .da,
|
|
X.wh, .ch, .dt, .it, .em, .ta, .tc, .lc, .fc, .lg, .uf, .tr, .nh, .hy,
|
|
X.hc, .hw, .nm, .nn, .if, .ie, .el, .ev, .rd, .ex, .nx, .pi, .mc, .tm,
|
|
Xand .ig.
|
|
X
|
|
X10.13.2. Escape Sequences
|
|
X
|
|
X Escape sequences are used to access special characters (such as
|
|
XGreek letters) which may be outside the normal printable ASCII
|
|
Xcharacter set. The are also used to toggle certain actions such as
|
|
Xfont selection. The escape sequences include:
|
|
X \ backslash character
|
|
X \e printable version of escape character
|
|
X \' acute accent (equivalent to \(aa)
|
|
X \` grave accent (equivalent to \(ga)
|
|
X \- minus sign
|
|
X \. period
|
|
X \<sp> a single, unpaddable space
|
|
X \0 digit-width space
|
|
X \& non-printing zero-width character
|
|
X \" beginning of comment
|
|
X \% default hyphenation character
|
|
X \(xx special character named xx
|
|
X \*x insert string named x
|
|
X \*(xx insert string named xx
|
|
X \fc font change (c = R,I,B,S,P)
|
|
X \nx interpolate number register x
|
|
X \t horizontal tab
|
|
X
|
|
X10.13.3. Predefined General Number Registers
|
|
X
|
|
X The following number registers are available for both reading and
|
|
Xwriting. They are accessed with the \n(xx and \nx escape and can be
|
|
Xset with .nr:
|
|
X % current page number
|
|
X dw current day of the week (1-7)
|
|
X dy current day of the month (1-31)
|
|
X hh current hours (0-23)
|
|
X ln current line number
|
|
X mm current minutes (0-59)
|
|
X mo current month (1-12)
|
|
X ss current seconds (0-59)
|
|
X yr last 2 digits of current year
|
|
X
|
|
XThe following number registers are available for reading only:
|
|
X .$ number of args available in current macro
|
|
X .A always 1 in nroff
|
|
X .H available horizontal resolution
|
|
X .T always 0 in nroff
|
|
X .V available vertical resolution
|
|
X .c number of lines read from current file
|
|
X .f current font (1-4)
|
|
X .i current indent
|
|
X .l current line length
|
|
X .o current page offset
|
|
X .p current page length
|
|
X .v current vertical spacing
|
|
X
|
|
X10.13.4. Notes
|
|
X
|
|
X There are several missing features, notably diversions, traps, and
|
|
Xconditionals. This means you cannot use some existing macro
|
|
Xpackages. There are no ms and me packages as a result. The goal is to
|
|
X(eventually) make nroff work with all the SunOS macro packages.
|
|
X
|
|
X10.13.5. Authors
|
|
X
|
|
X This version of nroff was originally written in BDS C by Stephen L.
|
|
XBrowning. It was adapted for standard C by W. N. Paul. Bill
|
|
XRosenkranz modified it heavily and ported it to MINIX.
|
|
X
|
|
X
|
|
/
|
|
echo x - patch.7
|
|
sed '/^X/s///' > patch.7 << '/'
|
|
XName: patch - a program for applying diff listings
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.14. PATCH - A PROGRAM FOR APPLYING DIFF LISTINGS
|
|
X
|
|
X The MINIX user community on USENET frequently makes improvements to
|
|
Xthe MINIX software. The changes are distributed in the form of
|
|
Xdifferences between the original file and the new one, made with cdiff.
|
|
XTo update the original version (which you must have), use patch. If
|
|
Xthe original file is called prog.c and the patch is called prog.cdif
|
|
Xthen you should type:
|
|
X patch prog.c prog.cdif
|
|
XIn some cases, a large number of files in a single directory will be
|
|
Xupdated at once. In this case, the difference file may be the
|
|
Xconcatenation of many individual difference files. The resulting
|
|
Xfile usually has a name like dir.cdif. To apply all the patches, type:
|
|
X patch <dir.cdif
|
|
X Patch will take a patch file containing any of the three forms of
|
|
Xdifference listing produced by the diff program and apply those
|
|
Xdifferences to an original file, producing a patched version. By
|
|
Xdefault, the patched version is put in place of the original, with the
|
|
Xoriginal file backed up to the same name with a tilde appended, or as
|
|
Xspecified by the b flag. You may also specify where you want the
|
|
Xoutput to go with a o flag. If patchfile is omitted, or is a hyphen,
|
|
Xthe patch will be read from standard input.
|
|
X Upon startup, patch will attempt to determine the type of the diff
|
|
Xlisting, unless over-ruled by a c, e, or n flag. Context diffs and
|
|
Xnormal diffs are applied by the patch program itself, while ed diffs
|
|
Xare simply fed to the ed editor via a pipe.
|
|
X Patch will try to skip any leading garbage, apply the diff, and then
|
|
Xskip any trailing garbage. Thus you could feed an article or message
|
|
Xcontaining a diff listing to patch and it should work. If the entire
|
|
Xdiff is indented by a consistent amount, this will be taken into
|
|
Xaccount.
|
|
X With context diffs, and to a lesser extent with normal diffs, patch
|
|
Xcan detect when the line numbers mentioned in the patch are incorrect,
|
|
Xand will attempt to find the correct place to apply each hunk of the
|
|
Xpatch. As a first guess, it takes the line number mentioned for the
|
|
Xhunk, plus or minus any offset used in applying the previous hunk. If
|
|
Xthat is not the correct place, patch will scan both forwards and
|
|
Xbackwards for a set of lines matching the context given in the hunk.
|
|
XFirst patch looks for a place where all lines of the context match. If
|
|
Xno such place is found, and it is a context diff, and the maximum fuzz
|
|
Xfactor is set to 1 or more, then another scan takes place ignoring the
|
|
Xfirst and last line of context. If that fails, and the maximum fuzz
|
|
Xfactor is set to 2 or more, the first two and last two lines of context
|
|
Xare ignored, and another scan is made. (The default maximum fuzz
|
|
Xfactor is 2.) If patch cannot find a place to install that hunk of the
|
|
Xpatch, it will put the hunk out to a reject file, which normally is the
|
|
Xname of the output file plus ``#''. (Note that the rejected hunk will
|
|
Xcome out in context diff form whether the input patch was a context
|
|
Xdiff or a normal diff. If the input was a normal diff, many of the
|
|
Xcontexts will simply be null.) The line numbers on the hunks in the
|
|
Xreject file may be different than in the patch file: they reflect the
|
|
Xapproximate location patch thinks the failed hunks belong in the new
|
|
Xfile rather than the old one.
|
|
X As each hunk is completed, you will be told whether the hunk
|
|
Xsucceeded or failed, and which line (in the new file) patch thought the
|
|
Xhunk should go on. If this is different from the line number specified
|
|
Xin the diff you will be told the offset. A single large offset MAY be
|
|
Xan indication that a hunk was installed in the wrong place. You will
|
|
Xalso be told if a fuzz factor was used to make the match, in which case
|
|
Xyou should also be slightly suspicious.
|
|
X If no original file is specified on the command line, patch will try
|
|
Xto figure out from the leading garbage what the name of the file to
|
|
Xedit is. In the header of a context diff, the filename is found from
|
|
Xlines beginning with ``***'' or ``---'' , with the shortest name of an
|
|
Xexisting file winning. Only context diffs have lines like that, but if
|
|
Xthere is an ``Index:'' line in the leading garbage, patch will try to
|
|
Xuse the filename from that line. The context diff header takes
|
|
Xprecedence over an Index line. If no filename can be intuited from the
|
|
Xleading garbage, you will be asked for the name of the file to patch.
|
|
X (If the original file cannot be found, but a suitable SCCS or RCS
|
|
Xfile is handy, patch will attempt to get or check out the file.)
|
|
X Additionally, if the leading garbage contains a ``Prereq:'' line,
|
|
Xpatch will take the first word from the prerequisites line (normally a
|
|
Xversion number) and check the input file to see if that word can be
|
|
Xfound. If not, patch will ask for confirmation before proceeding.
|
|
X If the patch file contains more than one patch, patch will try to
|
|
Xapply each of them as if they came from separate patch files. This
|
|
Xmeans, among other things, that it is assumed that the name of the file
|
|
Xto patch must be determined for each diff listing, and that the garbage
|
|
Xbefore each diff listing will be examined for interesting things such
|
|
Xas filenames and revision level, as mentioned previously. You can
|
|
Xgive flags (and another original file name) for the second and
|
|
Xsubsequent patches by separating the corresponding argument lists by a
|
|
X``+''. (The argument list for a second or subsequent patch may not
|
|
Xspecify a new patch file, however.)
|
|
X Patch recognizes the following flags:
|
|
X The -b flag causes the next argument to be interpreted as the backup
|
|
Xextension, to be used in place of the tilde.
|
|
X The -B flag causes the next argument to be interpreted as a prefix to
|
|
Xthe backup file name. If this argument is specified any argument from
|
|
Xb will be ignored. This argument is an extension to Larry Wall's patch
|
|
Xv2.0.1.4, patchlevel 8, made by M. Greim (greim@sbsvax.uucp).
|
|
X The -c flag forces patch to interpret the patch file as a context
|
|
Xdiff.
|
|
X The -d flag causes patch to interpret the next argument as a
|
|
Xdirectory, and cd to it before doing anything else.
|
|
X The -D flag causes patch to use the ``#ifdef...#endif'' construct to
|
|
Xmark changes. The argument following will be used as the
|
|
Xdifferentiating symbol. Note that, unlike the C compiler, there must
|
|
Xbe a space between the -D and the argument.
|
|
X The -e flag forces patch to interpret the patch file as an ed script.
|
|
X The -f flag forces patch to assume that the user knows exactly what
|
|
Xhe or she is doing, and to not ask any questions. It does not suppress
|
|
Xcommentary, however. Use s for that.
|
|
X The -F<n> flag sets the maximum fuzz factor. This flag only applies to
|
|
Xcontext diffs, and causes patch to ignore up to that many lines in
|
|
Xlooking for places to install a hunk. Note that a larger fuzz factor
|
|
Xincreases the odds of a faulty patch. The default fuzz factor is 2,
|
|
Xand it may not be set to more than the number of lines of context in
|
|
Xthe context diff, ordinarily 3.
|
|
X The -l flag causes the pattern matching to be done loosely, in case
|
|
Xthe tabs and spaces have been munged in your input file. Any sequence
|
|
Xof whitespace in the pattern line will match any sequence in the input
|
|
Xfile. Normal characters must still match exactly. Each line of the
|
|
Xcontext must still match a line in the input file.
|
|
X The -n flag forces patch to interpret the patch file as a normal
|
|
Xdiff.
|
|
X The -N flag causes patch to ignore patches that it thinks are
|
|
Xreversed or already applied. See also R.
|
|
X The -o flag causes the next argument to be interpreted as the output
|
|
Xfile name.
|
|
X The -p<n> flag sets the pathname strip count, which controls how
|
|
Xpathnames found in the patch file are treated, in case the you keep
|
|
Xyour files in a different directory than the person who sent out the
|
|
Xpatch. The strip count specifies how many slashes are to be stripped
|
|
Xfrom the front of the pathname. (Any intervening directory names
|
|
Xalso go away.) As a simple example, let us suppose that the filename in
|
|
Xthe patch file is /u/howard/src/blurfl/blurfl.c setting p or p0 gives
|
|
Xthe entire pathname unmodified, p1 gives u/howard/src/blurfl/blurfl.c
|
|
Xwithout the leading slash, p4 gives blurfl/blurfl.c and not specifying
|
|
Xp at all just gives you blurfl.c. Whatever you end up with is looked
|
|
Xfor either in the current directory, or the directory specified by the
|
|
Xd flag.
|
|
X The -r flag causes the next argument to be interpreted as the reject
|
|
Xfile name.
|
|
X The -R flag tells patch that this patch was created with the old and
|
|
Xnew files swapped. (That does happen occasionally, human nature being
|
|
Xwhat it is.) Patch will attempt to swap each hunk around before
|
|
Xapplying it. Rejects will come out in the swapped format. The R flag
|
|
Xwill not work with ed diff scripts because there is too little
|
|
Xinformation to reconstruct the reverse operation.
|
|
X If the first hunk of a patch fails, patch will reverse the hunk to
|
|
Xsee if it can be applied that way. If it can, you will be asked if you
|
|
Xwant to have the R flag set. If it cannot, the patch will continue to
|
|
Xbe applied normally. (Note: this method cannot detect a reversed patch
|
|
Xif it is a normal diff and if the first command is an append (i.e. it
|
|
Xshould have been a delete) since appends always succeed, due to the
|
|
Xfact that a null context will match anywhere. Luckily, most patches
|
|
Xadd or change lines rather than delete them, so most reversed normal
|
|
Xdiffs will begin with a delete, which will fail, triggering the heuris-
|
|
Xtic.)
|
|
X The -s flag makes patch do its work silently, unless an error occurs.
|
|
X The -S flag causes patch to ignore this patch from the patch file,
|
|
Xbut continue on looking for the next patch in the file. Thus
|
|
X patch -S + -S + <patchfile
|
|
Xwill ignore the first and second of three patches.
|
|
X The -v flag causes patch to print out its revision header and patch
|
|
Xlevel.
|
|
X The -x<number> flag sets internal debugging flags, and is of interest
|
|
Xonly to patch patchers.
|
|
X
|
|
X
|
|
/
|
|
echo x - zmodem.7
|
|
sed '/^X/s///' > zmodem.7 << '/'
|
|
XName: zmodem, sz, rz - file transfer programs
|
|
X
|
|
X(This is from Chapter 9, the Extended Manual Pages, of the Minix 1.5
|
|
XReference Manual, very lightly edited and reformatted. The information
|
|
Xcontained here may not be completely accurate when applied to the
|
|
Xcorresponding parts of Minix 1.7 or later versions.)
|
|
X
|
|
X10.15. ZMODEM - FILE TRANSFER PROGRAM
|
|
X
|
|
X The XMODEM, YMODEM, and ZMODEM family of file transfer programs are
|
|
Xwidely used on personal computers. MINIX supports ZMODEM, the most
|
|
Xadvanced of the set. The programs sz and rz are used for sending and
|
|
Xreceiving, respectively.
|
|
X
|
|
XThe sz Command
|
|
X
|
|
X Sz uses the ZMODEM error correcting protocol to send one or more
|
|
Xfiles over a dial-in serial port to a variety of programs running under
|
|
XMINIX, UNIX, MS-DOS, CP/M, VMS, and other operating systems. It is the
|
|
Xsuccessor to XMODEM and YMODEM.
|
|
X ZMODEM greatly simplifies file transfers compared to XMODEM. In
|
|
Xaddition to a friendly user interface, ZMODEM provides Personal
|
|
XComputer and other users an efficient, accurate, and robust file
|
|
Xtransfer method.
|
|
X ZMODEM provides complete end-to-end data integrity between
|
|
Xapplication programs. ZMODEM's 32 bit CRC catches errors that sneak
|
|
Xinto even the most advanced networks.
|
|
X Output from another program may be piped to sz for transmission by
|
|
Xdenoting standard input with :
|
|
X ls l | sz
|
|
XThe program output is transmitted with the filename sPID.sz where PID
|
|
Xis the process ID of the sz program. If the environment variable ONAME
|
|
Xis set, that is used instead. In this case, the command:
|
|
X ls l | ONAME=con sz ay
|
|
Xwill send a ``file'' to the PC-DOS console display. The y option
|
|
Xinstructs the receiver to open the file for writing unconditionally.
|
|
XThe a option causes the receiver to convert UNIX newlines to PC-DOS
|
|
Xcarriage returns and linefeeds. On UNIX systems, additional
|
|
Xinformation about the file is transmitted. If the receiving program
|
|
Xuses this information, the transmitted file length controls the exact
|
|
Xnumber of bytes written to the output dataset, and the modify time and
|
|
Xfile mode are set accordingly.
|
|
X If sz is invoked with $SHELL set and if that variable contains the
|
|
Xstring rsh or rksh (restricted shell), sz operates in restricted mode.
|
|
XRestricted mode restricts pathnames to the current directory and PUBDIR
|
|
X(usually /usr/spool/uucppublic) and/or subdirectories thereof.
|
|
X The options and flags available are:
|
|
X
|
|
X+
|
|
X Instruct the receiver to append transmitted data to an existing file.
|
|
X
|
|
Xa
|
|
X Convert NL characters in the transmitted file to CR/LF. This is done
|
|
Xby the sender for XMODEM and YMODEM, by the receiver for ZMODEM.
|
|
X
|
|
Xb
|
|
X Binary override: transfer file without any translation.
|
|
X
|
|
Xc
|
|
X Send COMMAND (follows c) to the receiver for execution, return with
|
|
XCOMMAND's exit status.
|
|
X
|
|
Xd
|
|
X Change all instances of ``.'' to ``/'' in the transmitted pathname.
|
|
XThus, C.omenB0000 (which is unacceptable to MS-DOS or CP/M) is
|
|
Xtransmitted as C/omenB0000. If the resultant filename has more than 8
|
|
Xcharacters in the stem, a ``.'' is inserted to allow a total of eleven.
|
|
X
|
|
Xe
|
|
X Escape all control characters; normally XON, XOFF, DLE, CR-@-CR, and
|
|
XCtrl-X are escaped.
|
|
X
|
|
Xf
|
|
X Send Full pathname. Normally directory prefixes are stripped from
|
|
Xthe transmitted filename.
|
|
X
|
|
Xi
|
|
X Send COMMAND (follows i) to the receiver for execution, return
|
|
XImmediately upon the receiving program's successful reception of the
|
|
Xcommand.
|
|
X
|
|
XL
|
|
X Use ZMODEM sub-packets of length n (follows L). A larger n (32 <= n
|
|
X<= 1024) gives slightly higher throughput, a smaller one speeds error
|
|
Xrecovery. The default is 128 below 300 baud, 256 above 300 baud, or
|
|
X1024 above 2400 baud.
|
|
X
|
|
Xl
|
|
X Wait for the receiver to acknowledge correct data every n (32 <= n <=
|
|
X1024) characters. This may be used to avoid network overrun when XOFF
|
|
Xflow control is lacking.
|
|
X
|
|
Xn
|
|
X Send each file if destination file does not exist. Overwrite
|
|
Xdestination file if source file is newer than the destination file.
|
|
X
|
|
XN
|
|
X Send each file if destination file does not exist. Overwrite
|
|
Xdestination file if source file is newer or longer than the destination
|
|
Xfile.
|
|
X
|
|
Xo
|
|
X Disable automatic selection of 32 bit CRC.
|
|
X
|
|
Xp
|
|
X Protect existing destination files by skipping transfer if the
|
|
Xdestination file exists.
|
|
X
|
|
Xq
|
|
X Quiet suppresses verbosity.
|
|
X
|
|
Xr
|
|
X Resume interrupted file transfer. If the source file is longer than
|
|
Xthe destination file, the transfer commences at the offset in the
|
|
Xsource file that equals the length of the destination file.
|
|
X
|
|
Xt
|
|
X Change timeout. The timeout, in tenths of seconds, follows, the t
|
|
Xflag.
|
|
X
|
|
Xu
|
|
X Unlink the file after successful transmission.
|
|
X
|
|
Xw
|
|
X Limit the transmit window size to n bytes (n follows (enw).
|
|
X
|
|
Xv
|
|
X Verbose causes a list of file names to be appended to /tmp/szlog.
|
|
X
|
|
Xy
|
|
X Instruct a ZMODEM receiving program to overwrite any existing file
|
|
Xwith the same name.
|
|
X
|
|
XY
|
|
X Instruct a ZMODEM receiving program to overwrite any existing file
|
|
Xwith the same name, and to skip any source files that do have a file
|
|
Xwith the same pathname on the destination system.
|
|
X
|
|
XExamples
|
|
X
|
|
X Below are some examples of the use of sz.
|
|
X sz a *.c
|
|
XThis single command transfers all .c files in the current directory
|
|
Xwith conversion (a) to end-of-line conventions appropriate to the
|
|
Xreceiving environment.
|
|
X
|
|
X sz Yan *.c *.h
|
|
X
|
|
XSend only the .c and .h files that exist on both systems, and are newer
|
|
Xon the sending system than the corresponding version on the receiving
|
|
Xsystem, converting MINIX to MS-DOS text format.
|
|
X
|
|
XThe rz Command
|
|
X
|
|
X Rz and sz are programs that uses an error correcting protocol to
|
|
Xtransfer files over a dial-in serial port from a variety of programs
|
|
Xrunning under various operating systems. Rz (Receive ZMODEM)
|
|
Xreceives files with the ZMODEM batch protocol. Pathnames are supplied
|
|
Xby the sending program, and directories are made if necessary (and
|
|
Xpossible).
|
|
X
|
|
XThe meanings of the available options are:
|
|
X
|
|
Xa
|
|
X Convert files to UNIX conventions by stripping carriage returns and
|
|
Xall characters beginning with the first Control Z (CP/M end of file).
|
|
X
|
|
Xb
|
|
X Binary (tell it like it is) file transfer override.
|
|
X
|
|
Xc
|
|
X Request 16 bit CRC. XMODEM file transfers default to 8 bit checksum.
|
|
XYMODEM and ZMODEM normally use 16 bit CRC.
|
|
X
|
|
XD
|
|
X Output file data to /dev/null; for testing.
|
|
X
|
|
Xe
|
|
X Force sender to escape all control characters; normally XON, XOFF,
|
|
XDLE, CR-@-CR, and Ctrl-X are escaped.
|
|
X
|
|
Xp
|
|
X Protect: skip file if destination file exists.
|
|
X
|
|
Xq
|
|
X Quiet suppresses verbosity.
|
|
X
|
|
Xt
|
|
X Change timeout tenths of seconds (timeout follows flag).
|
|
X
|
|
Xv
|
|
X Verbose causes a list of file names to be appended to /tmp/rzlog.
|
|
XMore v's generate more output.
|
|
X
|
|
Xy
|
|
X Yes, clobber any existing files with the same name.
|
|
/
|