home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Utilities
/
most
/
most.doc
< prev
next >
Wrap
Text File
|
1999-05-17
|
19KB
|
529 lines
MOST(1) MOST(1)
NNAAMMEE
most - browse or page through a text file
SSYYNNOOPPSSIISS
mmoosstt [--bbssttvvwwzz] [++_l_i_n_e_n_o] [++cc] [++dd] [++//_s_t_r_i_n_g] [_f_i_l_e_-
_n_a_m_e...]
DDEESSCCRRIIPPTTIIOONN
_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 display-
ing an arbitrary number of windows as long as each window
occupies at least two screen lines. Each window may con-
tain the same file or a different file. In addition, each
window has its own mode. For example, one window may dis-
play 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 `::oo' 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 appro-
priate mode. However, this feature may be disabled with
the --kk option. See the description of the --bb, --kk, --vv, and
--tt options for further details.
Text files may contain combinations of underscore and
backspace characters 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 particu-
lar, 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 --vv
option.
By default, lines with more characters than the terminal
width are not wrapped but are instead truncated. When
May 1999 1
MOST(1) MOST(1)
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 --ww option may be used to over-
ride this feature. When a window is wrapped, the charac-
ter `\' will appear at the right edge of the window.
Commands are listed below.
OOPPTTIIOONNSS
--11 VT100 mode. This is meaningful only on VMS sys-
tems. This option should be used if the terminal
is strictly a VT100. This implies that the termi-
nal does not have the ability to delete and insert
multiple lines. VT102s and above have this abil-
ity.
--bb Binary mode. Use this switch when you want to view
files containing 8 bit characters. _m_o_s_t will dis-
play the file 16 bytes per line in hexidecimal
notation. A typical line looks like:
01000000 40001575 9C23A020 4000168D ....@..u.#. @...
When used with the --vv option, the same line looks
like:
^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @...
--kk `Kanji' option. Ordinarily, _m_o_s_t will go into
binary mode if the file consists of non-ascii char-
acters. Sometimes this feature is not desirable
since some terminals have a special interpretation
for eight bit characters. The --kk option turns off
the automatic sensing.
--ss Squeeze. Replace multiple blank lines with a sin-
gle blank line.
--zz option turns off gunzip-on-the-fly.
--vv Display control characters as in `^A' for control
A. Normally _m_o_s_t does not interpret control char-
acters.
--tt Display tabs as `^I'. This option is meaningful
only when used with the --vv option. ++_l_i_n_e_n_o Start
up at _l_i_n_e_n_o.
++cc Make search case sensitive. By default, they are
not.
++dd This switch should only be used if you want the
option to delete a file while viewing it. This
May 1999 2
MOST(1) MOST(1)
makes it easier to clean unwanted files out of a
directory. The file is deleted with the interac-
tive key sequence `::DD' and then confirming with
`yy'.
++//_s_t_r_i_n_g
Start up at the line containing the first occur-
rence of _s_t_r_i_n_g.
CCOOMMMMAANNDD UUSSAAGGEE
The commands take effect immediately; it is not necessary
to type a carriage return.
In the following commands, _i is a numerical argument (1 by
default).
SSPPAACCEE, CCTTRRLL--DD, NNEEXXTT__SSCCRREEEENN
Display another windowful, or jump _i windowfuls if
_i is specified.
RREETTUURRNN, DDOOWWNN__AARRRROOWW, VV, CCTTRRLL--NN
Display another line, or _i more lines, if speci-
fied.
UUPP__AARRRROOWW, ^^, CCTTRRLL--PP
Display previous line, or _i previous lines, if
specified.
TT, EESSCCAAPPEE<
Move to top of buffer.
BB, EESSCCAAPPEE>
Move to bottom of buffer.
RRIIGGHHTT__AARRRROOWW, TTAABB, >>
Scroll window left 60_i columns to view lines that
are beyond the right margin of the window.
LLEEFFTT__AARRRROOWW, CCTTRRLL--BB, <<
Scroll window right 60_i columns to view lines that
are beyond the left margin of the window.
UU, CCTTRRLL--UU, DDEELLEETTEE, PPRREEVV__SSCCRREEEENN
Skip back _i windowfuls and then print a windowful.
RR, CCTTRRLL--RR
Redraw the window.
JJ, GG If _i is not specified, then prompt for a line num-
ber 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
May 1999 3
MOST(1) MOST(1)
otherwise just jump to _i percent of the file.
WW, ww If the current screen width is 80, make it 132 and
vice-versa. For other values, this command is
ignored.
QQ, CCTTRRLL--XX CCTTRRLL--CC, CCTTRRLL--KK EE
Exit from _m_o_s_t. On VMS, ^Z also exits.
hh, CCTTRRLL--HH, HHEELLPP, PPFF22
Help. Give a description of all the _m_o_s_t commands.
The _m_o_s_t environment variable MMOOSSTT__HHEELLPP must be set
for this to be meaningful.
ff, //, CCTTRRLL--FF, FFIINNDD, GGOOLLDD PPFF33
Prompt for a string and search forward from the
current line for _ith distinct line containing the
string. CCTTRRLL--GG aborts.
?? Prompt for a string and search backward for the _ith
distinct line containing the string. CCTTRRLL--GG
aborts.
nn Search for the next _i lines containing an occur-
rence of the last search string in the direction of
the previous search.
mm, SSEELLEECCTT, CCTTRRLL--@@, CCTTRRLL--KK MM, PPEERRIIOODD
Set a mark on the current line for later reference.
IINNSSEERRTT__HHEERREE,, CCTTRRLL--XX CCTTRRLL--XX,, CCOOMMMMAA,, CCTTRRLL--KK RREETTUURRNN,, GGOOLLDD
PPEERRIIOODD
Set a mark on the current line but return to previ-
ous mark. This allows the user to toggle back and
forth between two positions in the file.
ll, LL 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.
CCTTRRLL--XX 22, CCTTRRLL--WW 22, GGOOLLDD XX
Split this window in half.
CCTTRRLL--XX oo, CCTTRRLL--WW oo, oo, GGOOLLDDUP,, GOLDDDOOWWNN
Move to other window.
CCTTRRLL--XX 00, CCTTRRLL--WW 00, GGOOLLDD VV
Delete this window.
CCTTRRLL--XX 11, CCTTRRLL--WW 11, GGOOLLDD OO
Delete all other windows, leaving only one window.
EE, ee Edit this file.
May 1999 4
MOST(1) MOST(1)
$$, EESSCC $$
This is system dependent. On VMS, this causes _m_o_s_t
to spawn a subprocess. When the user exits the
process, _m_o_s_t is resumed. On UNIX systems, _m_o_s_t
simply suspends itself.
::nn Skip to the next filename given in the command
line. Use the arrow keys to scroll forward or
backward through the file list. `QQ' quits _m_o_s_t and
any other key selects the given file.
::cc Toggle case sensitive search.
::DD Delete current file. This command is only meaning-
ful with the ++dd switch.
::oo, ::OO Toggle various options. With this key sequence,
_m_o_s_t displays a prompt asking the user to hit one
of: bbddttvvww. The `bb', `tt', `vv', and `ww' options have
the same meaning as the command line switches. For
example, the `ww' option will toggle wrapping on and
off for the current window.
The `dd' option must be used with a prefix integer
_i. All lines indented beyond _i columns will not be
displayed. For example, consider the fragment:
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 `11::oodd' will cause _m_o_s_t to display
the file ignoring 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 dis-
played.
HHIINNTTSS
CCTTRRLL--GG 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
May 1999 5
MOST(1) MOST(1)
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 beginning of a line, enter ``^^JJTThhee where `` quotes
the CCTTRRLL--JJ.
EENNVVIIRROONNMMEENNTT
_m_o_s_t uses the following environment variables:
MMOOSSTT__SSWWIITTCCHHEESS
This variable sets commonly used switches. For
example, some people prefer to use _m_o_s_t with the --ss
option so that excess blank lines are not dis-
played. On VMS this is normally done done in the
login.com through the line:
$ define MOST_SWITCHES "-s"
MMOOSSTT__EEDDIITTOORR, SSLLAANNGG__EEDDIITTOORR
Either of these environment variables specify an
editor for _m_o_s_t to invoke to edit a file. The value
can contain %s and %d formatting descriptors that
represent the file name and line number, respec-
tively. For example, if JED is your editor, then
set MMOOSSTT__EEDDIITTOORR to 'jed %s -g %d'.
MMOOSSTT__HHEELLPP
This variable may be used to specify an alternate
help file.
MMOOSSTT__IINNIITTFFIILLEE
Set this variable to specify the initialization
file to load during startup. The default action is
to load the system configuration file and then a
personal configuration file called _._m_o_s_t_r_c on Unix,
and _m_o_s_t_._r_c on other systems.
CCOONNFFIIGGUURRAATTIIOONN FFIILLEE SSYYNNTTAAXX
When most starts up, it tries to read a system confiura-
tion file and then a personal configuration file. These
files may be used to specify keybindings and colors.
To bind a key to a particular function use the syntax:
sseettkkeeyy ffuunnccttiioonn--nnaammee kkeeyy--sseeqquueennccee
The _s_e_t_k_e_y command requires two arguments. The _f_u_n_c_t_i_o_n_-
_n_a_m_e argument specifies the function that is to be exe-
cuted as a response to the keys specified by the _k_e_y_-
_s_e_q_u_e_n_c_e argument are pressed. For example,
setkey "up" "^P"
indicates that when _C_t_r_l_-_P is pressed then the function _u_p
is to be executed.
May 1999 6
MOST(1) MOST(1)
Sometimes, it is necessary to first unbind a key-sequence
before rebinding it in order via the _u_n_s_e_t_k_e_y function:
unsetkey "^F"
Colors may be defined through the use of the _c_o_l_o_r keyword
in the the configuration file using the syntax:
ccoolloorr OOBBJJEECCTT--NNAAMMEE FFOORREEGGRROOUUNNDD--CCOOLLOORR BBAACCKKGGRROOUUNNDD--CCOOLLOORR
Here, OBJECT-NAME can be any one of the following items:
status -- the status line
underline -- underlined text
overstrike -- overstriked text
normal -- anything else
See the sample configuration files for more information.
BBUUGGSS
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 char-
acters to underscore or overstrike other characters. _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 --vv and --bb options
of _m_o_s_t.
AAUUTTHHOORR
John E. Davis
davis@space.mit.edu
AACCKKNNOOWWLLEEDDGGEEMMEENNTTSS
I would like to thank the users of _m_o_s_t for valuable com-
ments and criticisms. I would especially like to thank
those individuals who have contributed code to _m_o_s_t_.
Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark
Pizzolato contributed to the early VMS versions of _m_o_s_t_.
In particular, Mark worked on it to get it ready for
DECUS.
Foteos Macrides <MACRIDES@SCI.WFEB.EDU> adapted _m_o_s_t for
use in _c_s_w_i_n_g and _g_o_p_h_e_r_. A few features of the present
version of _m_o_s_t was inspired from his work.
I am grateful to Robert Mills <robert@jna.com.au> for re-
writing the search routines to use regular expressions.
Sven Oliver Moll <smol0075@rz.uni-hildesheim.de> came up
with the idea of automatic detection of zipped files.
May 1999 7
MOST(1) MOST(1)
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 adapt-
ing the documentation to nroff man page source format.
May 1999 8