home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
useful
/
text
/
show
/
less
/
less.doc
< prev
next >
Wrap
Text File
|
1993-10-08
|
22KB
|
522 lines
_l_e_s_s - _o_p_p_o_s_i_t_e _o_f _m_o_r_e
Version 1.6Z July 18, 1993
Versions since Amiga version 1.3Z are supported by
Raymond L. Zarling,
Department of Computer Science
Calif. State Univ. Stanislaus
Turlock, CA 95380
rayz@csustan.EDU
_l_e_s_s [-_d_s_t_w_c_C_e_E_m_M_q_Q_u_U] [-_h_N] [-b[fp]_N] [-x_N] [-[z]_N]
[-_P[_m_M]_s_t_r_i_n_g] [+_c_m_d] [_f_i_l_e_n_a_m_e]...
_L_e_s_s is a program similar to _m_o_r_e (1), but which allows
backwards movement in the file as well as forward movement.
Also, _l_e_s_s does not have to read the entire input file
before starting, so with large input files it starts up fas-
ter than most text editors.
Commands are based on _m_o_r_e, _v_i and _e_m_a_c_s. Commands may
be preceeded by a decimal number, called N in the descrip-
tions below. The number is used by some commands, as indi-
cated.
_I_n _t_h_e _f_o_l_l_o_w_i_n_g _d_e_s_c_r_i_p_t_i_o_n_s, ^_X _m_e_a_n_s _c_o_n_t_r_o_l-_X.
H or Help key
Help: display a summary of these commands. If you for-
get all the other commands, remember this one.
SPACE
Scroll forward N lines, default one window (see option
-z below). If N is more than the screen size, only the
final screenful is displayed.
f or ^F
Same as SPACE.
^V
Same as SPACE.
b or ^B
Scroll backward N lines, default one window (see option
-z below). If N is more than the screen size, only the
final screenful is displayed.
RETURN
Scroll forward N lines, default 1. The entire N lines
are displayed, even if N is more than the screen size.
e or ^E
Same as RETURN.
^N
Same as RETURN.
j or ^J
Also the same as RETURN.
y or ^Y
Scroll backward N lines, default 1. The entire N lines
are displayed, even if N is more than the screen size.
k or ^K
Same as y.
^P
Same as y.
d or ^D
Scroll forward N lines, default half of the screen. If
N is specified, it becomes the new default for subsequent
d and u commands. The half-screen default is set again
whenever the screen is resized.
u or ^U
Scroll backward N lines, default half of the screen. If
N is specified, it becomes the new default for subsequent
d and u commands. The half-screen default is set again
whenever the screen is resized.
r or ^R or ^L
Repaint the screen.
R Repaint the screen, discarding any buffered input.
Useful if the file is changing while it is being
viewed.
g Go to line N in the file, default 1 (beginning of
file). (Warning: this may be slow if N is large.)
< Same as g.
G Go to line N in the file, default the end of the file.
(Warning: this may be slow if standard input, rather
than a file, is being read.)
> Same as G.
p Go to a position N percent into the file. N should be
between 0 and 100. (This is possible if standard input
is being read, but only if _l_e_s_s has already read to the
end of the file. It is always fast, but not always
useful.)
% Same as p.
m Followed by any lowercase letter, marks the current
position with that letter.
' (Single quote.) Followed by any lowercase letter,
returns to the position which was previously marked
with that letter. Followed by another single quote,
returns to the postion at which the last "large" move-
ment command was executed. All marks are lost when a
new file is examined.
/pattern
Search forward in the file for the N-th line containing
the pattern. N defaults to 1. The pattern is a regu-
lar expression, as recognized by Unix _e_d (see the
section on regular expressions below). The search starts
at the second line displayed (but see the -t option,
which changes this). If the pattern is omitted, search
for another occurance of the most recent pattern.
^S Same as /.
?pattern
Search backward in the file for the N-th line contain-
ing the pattern. The search starts at the line immedi-
ately before the top line displayed. If the pattern is
omitted, search for another occurance of the most recent
pattern.
n Repeat previous search, for N-th line containing the
last pattern, searching in the same direction as the
previous search.
E Examine a new file. If the filename is missing, the
"current" file (see the N and P commands below) from
the list of files in the command line is re-examined.
If the filename is a pound sign (#), the previously
examined file is re-examined (one level of backup only).
N Examine the next file (from the list of files given in
the command line). If a number N is specified (not to
be confused with the command N), the N-th next file is
examined.
P Examine the previous file. If a number N is specified,
the N-th previous file is examined.
= or ^G
Prints some information about the file being viewed,
including its name and the byte offset of the bottom
line being displayed. If possible, it also prints the
length of the file and the percent of the file above
the last displayed line.
- Followed by one of the command line option letters (see
below), this will toggle the setting of that option
and/or print a message describing the new setting. Not
all options can be set from within the program: b, P,
and window sizing are command-line only options.
+cmd Causes the specified cmd to be executed each time a new
file is examined. For example, +G causes _l_e_s_s to ini-
tially display each file starting at the end rather
than the beginning.
V Prints the version number of _l_e_s_s being run.
q Exits _l_e_s_s.
_C_o_m_m_a_n_d _l_i_n_e _o_p_t_i_o_n_s _a_r_e _d_e_s_c_r_i_b_e_d _b_e_l_o_w. _M_o_s_t _o_p_t_i_o_n_s _m_a_y
_b_e _c_h_a_n_g_e_d _w_h_i_l_e _l_e_s_s is running, via the "-" command.
Options are also taken from the environment variable
"LESS". For example, if you like very verbose prompting, to
avoid typing "less -M ..." each time _l_e_s_s is invoked, you
might tell _c_s_h or the AmigaDOS shell:
setenv LESS M
or if you use _S_K_s_h:
LESS=M; export LESS
The environment variable is parsed before the command line,
so command line options override the LESS environment vari-
able. A dollar sign ($) may be used to signal the end of an
option string. This is important only for options like -P
which take a following string.
Some options have values, some are 2-way toggles, and some are
3-way toggles. The 3-way ones are handled by using both an
upper-case and a lower-case option name. Usually, the upper-
case option is the most extreme, the lower-case setting is
moderate, and neither is least extreme. For instance, the
-m and -M options control the length of the prompt line. If
-M is in effect, you get a relatively long prompt, while -m
is much shorter. If neither -m nor -M is set, the prompt is
a single ":" character (unless you redefine one or more of
these using -P). To change a 3-way option, use either -x or
-X, where x is the option name. Typing -x will establish the
moderate case if it wasn't already set (i.e. either -X or
neither was in effect) or set the least extreme ("neither")
choice if it was. Similarly, -X would establish the X option
if it wasn't already in effect; otherwise "neither".
-b Numeric; set from command line or environment only.
The -b_n option tells _l_e_s_s to use a non-standard buffer
size. There are two standard (default) buffer sizes,
one is used when a file is being read and the other
when a pipe (standard input) is being read. The
current defaults are 5 buffers for files and 12 for
pipes. (Buffers are 1024 bytes.) The number _