_ifdef($PDP11) .COMMENT .COMMENT THIS FILE GENERATES THE .DOC FILE FOR LIST. .COMMENT .COMMENT SEE THE COMMAND FILE "DOC.CMD", WHICH PRODUCES .COMMENT LIST.DOC. THE "MPP" PROGRAM IS THE MACRO PREPROCESSOR .COMMENT WHICH IS INCLUDED WITH THE RATFIV DISTRIBUTION. IT IS USED .COMMENT TO CONDITIONALLY RUN THIS FILE OFF. .COMMENT _enddef _ifdef($VAX) .COMMENT .COMMENT THIS FILE IS A COMBINATION OF THE .HLP AND THE .DOC FILES FOR LIST. .COMMENT .COMMENT SEE THE COMMAND FILES "DOC.COM" AND "HELP.COM", WHICH PRODUCE .COMMENT THESE DOCUMENTS. THE "MACROP" PROGRAM IS THE MACRO PREPROCESSOR .COMMENT WHICH IS INCLUDED WITH THE RATFIV DISTRIBUTION. IT IS USED .COMMENT TO CONDITIONALLY RUN THIS FILE OFF. .COMMENT _enddef _ifdef($VAX) _macro(LIST_EXTENSION,.lis) _macro(COMMAND_EXTENSION,.com) _macro(FORTRAN_EXTENSION,.for) _macro(HOST_PROMPT,$) _elsedef _macro(LIST_EXTENSION,.lst) _macro(COMMAND_EXTENSION,.cmd) _macro(FORTRAN_EXTENSION,.ftn) _macro(HOST_PROMPT,>) _enddef _macro(.skipdoc,_ifdef($DOC).skip $1 _enddef) _macro(.doc,_ifdef($DOC)%& _enddef ) _macro(.help,_ifdef($HELP)%& _enddef ) _macro(.see,_ifdef($DOC)(see $1)_elsedef (see HELP LIST _ifelse($2,,$1,$2))_ _enddef ) _macro(.note, .skip 1 .lm +6 .indent -6 Note:#%& .lm -6) _macro(.header, _ifdef($HELP) .lm 0 _incr($1) _ifelse($3,,$2,$3) .lm 1 .paragraph 5,0 _elsedef `.header` level $1 $2 .paragraph 5,1 _enddef) _macro(.example, .skip 1 .no fill .indent +5 %& .fill .skip 1 ) _ifdef($HELP) .paper size 10000,72 .NHD .HY .left margin 0 .right margin 71 .literal 1 LIST .end literal .left margin 1 _elsedef .PAGE SIZE 60,75 `.header` mixed .LM +5 .RM 75 .HY .center LIST File Listing Utility .center ========================= .skip 2 .center Version 3 .skip 40 .lm +37 .literal William P. Wood, Jr. The Institute For Cancer Research 7701 Burholme Ave. Philadelphia, Pa. 19111 (215) 728 2760 .end literal .lm -37 .page .TITLE LIST File Listing Utility .paragraph 5,1 _enddef LIST is a utility for examining the contents of files. It's simplest use is to display records at the terminal a screen at a time, however it can also search for character strings and write portions of files to other files. Any record in a file may be accessed directly by line number or by a search. .skip 1 _ifdef($DOC) This manual explains how to use LIST. .skip 1 .header(1,Running LIST) _enddef The LIST command line has the following syntax. (Optional parts of the command line are enclosed in square brackets): .skip 1 .indent +5 LIST[/qualifiers]#input__file[,...]#[commands][>[>]output__file] .doc(_include(qualifier.rno)) .header(1,Input File Specification,Input__file) Each "input__file" may be a simple file name, an indirect command file name preceded by _@, or _ifdef($PDP11) in some installations, _enddef a file name containing _ifdef($PDP11) SRD wild card characters and/or switches. _elsedef standard RMS wild card characters. _enddef More than one "input__file" may be entered by separating them by commas. .paragraph 5,1 If "input__file" is a simple file name, LIST lists the file. The default file extension is "LIST_EXTENSION". For example, .example(HOST_PROMPT#list#abc.dat) lists the file abc.dat. .paragraph 5,1 If "input__file" is an indirect file name, LIST lists the named files in the indirect file one at a time. Each file name must appear on a line by itself and may not have wild card characters in it. The default extension for indirect file names is "COMMAND_EXTENSION". For example, .example(HOST_PROMPT#list/noprompt#_@files) lists each file specified in files``COMMAND_EXTENSION . .paragraph 5,1 If "input__file" contains wild card characters _ifdef($PDP11) and/or switches, _enddef LIST lists the files which match the wild _ifdef($VAX) cards. _elsedef cards and/or switches. _enddef _ifdef($PDP11) Normal SRD wild card characters and switches may be used in an SRD-type file name; however, do not use the /SE: switch, as this is the default switch. Also, only the most recent versions will be selected unless ;* is specified. _elsedef The wild card character matching works identically to the way it works in the TYPE command, ie. the initial default file type is "LIST_EXTENSION" and only the most recent version of the file is selected unless ;* is specified. _enddef .paragraph 5,1 When more than one "input__file" is specified or when "input__file" contains wild cards _ifdef($PDP11) and/or switches _enddef or is an indirect file name, LIST prompts with each of the selected file names to see if you want them listed, unless /NOPROMPT was specified .see(Qualifiers,QUALIFIERS). Responses to the prompt are: .lm +5 .skip 1 Y###########List the file. .BR #or#N###Don't list the file. .BR G###########(GO) List this and remaining files with no prompting. .BR _^Z##########Don't list this file and remaining files. .BR .lm -5 .paragraph 5,2 When commands are given on LIST's command line, they are executed once for each file selected by the input file specifications. When output is redirected by the command line, it remains redirected for each file selected .see(Redirecting Output From LIST,OUTPUT__FILE). For example, .example(HOST_PROMPT#list#*#1,$px#>all``LIST_EXTENSION) prints *``LIST_EXTENSION into the file all``LIST_EXTENSION . .header(2,Default Fields in File Names,Defaults) More than one file may be listed during the same LIST session by typing LIST and then a carriage-return. LIST then prompts with the "File?#" prompt for one or more file name(s). After the file(s) have been listed, LIST prompts for a new file name. .paragraph 5,1 Whenever LIST encounters an input file name, the node, device, uic, name, and extension fields are remembered and become the defaults, even if the field has wild card characters in it. The defaults are used to replace missing fields of subsequent file names entered for listing. For example: .skip 1 .lm +5 .literal _ifdef($PDP11) > LIST File? lb:[22,2]list.doc _elsedef $ list File? icr$document:list.doc _enddef .end literal .skip 1 .lm -5 When you are finished listing _ifdef($PDP11) LB:[22,2]LIST.DOC, _elsedef icr$document:list.doc, _enddef then to see _ifdef($PDP11) LB:[22,2]VG3.DOC _elsedef icr$document:vg3.doc _enddef you would only have to type: .example(File?#vg3) and LIST would supply the missing fields of the file name. .paragraph 5,1 If LIST can't find a file after supplying the defaults, it tries the file name as entered. Initially, the defaults are _ifdef($VAX) "sys$disk:" for the device and "LIST_EXTENSION" for the extension. _elsedef "sy:" for the device and "LIST_EXTENSION" for the extension. _enddef .header(1,Searching) LIST can search backwards and forwards in the input file for lines which match a specified search pattern. A search pattern is a string of characters bracketed by slashes (/) or backwards slashes (_\): .skip 1 .LM +17 .indent -12 /string/####causes LIST to search forward from the current line for a line which matches "string". .skip 1 .indent -12 _\string_\####causes LIST to search backwards from the current line - 1 for a line which matches "string". .skip 1 .LM -17 Case is not significant in search patterns, eg. /X/ and /x/ match the same lines, unless the characters are inside double quotes (see below). Once specified, a pattern becomes the default pattern and may be invoked by // or _\_\. For example, .example(/john#doe/) searches forwards for a line with "john#doe" in it in upper or lower case. .skip 1 There are several characters which have a special meaning when they appear inside a search pattern: _macro(.spchr, .skip 1 _ifdef($DOC) .indent -5 _ifdef($VAX) $1### _elsedef $1#### _enddef _elsedef .indent -1 3 $1 .break _enddef) .doc(.lm +8) .spchr(") All characters within enclosing double quotes are treated literally, not as special characters. The case of a character is significant when it appears within double quotes. Two double quote characters in a row within enclosing double quotes are interpreted as one literal double quote. For example, .example(/"John#Doe"/) matches only lines which contain literally John#Doe . .spchr(_~) negation. Causes a match if the pattern does not match the line. _~ must appear at the beginning of a pattern (unless a column range is specified .see(Search Column Ranges,SEARCHING COLUMN__RANGE)), otherwise it has no special meaning. For example, .example(/~abc/) matches lines which don't contain abc. .spchr(%) specifies that the match must occur at the beginning of the line only. % itself must appear at the beginning of the pattern, otherwise it has no special meaning, unless a column range .see(Search Column Ranges,SEARCHING COLUMN__RANGE) or negation (_~) is desired; in this case the column range and/or the negation character must appear before %. For example, .example(/%10/) matches only lines with a 10 in the first two columns, and .example(/~%10/) matches lines without a 10 in the first two columns. .spchr($) specifies that the match must occur at the end of the line only. $ itself must appear at the end of the pattern, otherwise it has no special meaning. For example, .example(/%$/) matches only empty lines. .spchr(*) is a wild card character that matches any sequence of characters, including the empty sequence. For example, .example(/john*doe/) matches lines containing johndoe or john doe or johnabcdoe etc. .spchr(?) is a wild card character that matches any single character. For example, .example(/a?c/) matches lines containing abc or acc or a#c etc. .spchr(@) matches any one alphabetic (a-z or A-Z) character. For example, .example(/a@c/) matches lines containing abc or acc but not a#c. .spchr(_#) matches any one numeric (0-9) character. For example, .example(/%_#/) matches lines with a number in column 1. .spchr(_````) accent matches a break character. Break characters are: beginning of line, end of line, and any non-alphanumeric character. For example, the ? command can be used with the following search pattern to display lines which contain the variable I: .example(/_````i_````/?) .spchr(_^) causes the next character to be interpreted as a control character. For example, .example(/_^z$/) matches lines containing control Z at the end of the line. .spchr(_|) logical OR. Causes a match if the sub-pattern before it or the sub-pattern after it match the line. For example, .example(/abc|xyz|%_#/) matches lines containing abc or xyz or a number in the first column. The negation character (~) may be used at the beginning of a sub-pattern; for example, .example(/~x|~y/) matches lines which don't contain an x or don't contain a y. .spchr(_&) logical AND. Causes a match if the sub-pattern before it and the sub-pattern after it match the line. For example, .example(/x|y_&abc/) matches lines containing abc and an x or a y. The negation character (~) may be used at the beginning of a sub-pattern; for example, .example(/~x_&~y/) matches lines which don't contain an x and don't contain a y. .doc(.lm -8) .header(2,Search Column Ranges,Column__range) Search patterns can restrict the range of columns in the input record in which the search is to take place. A column range is specified by placing the special character "<" at the beginning of a pattern or subpattern, followed by two column numbers separated by a comma, followed by a ">" character. The rest of the search pattern follows the column range specification. For example, .example(/<11,15>123/) searches for 123 in columns 11 through 15. .skip 1 Subpatterns can also specify a column range, for example: .example(/<30,31>10_&<40,41>20/) searches for a record with 10 in columns 30 and 31 and 20 in columns 40 and 41. .skip 1 The special characters ~ (negation) and % (match at beginning) should appear after a column range specification. For example, .example(/<10,20>~abc/) searches for lines which don't contain abc in columns 10 through 20. When % or $ is used with a column range, the match must occur at the beginning or end, respectively, of the column range. For example, .example(/<10,50>%abc*xyz$/) matches lines with abc starting at column 10 and xyz ending at column 50 (or the end of the record, whichever is shorter). .skip 1 The characters "<" and ">" and the other characters in a column range specification are only special at the beginning of a pattern, and may be used freely elsewhere in a pattern, for example: .example(/~<10,20>/) matches lines which don't contain <10,20>. .header(1,Numbers) Numbers are used to position LIST in the file and as arguments to commands. Numbers always precede the command they affect. A number may be a simple integer, one of several special line number variables .see(Line Number Variables,NUMBERS VARIABLES), or a search pattern. The numeric value of a search pattern is the number of the line that matches the pattern. .paragraph 5,1 LIST scans the command line from left to right. Whenever it encounters a number, the current line number, dot, is set to that number. When multiple line numbers appear next to each other, LIST positions to each in turn, for example: .example(1/abc/) searches for abc at or after line 1. .paragraph 5,1 Some commands optionally take two numbers as arguments; when specifying more than one number, separate the two numbers by a comma. For example, the P command may be used to print lines 1-45: .example(1,45p) Numbers may be added and subtracted from one another, for example: .example(/x/-1,+2p) prints three lines around the next line which contains an x. .header(2,Line Number Variables,Variables) .help(.break) .help(Following is a description of each line number variable:) .doc(.lm +10) .help(.lm +6) .skip 1 .indent -5 _.####Dot is the current line number. Whenever LIST encounters a line number, the value of dot is reset to that line number. For example, .example(/x/,.p) prints the next line containing an x. .skip 1 .indent -5 _$####Dollar is the last line of the file. For example, .example(1,$p) prints the whole input file. .skip 1 .indent -5 _#####Sharp is the line number displayed by the most recent prompt. For example, if LIST was positioned at line 10 as indicated by the prompt "10>" then .example(10>1,_#/x/p) would print from line 1 to the next line containing an x at or after line 10. .skip 1 .indent -5 _@####At-sign is the line number of the top of the last screen displayed by LIST. For example, .example(@+1//p) searches for the next line matching the current pattern after the top of the last displayed screen, and prints a screen from there. .skip 1 .indent -5 _*####Star is set by the "=" command and is equal to the value of dot when the "=" command was last issued. * marks a line of interest for future reference. For example, .example(=_\subroutine_\,*/end/p) marks the current line, then searches backwards for subroutine, then returns to the marked line, searches forwards for end, and finally prints the lines between the two matched lines. .doc(.lm -10) .help(.lm -6) _ifdef(DELETED) .header(2,Examples of Line Numbers,Examples) .skip 1 .lm +17 .indent -12 _.-10########10 lines before the current line. .skipdoc(1) .indent -12 1,$#########Line 1 through the last line of the file. .skipdoc(1) .indent -12 /xyz/#######Next line which has the string xyz in it. .skipdoc(1) .indent -12 /%SUBR/#####Next line which has SUBR at the beginning of the line. .skipdoc(1) .indent -12 _\_\##########Next line which matches the default pattern while scanning backwards. .skipdoc(1) .indent -12 /_````I_````_&_````J_````/###Next line on which the characters I and J both appear each surrounded by break characters. .skipdoc(1) .indent -12 /"""/He"""/#Next line which contains##"/He" .skipdoc(1) .indent -12 1/SUBR/-1###The line before the first occurrence of SUBR after line 1. .LM -17 _enddef .header(1,Commands) LIST accepts commands on it's initial command line or when it prompts with the current line number, for example: .example(24>) Commands are single characters and are preceded by zero, one, or two numbers which are arguments to the command. More than one command may be entered on a command line; LIST scans the command line from left to right, positioning to line numbers and executing commands. .paragraph 5,1 There are two types of commands; those that print and those that affect LIST's state without printing. Commands that print usually print from dot (the current line number) unless two line numbers were specified, in which case printing occurs from the first line number to the second. Other commands "eat up" the number(s) that are their arguments; in other words, dot retains the value it had before the command, with its numeric argument(s), was executed. .paragraph 5,1 If a line number appears at the end of the command line with no command after it, the default command (P) is executed. For example, .example(/abc/) at the end of a line of commands is equivalent to .example(/abc/p) since both cause a screen to be displayed from the next line containing abc. .skip 1 .note(LIST usually changes most control characters to nulls before writing out a line, however when two line numbers are specified or when the G command is executed, (for example the commands "1,$P" or "100G") all characters are written out unchanged. Thus it is possible to write out portions of a file without losing any characters.) _ifdef($DOC) .header(2,Commands That Print) .lm +5 _enddef _macro(.command, _ifdef($DOC) .skip 2 .indent -4 _ifelse(%1,' ', _ifdef($VAX) ' ' _elsedef ' '# _enddef, _ifdef($VAX) %1## _elsedef %1### _enddef) _elsedef .indent -1 3 %1 .break _enddef ) _macro(.cex, .skip 1 Example: .example(%&)) .command(P) Displays lines from the file. Dot is left at the last line printed plus 1. P is the default command, and is optional at the end of the command line. .skip 1 .lm +12 .indent -8 P#######Print as many lines as will fit within the current screen size (initially 23), starting at the current line (dot). .skip 1 .indent -8 nP######Print as many lines as will fit within the current screen size starting at line n. .indent -8 .skip 1 n1,n2P##Print lines n1-n2. .lm -12 .cex(1,10p) prints lines 1 through 10. .command(G) Like "P", "G" displays lines from the file, however with zero or one arguments G only prints one line, and dot is left at the first line printed. .skip 1 .lm +12 .indent -8 G#######Print the current line. The current line is not changed. .skip 1 .indent -8 nG######Position to and print line n. Dot is left at line n. .skip 1 .indent -8 n1,n2G##Print lines n1-n2. Dot is left at n1. .lm -12 .cex(/subroutine/g) prints the next line with the string "subroutine" in it. .command(?) Displays lines matching the current search pattern, and their line numbers (unless /NONUMBERS is specified on LIST's command line). .skip 1 .lm +12 .indent -8 ?#######Display a screen-full of lines matching the current pattern. If the end of the file is reached, dot is left at line 1, else dot is left at the next line matching the current pattern. .skip 1 .indent -8 n?######Display a screen-full of lines matching the current pattern, starting at line n. If the end of the file is reached, dot is left at line 1, else dot is left at the next line matching the current pattern. .skip 1 .indent -8 n1,n2?##Display all lines matching the current pattern between lines n1 and n2. Dot is left at n1. .lm -12 .cex(1/xyz/,$?) displays all occurrences of xyz in the input file. _ifdef($DOC) .lm -5 .header(2,Other Commands) .lm +5 _enddef .command(L) The L command causes the last line of commands to be reexecuted. .command(=) The = command sets the line number variable, *, to dot. = marks a line for later reference. .skip 1 .lm +12 .indent -8 =#######Set * to dot. .skip 1 .indent -8 n=######Set * to n. Dot is left at line n. .lm -12 .cex(/x/=) marks the next line containing an x. .command(S) Sets the screen size. The value of dot is unchanged. .lm +12 .skip 1 .indent -8 S#######Reset the screen size to 23. The screen size and width help determine how many lines LIST prints per screen. .skip 1 .indent -8 nS######Set the screen size to n. .skip 1 .indent -8 n1,n2S##Set the screen size to (n2-n1)+1. .lm -12 .cex(7s) sets the screen size to 7. .command(C) Sets the column range which will be read from each input record. Initially the column range is 1-513. LIST can only read up to the first 512 characters in a record, however when the column range is set to be greater than 512, then LIST reports an error when an input record is more than 512 characters long. If the column range is restricted to 512 or less then LIST does not report record too long errors. The value of dot is unchanged. .lm +12 .skip 1 .indent -8 C#######Reset the column range to 1-513. .skip 1 .indent -8 nC######Set the column range to 1-n. .skip 1 .indent -8 n1,n2C##Set the column range to n1-n2. .lm -12 .cex(1,10c) causes LIST to read and display only columns 1-10 of each record. .command(F) Creates a "virtual file" by restricting LIST to a contiguous subrange of the lines in the file. Dot is left at line 1. .skip 1 .lm +12 .indent -8 F#######Reset the virtual file to correspond to the actual file. .skip 1 .indent -8 nF######Make a virtual file between dot and dot+n-1. Dot becomes the new line 1 of the virtual file. .skip 1 .indent -8 n1,n2F##Make a virtual file between n1 and n2. N1 becomes the new line 1 of the virtual file. .lm -12 .cex(/subroutine/,/end/f) creates a "virtual file" which contains a subroutine. Line 1 of the virtual file is the first line of the subroutine, and $ is the last line of the subroutine. .command(N) Turn prompt mode on/off. When prompt mode is off, LIST does not prompt with the current line number, but leaves the cursor after the last line printed. The value of dot is unchanged. .cex(1sn) sets the screen size to 1 and prompt mode off, placing LIST in line-by-line mode, in which one record is printed per carriage-return. .command(R) Resets dot to 1, the screen size to 23, the screen width to it's original value, the column range to 1-513, the virtual file to the full, actual file, and prompt mode to on. The value of dot is unchanged. .command(X) Finish listing the file. X is identical to _^Z (EOF). .command(' ') Space (blank) is the null command, and does nothing. It may be used to position to a line without printing and to separate commands on a line for readability. If a line number is given before the space command, dot is left at that line number, else dot is unchanged. .cex(1,10f#p) creates a "virtual file" between lines 1 and 10 and prints starting at line 1. .command(W) Sets the screen width. The screen size and width help determine how many lines LIST prints per screen. The value of dot is unchanged. .skip 1 .lm +12 .indent -8 W#######Reset the screen width to it's original value, read from the host operating system when LIST was started. .skip 1 .indent -8 nW######Set the screen width to n. .lm -12 .cex(132w) sets the screen width to 132 columns. .command(V) Routes all the following output from the command line to the printer port of the DT80 (a VT100 look-alike). The value of dot is unchanged. .cex(v#1,100p) turns on the printer port, prints lines 1-100 on the printer, then turns the printer port off. .doc(.lm -5) .header(2,Looping) A sequence of commands may be repeated in a loop by placing the commands within parentheses with a repetition count in front of the left parenthesis. The commands are then executed as many times as indicated by the repetition count or until a search within the commands fails. In either case, after exiting the loop execution continues with the next statement after the loop. If no repetition count is specified, the loop is executed forever or until a search failure occurs within the loop. For example, .example((/````i````/+1_\subroutine|function|program_\,.p /end$/)) loops finding all Fortran modules which contain the variable I and prints the line containing each module's name. .skip Loops may be nested up to four levels. .header(2,The Macro,Macro) LIST has a simple text replacement macro facility. A macro is a remembered set of commands. The macro is defined by enclosing the commands in square brackets ([]). When M is specified on the command line, the M is replaced by the macro text. .skip 1 For example, .example([_@+1//P]) defines a macro to search for the current pattern starting from the top of the last screen + 1, and print from there. To invoke the macro, type M on the command line. .paragraph 5,1 The text of the macro is not executed when it is defined. It is not executed until an M is typed. M may appear with other commands and line numbers on the command line; first the macro text replaces the M, then the command line is executed. M may be used more than once on a command line. .paragraph 5,1 Initially, the macro is defined as 1SNP; this puts LIST in line-by-line mode and prints one line .see(the N command,COMMANDS N). .header(1,Redirecting Output from LIST,Output__file) The output from a line of LIST commands, which normally goes to the terminal, may be redirected to a file. To write a new file, put >output__file at the end of the commands; to append to an existing file, put >>output__file at the end of the commands. If "output__file" doesn't exist during an append, it will be created. .paragraph 5,1 The default file name for "output__file" is "list", and the default extension is "LIST_EXTENSION". If "output__file" contains asterisks in it, then each field of "output__file" with an asterisk in it is replaced by the corresponding field in the input file name. .paragraph 5,1 When output is redirected by the initial command line which selected the file(s) to be listed, it remains redirected as long as the file(s) are being listed. For example, .example(HOST_PROMPT#list/noprompt/header#*.dat#/xyz/,$?x#>xyz) lists all occurrences of the string xyz in *.dat to the file xyz``LIST_EXTENSION . .skip 1 However if the output file specification contains asterisks, a new output file is created for each input file listed, with the fields with asterisks in them replaced by the corresponding fields from the input file name. For example, _ifdef($VAX) .example($#list/noprompt/trim#[murphy.proj...]*.for#1,72c#1,$px#>[*]*.for) _elsedef .example(>#list/noprompt/trim#[100,*]*.ftn#1,72c#1,$px#>[*]*.ftn) _enddef trims the sequence numbers and trailing blanks from _ifdef($VAX) [murphy.proj...]*.for _elsedef [100,*]*.ftn _enddef and rewrites each file with a higher version number in its original UIC. .skip 1 When output is redirected from a command line while listing a file, redirection is only in effect while that command line is being processed. For example, .example(24>1,10p>t.tmp) writes lines 1-10 to the file t.tmp and then closes it. .paragraph 5,1 The carriagecontrol type of newly created files is identical to the carriagecontrol type of the file being _ifdef($VAX) listed (except for print file format files, which are written with carriage return (list) carriagecontrol), _elsedef listed, _enddef while that of appended files is the same as that of the file being appended to. .paragraph 5,1 Once an output file name has been specified using >output__file or >>output__file, that file name becomes the default file name for file redirection only, and need not be specified again, i.e. > or >> alone is all that is needed to redirect output to that file. The name of the file is remembered as it was typed in, so that asterisk fields are replaced with the fields from the current input file. _ifdef($VAX) .header(1,Bugs) .indent 0 .list .le;Logical names must have a colon after them to be translated properly in input and output file specifications. For example: .skip 1 .lm +5 .literal $ assign file.dat data $ list data: .end literal .lm -5 .skip 1 .le;When output is appended to a file with print file format carriagecontrol, the proper carriage control information is not written to the file. .end list _enddef .lm 0 .rm 79 .doc(.page) .header(1,Examples) .literal Hitting return prints the next screen. 45 Start printing at line 45. -5 Print from 5 lines back. - Print starting half a screen back. --- Print starting one and one-half screens back. Hitting escape prints from 2 screens back. $ Print the last line in the file. /xyz/ Locate the string xyz and print from there. // Locate the current pattern and print from there. 1/xyz/ Locate xyz at or after line 1 and print from there. /abc/-5 Print starting 5 lines before abc. 1,10 Print lines 1-10. /subr/,/end$/ Print the next subroutine. /subr/? Display lines containing subr. ? Display lines containing the current pattern. 1/````i````/,$? Print all occurences of the variable "i". 10,$>t.tmp Write lines 10 through the end of the file to t.tmp .end literal .lm +6 .indent -5 HOST_PROMPT#list#*``FORTRAN_EXTENSION#/````n````/,$?x .break prints all occurrences of the variable N in *``FORTRAN_EXTENSION _ifdef($HELP) .lm 1 .rm 71 _include(qualifier.rno) _enddef