version 1.31, 2014/04/07 17:33:57 |
version 1.32, 2014/04/25 13:38:21 |
|
|
.\" $OpenBSD$ |
.\" $OpenBSD$ |
.\" |
.\" |
.\" Copyright (C) 1984-2011 Mark Nudelman |
.\" Copyright (C) 1984-2012 Mark Nudelman |
.\" |
.\" |
.\" Redistribution and use in source and binary forms, with or without |
.\" Redistribution and use in source and binary forms, with or without |
.\" modification, are permitted provided that the following conditions |
.\" modification, are permitted provided that the following conditions |
|
|
It is a way to monitor the tail of a file which is growing |
It is a way to monitor the tail of a file which is growing |
while it is being viewed. |
while it is being viewed. |
(The behavior is similar to the "tail -f" command.) |
(The behavior is similar to the "tail -f" command.) |
|
.It Ic ESC-F |
|
Like F, but as soon as a line is found which matches |
|
the last search pattern, the terminal bell is rung |
|
and forward scrolling stops. |
.It Ic g | < | ESC-< |
.It Ic g | < | ESC-< |
Go to line N in the file, default 1 (beginning of file). |
Go to line N in the file, default 1 (beginning of file). |
(Warning: this may be slow if N is large.) |
(Warning: this may be slow if N is large.) |
|
|
variable, it can be reset to its default value on the command line by |
variable, it can be reset to its default value on the command line by |
beginning the command line option with "\-+". |
beginning the command line option with "\-+". |
.Pp |
.Pp |
For options like -P which take a following string, |
Some options like -k require a string to follow the option letter. |
a dollar sign ($) must be used to signal the end of the string. |
The string for that option is considered to end when a dollar sign ($) is found. |
For example, to separate a prompt value from any other options |
For example, to separate a prompt value from any other options |
with dollar sign between them: |
with dollar sign between them: |
.Pp |
.Pp |
.Dl LESS="-Ps--More--$-C -e" |
.Dl LESS="-Ps--More--$-C -e" |
|
.Pp |
|
If the --use-backslash option appears earlier in the options, then |
|
a dollar sign or backslash may be included literally in an option string |
|
by preceding it with a backslash. |
|
If the --use-backslash option is not in effect, then backslashes are |
|
not treated specially, and there is no way to include a dollar sign |
|
in the option string. |
.Bl -tag -width XXXX |
.Bl -tag -width XXXX |
.It Fl \&? | -help |
.It Fl \&? | -help |
This option displays a summary of the commands accepted by |
This option displays a summary of the commands accepted by |
|
|
Thus, various display problems may result, |
Thus, various display problems may result, |
such as long lines being split in the wrong place. |
such as long lines being split in the wrong place. |
.It Fl S | -chop-long-lines |
.It Fl S | -chop-long-lines |
Causes lines longer than the screen width to be chopped rather than folded. |
Causes lines longer than the screen width to be |
|
chopped (truncated) rather than wrapped. |
That is, the portion of a long line that does not fit in |
That is, the portion of a long line that does not fit in |
the screen width is not shown. |
the screen width is not shown. |
The default is to fold long lines; that is, display the remainder |
The default is to wrap long lines; that is, display the remainder |
on the next line. |
on the next line. |
.It Fl s | -squeeze-blank-lines |
.It Fl s | -squeeze-blank-lines |
Causes consecutive blank lines to be squeezed into a single blank line. |
Causes consecutive blank lines to be squeezed into a single blank line. |
|
|
to the terminal. |
to the terminal. |
This is sometimes useful if the keypad strings make the numeric |
This is sometimes useful if the keypad strings make the numeric |
keypad behave in an undesirable manner. |
keypad behave in an undesirable manner. |
|
.It Fl -use-backslash |
|
This option changes the interpretations of options which follow this one. |
|
After the --use-backslash option, any backslash in an option string is |
|
removed and the following character is taken literally. |
|
This allows a dollar sign to be included in option strings. |
.It Xo |
.It Xo |
.Ar -cc | |
.Ar -cc | |
.Fl -quotes Ns = Ns Ar cc |
.Fl -quotes Ns = Ns Ar cc |
|
|
Delete the word under the cursor. |
Delete the word under the cursor. |
.It UPARROW [ ESC-k ] |
.It UPARROW [ ESC-k ] |
Retrieve the previous command line. |
Retrieve the previous command line. |
|
If you first enter some text and then press UPARROW, |
|
it will retrieve the previous command which begins with that text. |
.It DOWNARROW [ ESC-j ] |
.It DOWNARROW [ ESC-j ] |
Retrieve the next command line. |
Retrieve the next command line. |
|
If you first enter some text and then press DOWNARROW, |
|
it will retrieve the next command which begins with that text. |
.It TAB |
.It TAB |
Complete the partial filename to the left of the cursor. |
Complete the partial filename to the left of the cursor. |
If it matches more than one filename, the first match |
If it matches more than one filename, the first match |
|
|
#! /bin/sh |
#! /bin/sh |
case "$1" in |
case "$1" in |
*.Z) uncompress -c $1 2>/dev/null |
*.Z) uncompress -c $1 2>/dev/null |
|
*) exit 1 |
;; |
;; |
esac |
esac |
|
exit $? |
.Ed |
.Ed |
.Pp |
.Pp |
To use this script, put it where it can be executed and set |
To use this script, put it where it can be executed and set |
LESSOPEN="|lesspipe.sh %s". |
LESSOPEN="|lesspipe.sh %s". |
|
.Pp |
|
Note that a preprocessor cannot output an empty file, since that |
|
is interpreted as meaning there is no replacement, and |
|
the original file is used. |
|
To avoid this, if |
|
.Ev LESSOPEN |
|
starts with two vertical bars, |
|
the exit status of the script becomes meaningful. |
|
If the exit status is zero, the output is considered to be |
|
replacement text, even if it empty. |
|
If the exit status is nonzero, any output is ignored and the |
|
original file is used. |
|
For compatibility with previous versions of |
|
.Nm less , |
|
if |
|
.Ev LESSOPEN |
|
starts with only one vertical bar, the exit status |
|
of the preprocessor is ignored. |
|
.Pp |
When an input pipe is used, a LESSCLOSE postprocessor can be used, |
When an input pipe is used, a LESSCLOSE postprocessor can be used, |
but it is usually not necessary since there is no replacement file to clean up. |
but it is usually not necessary since there is no replacement file to clean up. |
In this case, the replacement file name passed to the LESSCLOSE |
In this case, the replacement file name passed to the LESSCLOSE |
|
|
If standard input is being viewed, the input preprocessor is passed |
If standard input is being viewed, the input preprocessor is passed |
a file name consisting of a single dash. |
a file name consisting of a single dash. |
Similarly, if the first two characters of LESSOPEN are vertical bar and dash |
Similarly, if the first two characters of LESSOPEN are vertical bar and dash |
(|-), the input pipe is used on standard input as well as other files. |
(|-) or two vertical bars and a dash (||-), |
|
the input pipe is used on standard input as well as other files. |
Again, in this case the dash is not considered to be part of |
Again, in this case the dash is not considered to be part of |
the input pipe command. |
the input pipe command. |
.Sh NATIONAL CHARACTER SETS |
.Sh NATIONAL CHARACTER SETS |
|
|
(But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, |
(But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, |
the window system's idea of the screen size takes precedence over the |
the window system's idea of the screen size takes precedence over the |
LINES and COLUMNS environment variables.) |
LINES and COLUMNS environment variables.) |
|
.It Ev MORE |
|
Options which are passed to |
|
.Nm |
|
automatically when running in |
|
.Nm more |
|
compatible mode. |
.\" .It Ev PATH |
.\" .It Ev PATH |
.\" User's search path (used to find a lesskey file |
.\" User's search path (used to find a lesskey file |
.\" on MS-DOS and OS/2 systems). |
.\" on MS-DOS and OS/2 systems). |
|
|
.Op Fl aBbCdEFfGghIJjkLMmNOoPQqRrSTUVWwXxyz~# |
.Op Fl aBbCdEFfGghIJjkLMmNOoPQqRrSTUVWwXxyz~# |
are extensions to that specification. |
are extensions to that specification. |
.Sh AUTHORS |
.Sh AUTHORS |
.An Mark Nudelman Aq Mt markn@greenwoodsoftware.com |
.An Mark Nudelman |
.Pp |
.Pp |
Send bug reports or comments to the above address or to |
Send bug reports or comments to |
.Aq Mt bug\-less@gnu.org . |
.Aq Mt bug\-less@gnu.org . |
.Pp |
.Pp |
For more information, see the less homepage at |
For more information, see the less homepage at |