home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
most423.zip
/
most.doc
< prev
next >
Wrap
Text File
|
1994-01-28
|
14KB
|
397 lines
1 June 1992 MOST(1)
NAME
most - browse or page through a text file
SYNOPSIS
most [-bstvw] [+_l_i_n_e_n_o] [+c] [+d] [+/_s_t_r_i_n_g] [_f_i_l_e_n_a_m_e...]
DESCRIPTION
_m_o_s_t is a paging program that displays, one windowful at a time, the
contents of a file on a terminal. It pauses after each windowful and
prints on the window status line the screen the file name, current line
number, and the percentage of the file so far displayed.
Unlike other paging programs, _m_o_s_t is capable of displaying an arbitrary
number of windows as long as each window occupies at least two screen
lines. Each window may contain the same file or a different file. In
addition, each window has its own mode. For example, one window may
display a file with its lines wrapped while another may be truncating
the lines. Windows may be `locked' together in the sense that if one of
the locked windows scrolls, all locked windows will scroll. _m_o_s_t is
also capable of ignoring lines that are indented beyond a user specified
value. This is useful when viewing computer programs to pick out gross
features of the code. See the `:o' command for a description of this
feature.
In addition to displaying ordinary text files, _m_o_s_t can also display
binary files as well as files with arbitrary ascii characters. When a
file is read into a buffer, _m_o_s_t examines the first 32 bytes of the file
to determine if the file is a binary file and then switches to the
appropriate mode. However, this feature may be disabled with the -k
option. See the description of the -b, -k, -v, and -t options for
further details.
Text files may contain combinations of underscore and backspace charac-
ters causing a printer to underline or overstrike. When _m_o_s_t recognizes
this, it inserts the appropriate escape sequences to achieve the desired
effect. In addition, some files cause the printer to overstrike some
characters by embedding carriage return characters in the middle of a
line. When this occurs, _m_o_s_t displays the overstruck character with a
bold attribute. This feature facilitates the reading of UNIX man pages
or a document produced by _r_u_n_o_f_f. In particular, viewing this document
with _m_o_s_t should illustrate this behavior provided that the underline
characters have not been stripped. This may be turned off with the -v
option.
By default, lines with more characters than the terminal width are not
wrapped but are instead truncated. When truncation occurs, this is
indicated by a `$' in the far right column of the terminal screen. The
RIGHT and LEFT arrow keys may be used to view lines which extend past
the margins of the screen. The -w option may be used to override this
feature. When a window is wrapped, the character `\' will appear at the
right edge of the window.
1
MOST(1) 1 June 1992
Commands are listed below.
OPTIONS
-1 VT100 mode. This is meaningful only on VMS systems. This option
should be used if the terminal is strictly a VT100. This implies
that the terminal does not have the ability to delete and insert
multiple lines. VT102s and above have this ability.
-b Binary mode. Use this switch when you want to view files contain-
ing 8 bit characters. _m_o_s_t will display the file 16 bytes per line
in hexidecimal notation. A typical line looks like:
01000000 40001575 9C23A020 4000168D ....@..u.#. @...
When used with the -v option, the same line looks like:
^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @...
-k `Kanji' option. Ordinarily, _m_o_s_t will go into binary mode if the
file consists of non-ascii characters. Sometimes this feature is
not desirable since some terminals have a special interpretation
for eight bit characters. The -k option turns off the automatic
sensing.
-s Squeeze. Replace multiple blank lines with a single blank line.
-v Display control characters as in `^A' for control A. Normally _m_o_s_t
does not interpret control characters.
-t Display tabs as `^I'. This option is meaningful only when used
with the -v option. +_l_i_n_e_n_o Start up at _l_i_n_e_n_o.
+c Make search case sensitive. By default, they are not.
+d This switch should only be used if you want the option to delete a
file while viewing it. This makes it easier to clean unwanted
files out of a directory. The file is deleted with the interactive
key sequence `:D' and then confirming with `y'.
+/_s_t_r_i_n_g
Start up at the line containing the first occurrence of _s_t_r_i_n_g.
COMMAND USAGE
The commands take effect immediately; it is not necessary to type a car-
riage return.
In the following commands, _i is a numerical argument (1 by default).
SPACE, CTRL-D, NEXT_SCREEN
Display another windowful, or jump _i windowfuls if _i is specified.
2
1 June 1992 MOST(1)
RETURN, DOWN_ARROW, V, CTRL-N
Display another line, or _i more lines, if specified.
UP_ARROW, ^, CTRL-P
Display previous line, or _i previous lines, if specified.
T, ESCAPE<
Move to top of buffer.
B, ESCAPE>
Move to bottom of buffer.
RIGHT_ARROW, TAB, >
Scroll window left 60_i columns to view lines that are beyond the
right margin of the window.
LEFT_ARROW, CTRL-B, <
Scroll window right 60_i columns to view lines that are beyond the
left margin of the window.
U, CTRL-U, DELETE, PREV_SCREEN
Skip back _i windowfuls and then print a windowful.
R, CTRL-R
Redraw the window.
J, G If _i is not specified, then prompt for a line number then jump to
that line otherwise just jump to line _i.
% If _i is not specified, then prompt for a percent number then jump
to that percent of the file otherwise just jump to _i percent of the
file.
W, w If the current screen width is 80, make it 132 and vice-versa. For
other values, this command is ignored.
Q, CTRL-X CTRL-C, CTRL-K E
Exit from _m_o_s_t. On VMS, ^Z also exits.
h, CTRL-H, HELP,
Help. Give a description of all the _m_o_s_t commands. The _m_o_s_t
environment variable MOST_HELP must be set for this to be meaning-
ful.
f, /, CTRL-F, FIND, GOLD PF3
Prompt for a string and search forward from the current line for
_ith distinct line containing the string. CTRL-G aborts.
? Prompt for a string and search backward for the _ith distinct line
containing the string. CTRL-G aborts.
n Search for the next _i lines containing an occurrence of the last
search string in the direction of the previous search.
3
MOST(1) 1 June 1992
m, SELECT, CTRL-@, CTRL-K M, PERIOD
Set a mark on the current line for later reference.
INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD
Set a mark on the current line but return to previous mark. This
allows the user to toggle back and forth between two positions in
the file.
l, L Toggle locking for this window. The window is locked if there is a
`*' at the left edge of the status line. Windows locked together,
scroll together.
CTRL-X 2, CTRL-W 2, GOLD X
Split this window in half.
CTRL-X o, CTRL-W o, o,
Move to other window.
CTRL-X 0, CTRL-W 0, GOLD V
Delete this window.
CTRL-X 1, CTRL-W 1, GOLD O
Delete all other windows, leaving only one window.
E, e Edit this file. This does not spawn an editor, rather _m_o_s_t uses
callable EDT and TPU routines to perform the editing task. In
addition, _m_o_s_t can attach to a kept editor. See the above discus-
sion of the environment variable MOST_EDITOR.
$, ESC $
This is system dependent. On VMS, this causes _m_o_s_t to spawn a sub-
process. When the user exits the process, _m_o_s_t is resumed. On
UNIX systems, _m_o_s_t simply suspends itself.
:n Skip to the next filename given in the command line. Use the arrow
keys to scroll forward or backward through the file list. `Q'
quits _m_o_s_t and any other key selects the given file.
:c Toggle case sensitive search.
:D Delete current file. This command is only meaningful with the +d
switch.
:o, :O
Toggle various options. With this key sequence, _m_o_s_t displays a
prompt asking the user to hit one of: bdtvw. The `b', `t', `v',
and `w' options have the same meaning as the command line switches.
For example, the `w' option will toggle wrapping on and off for the
current window.
The `d' option must be used with a prefix integer _i. All lines
indented beyond _i columns will not be displayed. For example, con-
sider the fragment:
4
1 June 1992 MOST(1)
int main(int argc, char **argv)
{
int i;
for (i = 0; i < argc, i++)
{
fprintf(stdout,"%i: %s\n",i,argv[i]);
}
return 0;
}
The key sequence `1:od' will cause _m_o_s_t to display the file ignor-
ing all lines indented beyond the first column. So for the example
above, _m_o_s_t would display:
int main(int argc, char **argv)...
}
where the `...' indicates lines follow are not displayed.
HINTS
CTRL-G aborts the commands requiring the user to type something in at a
prompt. The backquote key has a special meaning here. It is used to
quote certain characters. This is useful when search for the occurrence
of a string with a control character or a string at the beginning of a
line. In the latter case, to find the occurrence of `The' at the begin-
ning of a line, enter `^JThe where ` quotes the CTRL-J.
ENVIRONMENT
_m_o_s_t uses the following environment variables:
MOST_SWITCHES
This variable sets commonly used switches. For example, some peo-
ple prefer to use _m_o_s_t with the -s option so that excess blank
lines are not displayed. On VMS this is normally done done in the
login.com through the line:
$ define MOST_SWITCHES "-s"
MOST_EDITOR (VMS only)
Set this logical to one of three values: EDT, TPU, or EMACS. The
default is EDT. _m_o_s_t does not spawn an editor. Rather, it uses
callable EDT and TPU to perform the editing task. Since VMS does
not support callable EMACS, _m_o_s_t will attempt to attach to a kept
EMACS. For this case, _m_o_s_t looks for the logical name EMACS_PID
and attaches to the process with that pid. It then defines the
logicals EMACS_FILE_NAME and EMACS_FILE_LINE which EMACS can check
upon attaching to it.
MOST_HELP
This variable must be setup to point to the _m_o_s_t helpfile. Without
5
MOST(1) 1 June 1992
this _m_o_s_t will not be able to provide online help. However, this
behavior may be changed at compile time. See the Makefile for more
information.
BUGS
Almost all of the known bugs or limitations of _m_o_s_t are due to a desire
to read and interpret control characters in files. One problem concerns
the use of backspace characters to underscore or overstrike other char-
acters. _m_o_s_t makes an attempt to use terminal escape sequences to simu-
late this behavior. One side effect is the one does not always get what
one expects when scrolling right and left through a file. When in
doubt, use the -v and -b options of _m_o_s_t.
String may not work properly with binary files.
AUTHOR
John E. Davis
davis@amy.tch.harvard.edu
ACKNOWLEDGEMENTS
I would like to thank the users of _m_o_s_t for valuable comments and criti-
cisms. I would especially like to thank those individuals who have con-
tributed code to _m_o_s_t:
Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato
I would also like to thank Shinichi Hama for his valuable criticisms of
_m_o_s_t.
Thanks to David W. Sanderson (dws@cs.wisc.edu) for adapting the documen-
tation to nroff man page source format.
6