summaryrefslogtreecommitdiffstats
path: root/contrib/less/less.man
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-07-29 09:20:32 +0000
committerdelphij <delphij@FreeBSD.org>2009-07-29 09:20:32 +0000
commita1420f2d09d95e286325db1a123862cb8a6fb33d (patch)
tree4fdfa6d784030f8906ba6b58fa39cec909b27661 /contrib/less/less.man
parent7b17971146d9d04f6fdfc56456eda87bddfb201f (diff)
parenta169eab989211273bac7f266a725febc6d6767ef (diff)
downloadFreeBSD-src-a1420f2d09d95e286325db1a123862cb8a6fb33d.zip
FreeBSD-src-a1420f2d09d95e286325db1a123862cb8a6fb33d.tar.gz
Update less to v436. This is considered as a bugfix release from vendor.
Major changes from v429: * Don't pass "-" to non-pipe LESSOPEN unless it starts with "-". * Allow a fraction as the argument to the -# (--shift) option. * Fix highlight bug when underlined/overstruck text matches at end of line. * Fix non-regex searches with ctrl-R. Approved by: re (kensmith, kib)
Diffstat (limited to 'contrib/less/less.man')
-rw-r--r--contrib/less/less.man517
1 files changed, 265 insertions, 252 deletions
diff --git a/contrib/less/less.man b/contrib/less/less.man
index 1135830..00b9684 100644
--- a/contrib/less/less.man
+++ b/contrib/less/less.man
@@ -809,51 +809,58 @@ LESS(1) LESS(1)
Specifies the default number of positions to scroll horizontally
in the RIGHTARROW and LEFTARROW commands. If the number speci-
fied is zero, it sets the default number of positions to one
- half of the screen width.
+ half of the screen width. Alternately, the number may be speci-
+ fied as a fraction of the width of the screen, starting with a
+ decimal point: .5 is half of the screen width, .3 is three
+ tenths of the screen width, and so on. If the number is speci-
+ fied as a fraction, the actual number of scroll positions is
+ recalculated if the terminal window is resized, so that the
+ actual scroll remains at the specified fraction of the screen
+ width.
--no-keypad
- Disables sending the keypad initialization and deinitialization
+ Disables sending the keypad initialization and deinitialization
strings to the terminal. This is sometimes useful if the keypad
strings make the numeric keypad behave in an undesirable manner.
--follow-name
- Normally, if the input file is renamed while an F command is
- executing, less will continue to display the contents of the
- original file despite its name change. If --follow-name is
+ Normally, if the input file is renamed while an F command is
+ executing, less will continue to display the contents of the
+ original file despite its name change. If --follow-name is
specified, during an F command less will periodically attempt to
reopen the file by name. If the reopen succeeds and the file is
- a different file from the original (which means that a new file
- has been created with the same name as the original (now
+ a different file from the original (which means that a new file
+ has been created with the same name as the original (now
renamed) file), less will display the contents of that new file.
- -- A command line argument of "--" marks the end of option argu-
- ments. Any arguments following this are interpreted as file-
+ -- A command line argument of "--" marks the end of option argu-
+ ments. Any arguments following this are interpreted as file-
names. This can be useful when viewing a file whose name begins
with a "-" or "+".
- + If a command line option begins with +, the remainder of that
- option is taken to be an initial command to less. For example,
- +G tells less to start at the end of the file rather than the
- beginning, and +/xyz tells it to start at the first occurrence
- of "xyz" in the file. As a special case, +<number> acts like
+ + If a command line option begins with +, the remainder of that
+ option is taken to be an initial command to less. For example,
+ +G tells less to start at the end of the file rather than the
+ beginning, and +/xyz tells it to start at the first occurrence
+ of "xyz" in the file. As a special case, +<number> acts like
+<number>g; that is, it starts the display at the specified line
- number (however, see the caveat under the "g" command above).
- If the option starts with ++, the initial command applies to
- every file being viewed, not just the first one. The + command
+ number (however, see the caveat under the "g" command above).
+ If the option starts with ++, the initial command applies to
+ every file being viewed, not just the first one. The + command
described previously may also be used to set (or change) an ini-
tial command for every file.
LINE EDITING
- When entering command line at the bottom of the screen (for example, a
+ When entering command line at the bottom of the screen (for example, a
filename for the :e command, or the pattern for a search command), cer-
- tain keys can be used to manipulate the command line. Most commands
- have an alternate form in [ brackets ] which can be used if a key does
- not exist on a particular keyboard. (Note that the forms beginning
- with ESC do not work in some MS-DOS and Windows systems because ESC is
- the line erase character.) Any of these special keys may be entered
- literally by preceding it with the "literal" character, either ^V or
- ^A. A backslash itself may also be entered literally by entering two
+ tain keys can be used to manipulate the command line. Most commands
+ have an alternate form in [ brackets ] which can be used if a key does
+ not exist on a particular keyboard. (Note that the forms beginning
+ with ESC do not work in some MS-DOS and Windows systems because ESC is
+ the line erase character.) Any of these special keys may be entered
+ literally by preceding it with the "literal" character, either ^V or
+ ^A. A backslash itself may also be entered literally by entering two
backslashes.
LEFTARROW [ ESC-h ]
@@ -863,7 +870,7 @@ LESS(1) LESS(1)
Move the cursor one space to the right.
^LEFTARROW [ ESC-b or ESC-LEFTARROW ]
- (That is, CONTROL and LEFTARROW simultaneously.) Move the cur-
+ (That is, CONTROL and LEFTARROW simultaneously.) Move the cur-
sor one word to the left.
^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ]
@@ -877,18 +884,18 @@ LESS(1) LESS(1)
Move the cursor to the end of the line.
BACKSPACE
- Delete the character to the left of the cursor, or cancel the
+ Delete the character to the left of the cursor, or cancel the
command if the command line is empty.
DELETE or [ ESC-x ]
Delete the character under the cursor.
^BACKSPACE [ ESC-BACKSPACE ]
- (That is, CONTROL and BACKSPACE simultaneously.) Delete the
+ (That is, CONTROL and BACKSPACE simultaneously.) Delete the
word to the left of the cursor.
^DELETE [ ESC-X or ESC-DELETE ]
- (That is, CONTROL and DELETE simultaneously.) Delete the word
+ (That is, CONTROL and DELETE simultaneously.) Delete the word
under the cursor.
UPARROW [ ESC-k ]
@@ -897,96 +904,96 @@ LESS(1) LESS(1)
DOWNARROW [ ESC-j ]
Retrieve the next command line.
- TAB Complete the partial filename to the left of the cursor. If it
- matches more than one filename, the first match is entered into
- the command line. Repeated TABs will cycle thru the other
+ TAB Complete the partial filename to the left of the cursor. If it
+ matches more than one filename, the first match is entered into
+ the command line. Repeated TABs will cycle thru the other
matching filenames. If the completed filename is a directory, a
- "/" is appended to the filename. (On MS-DOS systems, a "\" is
- appended.) The environment variable LESSSEPARATOR can be used
- to specify a different character to append to a directory name.
+ "/" is appended to the filename. (On MS-DOS systems, a "\" is
+ appended.) The environment variable LESSSEPARATOR can be used
+ to specify a different character to append to a directory name.
BACKTAB [ ESC-TAB ]
Like, TAB, but cycles in the reverse direction thru the matching
filenames.
- ^L Complete the partial filename to the left of the cursor. If it
+ ^L Complete the partial filename to the left of the cursor. If it
matches more than one filename, all matches are entered into the
command line (if they fit).
^U (Unix and OS/2) or ESC (MS-DOS)
- Delete the entire command line, or cancel the command if the
+ Delete the entire command line, or cancel the command if the
command line is empty. If you have changed your line-kill char-
acter in Unix to something other than ^U, that character is used
instead of ^U.
KEY BINDINGS
- You may define your own less commands by using the program lesskey (1)
- to create a lesskey file. This file specifies a set of command keys
- and an action associated with each key. You may also use lesskey to
+ You may define your own less commands by using the program lesskey (1)
+ to create a lesskey file. This file specifies a set of command keys
+ and an action associated with each key. You may also use lesskey to
change the line-editing keys (see LINE EDITING), and to set environment
- variables. If the environment variable LESSKEY is set, less uses that
- as the name of the lesskey file. Otherwise, less looks in a standard
- place for the lesskey file: On Unix systems, less looks for a lesskey
- file called "$HOME/.less". On MS-DOS and Windows systems, less looks
- for a lesskey file called "$HOME/_less", and if it is not found there,
+ variables. If the environment variable LESSKEY is set, less uses that
+ as the name of the lesskey file. Otherwise, less looks in a standard
+ place for the lesskey file: On Unix systems, less looks for a lesskey
+ file called "$HOME/.less". On MS-DOS and Windows systems, less looks
+ for a lesskey file called "$HOME/_less", and if it is not found there,
then looks for a lesskey file called "_less" in any directory specified
- in the PATH environment variable. On OS/2 systems, less looks for a
- lesskey file called "$HOME/less.ini", and if it is not found, then
- looks for a lesskey file called "less.ini" in any directory specified
+ in the PATH environment variable. On OS/2 systems, less looks for a
+ lesskey file called "$HOME/less.ini", and if it is not found, then
+ looks for a lesskey file called "less.ini" in any directory specified
in the INIT environment variable, and if it not found there, then looks
- for a lesskey file called "less.ini" in any directory specified in the
- PATH environment variable. See the lesskey manual page for more
+ for a lesskey file called "less.ini" in any directory specified in the
+ PATH environment variable. See the lesskey manual page for more
details.
- A system-wide lesskey file may also be set up to provide key bindings.
+ A system-wide lesskey file may also be set up to provide key bindings.
If a key is defined in both a local lesskey file and in the system-wide
- file, key bindings in the local file take precedence over those in the
- system-wide file. If the environment variable LESSKEY_SYSTEM is set,
+ file, key bindings in the local file take precedence over those in the
+ system-wide file. If the environment variable LESSKEY_SYSTEM is set,
less uses that as the name of the system-wide lesskey file. Otherwise,
- less looks in a standard place for the system-wide lesskey file: On
- Unix systems, the system-wide lesskey file is /usr/local/etc/sysless.
- (However, if less was built with a different sysconf directory than
+ less looks in a standard place for the system-wide lesskey file: On
+ Unix systems, the system-wide lesskey file is /usr/local/etc/sysless.
+ (However, if less was built with a different sysconf directory than
/usr/local/etc, that directory is where the sysless file is found.) On
- MS-DOS and Windows systems, the system-wide lesskey file is c:\_sys-
+ MS-DOS and Windows systems, the system-wide lesskey file is c:\_sys-
less. On OS/2 systems, the system-wide lesskey file is c:\sysless.ini.
INPUT PREPROCESSOR
- You may define an "input preprocessor" for less. Before less opens a
+ You may define an "input preprocessor" for less. Before less opens a
file, it first gives your input preprocessor a chance to modify the way
- the contents of the file are displayed. An input preprocessor is sim-
- ply an executable program (or shell script), which writes the contents
+ the contents of the file are displayed. An input preprocessor is sim-
+ ply an executable program (or shell script), which writes the contents
of the file to a different file, called the replacement file. The con-
- tents of the replacement file are then displayed in place of the con-
- tents of the original file. However, it will appear to the user as if
- the original file is opened; that is, less will display the original
+ tents of the replacement file are then displayed in place of the con-
+ tents of the original file. However, it will appear to the user as if
+ the original file is opened; that is, less will display the original
filename as the name of the current file.
- An input preprocessor receives one command line argument, the original
- filename, as entered by the user. It should create the replacement
- file, and when finished, print the name of the replacement file to its
- standard output. If the input preprocessor does not output a replace-
- ment filename, less uses the original file, as normal. The input pre-
- processor is not called when viewing standard input. To set up an
- input preprocessor, set the LESSOPEN environment variable to a command
- line which will invoke your input preprocessor. This command line
- should include one occurrence of the string "%s", which will be
- replaced by the filename when the input preprocessor command is
+ An input preprocessor receives one command line argument, the original
+ filename, as entered by the user. It should create the replacement
+ file, and when finished, print the name of the replacement file to its
+ standard output. If the input preprocessor does not output a replace-
+ ment filename, less uses the original file, as normal. The input pre-
+ processor is not called when viewing standard input. To set up an
+ input preprocessor, set the LESSOPEN environment variable to a command
+ line which will invoke your input preprocessor. This command line
+ should include one occurrence of the string "%s", which will be
+ replaced by the filename when the input preprocessor command is
invoked.
When less closes a file opened in such a way, it will call another pro-
- gram, called the input postprocessor, which may perform any desired
- clean-up action (such as deleting the replacement file created by
+ gram, called the input postprocessor, which may perform any desired
+ clean-up action (such as deleting the replacement file created by
LESSOPEN). This program receives two command line arguments, the orig-
- inal filename as entered by the user, and the name of the replacement
- file. To set up an input postprocessor, set the LESSCLOSE environment
- variable to a command line which will invoke your input postprocessor.
- It may include two occurrences of the string "%s"; the first is
- replaced with the original name of the file and the second with the
+ inal filename as entered by the user, and the name of the replacement
+ file. To set up an input postprocessor, set the LESSCLOSE environment
+ variable to a command line which will invoke your input postprocessor.
+ It may include two occurrences of the string "%s"; the first is
+ replaced with the original name of the file and the second with the
name of the replacement file, which was output by LESSOPEN.
- For example, on many Unix systems, these two scripts will allow you to
+ For example, on many Unix systems, these two scripts will allow you to
keep files in compressed format, but still let less view them directly:
lessopen.sh:
@@ -1005,25 +1012,25 @@ LESS(1) LESS(1)
#! /bin/sh
rm $2
- To use these scripts, put them both where they can be executed and set
+ To use these scripts, put them both where they can be executed and set
LESSOPEN="lessopen.sh %s", and LESSCLOSE="lessclose.sh %s %s". More
- complex LESSOPEN and LESSCLOSE scripts may be written to accept other
+ complex LESSOPEN and LESSCLOSE scripts may be written to accept other
types of compressed files, and so on.
- It is also possible to set up an input preprocessor to pipe the file
- data directly to less, rather than putting the data into a replacement
+ It is also possible to set up an input preprocessor to pipe the file
+ data directly to less, rather than putting the data into a replacement
file. This avoids the need to decompress the entire file before start-
ing to view it. An input preprocessor that works this way is called an
- input pipe. An input pipe, instead of writing the name of a replace-
- ment file on its standard output, writes the entire contents of the
- replacement file on its standard output. If the input pipe does not
- write any characters on its standard output, then there is no replace-
- ment file and less uses the original file, as normal. To use an input
- pipe, make the first character in the LESSOPEN environment variable a
- vertical bar (|) to signify that the input preprocessor is an input
+ input pipe. An input pipe, instead of writing the name of a replace-
+ ment file on its standard output, writes the entire contents of the
+ replacement file on its standard output. If the input pipe does not
+ write any characters on its standard output, then there is no replace-
+ ment file and less uses the original file, as normal. To use an input
+ pipe, make the first character in the LESSOPEN environment variable a
+ vertical bar (|) to signify that the input preprocessor is an input
pipe.
- For example, on many Unix systems, this script will work like the pre-
+ For example, on many Unix systems, this script will work like the pre-
vious example scripts:
lesspipe.sh:
@@ -1034,15 +1041,21 @@ LESS(1) LESS(1)
esac
To use this script, put it where it can be executed and set
- LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE
- postprocessor can be used, but it is usually not necessary since there
+ LESSOPEN="|lesspipe.sh %s". 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. In this case, the replacement file
name passed to the LESSCLOSE postprocessor is "-".
- For compatibility with previous versions of less, the input pipe is not
- used if less is viewing standard input. However, if the character
- after the vertical bar is a dash (-), the input pipe is used on stan-
- dard input as well as other files.
+ For compatibility with previous versions of less, the input preproces-
+ sor or pipe is not used if less is viewing standard input. However, if
+ the first character of LESSOPEN is a dash (-), the input preprocessor
+ is used on standard input as well as other files. In this case, the
+ dash is not considered to be part of the preprocessor command. If
+ standard input is being viewed, the input preprocessor is passed a file
+ name consisting of a single dash. Similarly, if the first two charac-
+ ters of LESSOPEN are vertical bar and 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 the input pipe command.
NATIONAL CHARACTER SETS
@@ -1052,25 +1065,25 @@ LESS(1) LESS(1)
can be displayed directly to the screen.
control characters
- should not be displayed directly, but are expected to be found
+ should not be displayed directly, but are expected to be found
in ordinary text files (such as backspace and tab).
binary characters
- should not be displayed directly and are not expected to be
+ should not be displayed directly and are not expected to be
found in text files.
A "character set" is simply a description of which characters are to be
- considered normal, control, and binary. The LESSCHARSET environment
- variable may be used to select a character set. Possible values for
+ considered normal, control, and binary. The LESSCHARSET environment
+ variable may be used to select a character set. Possible values for
LESSCHARSET are:
- ascii BS, TAB, NL, CR, and formfeed are control characters, all chars
- with values between 32 and 126 are normal, and all others are
+ ascii BS, TAB, NL, CR, and formfeed are control characters, all chars
+ with values between 32 and 126 are normal, and all others are
binary.
iso8859
- Selects an ISO 8859 character set. This is the same as ASCII,
- except characters between 160 and 255 are treated as normal
+ Selects an ISO 8859 character set. This is the same as ASCII,
+ except characters between 160 and 255 are treated as normal
characters.
latin1 Same as iso8859.
@@ -1082,8 +1095,8 @@ LESS(1) LESS(1)
ebcdic Selects an EBCDIC character set.
IBM-1047
- Selects an EBCDIC character set used by OS/390 Unix Services.
- This is the EBCDIC analogue of latin1. You get similar results
+ Selects an EBCDIC character set used by OS/390 Unix Services.
+ This is the EBCDIC analogue of latin1. You get similar results
by setting either LESSCHARSET=IBM-1047 or LC_CTYPE=en_US in your
environment.
@@ -1091,29 +1104,29 @@ LESS(1) LESS(1)
next Selects a character set appropriate for NeXT computers.
- utf-8 Selects the UTF-8 encoding of the ISO 10646 character set.
- UTF-8 is special in that it supports multi-byte characters in
- the input file. It is the only character set that supports
+ utf-8 Selects the UTF-8 encoding of the ISO 10646 character set.
+ UTF-8 is special in that it supports multi-byte characters in
+ the input file. It is the only character set that supports
multi-byte characters.
windows
- Selects a character set appropriate for Microsoft Windows (cp
+ Selects a character set appropriate for Microsoft Windows (cp
1251).
- In rare cases, it may be desired to tailor less to use a character set
- other than the ones definable by LESSCHARSET. In this case, the envi-
+ In rare cases, it may be desired to tailor less to use a character set
+ other than the ones definable by LESSCHARSET. In this case, the envi-
ronment variable LESSCHARDEF can be used to define a character set. It
should be set to a string where each character in the string represents
- one character in the character set. The character "." is used for a
- normal character, "c" for control, and "b" for binary. A decimal num-
- ber may be used for repetition. For example, "bccc4b." would mean
- character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are
+ one character in the character set. The character "." is used for a
+ normal character, "c" for control, and "b" for binary. A decimal num-
+ ber may be used for repetition. For example, "bccc4b." would mean
+ character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are
binary, and 8 is normal. All characters after the last are taken to be
- the same as the last, so characters 9 through 255 would be normal.
- (This is an example, and does not necessarily represent any real char-
+ the same as the last, so characters 9 through 255 would be normal.
+ (This is an example, and does not necessarily represent any real char-
acter set.)
- This table shows the value of LESSCHARDEF which is equivalent to each
+ This table shows the value of LESSCHARDEF which is equivalent to each
of the possible values for LESSCHARSET:
ascii 8bcccbcc18b95.b
@@ -1127,66 +1140,66 @@ LESS(1) LESS(1)
latin1 8bcccbcc18b95.33b.
next 8bcccbcc18b95.bb125.bb
- If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings
- "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_TYPE or
+ If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings
+ "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_TYPE or
LANG environment variables, then the default character set is utf-8.
- If that string is not found, but your system supports the setlocale
- interface, less will use setlocale to determine the character set.
- setlocale is controlled by setting the LANG or LC_CTYPE environment
+ If that string is not found, but your system supports the setlocale
+ interface, less will use setlocale to determine the character set.
+ setlocale is controlled by setting the LANG or LC_CTYPE environment
variables.
- Finally, if the setlocale interface is also not available, the default
+ Finally, if the setlocale interface is also not available, the default
character set is latin1.
- Control and binary characters are displayed in standout (reverse
+ Control and binary characters are displayed in standout (reverse
video). Each such character is displayed in caret notation if possible
- (e.g. ^A for control-A). Caret notation is used only if inverting the
+ (e.g. ^A for control-A). Caret notation is used only if inverting the
0100 bit results in a normal printable character. Otherwise, the char-
- acter is displayed as a hex number in angle brackets. This format can
- be changed by setting the LESSBINFMT environment variable. LESSBINFMT
+ acter is displayed as a hex number in angle brackets. This format can
+ be changed by setting the LESSBINFMT environment variable. LESSBINFMT
may begin with a "*" and one character to select the display attribute:
- "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout,
- and "*n" is normal. If LESSBINFMT does not begin with a "*", normal
- attribute is assumed. The remainder of LESSBINFMT is a string which
- may include one printf-style escape sequence (a % followed by x, X, o,
- d, etc.). For example, if LESSBINFMT is "*u[%x]", binary characters
- are displayed in underlined hexadecimal surrounded by brackets. The
- default if no LESSBINFMT is specified is "*s<%X>". The default if no
- LESSBINFMT is specified is "*s<%02X>". Warning: the result of expand-
+ "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout,
+ and "*n" is normal. If LESSBINFMT does not begin with a "*", normal
+ attribute is assumed. The remainder of LESSBINFMT is a string which
+ may include one printf-style escape sequence (a % followed by x, X, o,
+ d, etc.). For example, if LESSBINFMT is "*u[%x]", binary characters
+ are displayed in underlined hexadecimal surrounded by brackets. The
+ default if no LESSBINFMT is specified is "*s<%X>". The default if no
+ LESSBINFMT is specified is "*s<%02X>". Warning: the result of expand-
ing the character via LESSBINFMT must be less than 31 characters.
When the character set is utf-8, the LESSUTFBINFMT environment variable
acts similarly to LESSBINFMT but it applies to Unicode code points that
- were successfully decoded but are unsuitable for display (e.g., unas-
- signed code points). Its default value is "<U+%04lX>". Note that
- LESSUTFBINFMT and LESSBINFMT share their display attribute setting
- ("*x") so specifying one will affect both; LESSUTFBINFMT is read after
- LESSBINFMT so its setting, if any, will have priority. Problematic
- octets in a UTF-8 file (octets of a truncated sequence, octets of a
- complete but non-shortest form sequence, illegal octets, and stray
- trailing octets) are displayed individually using LESSBINFMT so as to
+ were successfully decoded but are unsuitable for display (e.g., unas-
+ signed code points). Its default value is "<U+%04lX>". Note that
+ LESSUTFBINFMT and LESSBINFMT share their display attribute setting
+ ("*x") so specifying one will affect both; LESSUTFBINFMT is read after
+ LESSBINFMT so its setting, if any, will have priority. Problematic
+ octets in a UTF-8 file (octets of a truncated sequence, octets of a
+ complete but non-shortest form sequence, illegal octets, and stray
+ trailing octets) are displayed individually using LESSBINFMT so as to
facilitate diagnostic of how the UTF-8 file is ill-formed.
PROMPTS
- The -P option allows you to tailor the prompt to your preference. The
- string given to the -P option replaces the specified prompt string.
+ The -P option allows you to tailor the prompt to your preference. The
+ string given to the -P option replaces the specified prompt string.
Certain characters in the string are interpreted specially. The prompt
- mechanism is rather complicated to provide flexibility, but the ordi-
- nary user need not understand the details of constructing personalized
+ mechanism is rather complicated to provide flexibility, but the ordi-
+ nary user need not understand the details of constructing personalized
prompt strings.
- A percent sign followed by a single character is expanded according to
+ A percent sign followed by a single character is expanded according to
what the following character is:
- %bX Replaced by the byte offset into the current input file. The b
+ %bX Replaced by the byte offset into the current input file. The b
is followed by a single character (shown as X above) which spec-
- ifies the line whose byte offset is to be used. If the charac-
- ter is a "t", the byte offset of the top line in the display is
+ ifies the line whose byte offset is to be used. If the charac-
+ ter is a "t", the byte offset of the top line in the display is
used, an "m" means use the middle line, a "b" means use the bot-
- tom line, a "B" means use the line just after the bottom line,
- and a "j" means use the "target" line, as specified by the -j
+ tom line, a "B" means use the line just after the bottom line,
+ and a "j" means use the "target" line, as specified by the -j
option.
%B Replaced by the size of the current input file.
@@ -1194,39 +1207,39 @@ LESS(1) LESS(1)
%c Replaced by the column number of the text appearing in the first
column of the screen.
- %dX Replaced by the page number of a line in the input file. The
+ %dX Replaced by the page number of a line in the input file. The
line to be used is determined by the X, as with the %b option.
- %D Replaced by the number of pages in the input file, or equiva-
+ %D Replaced by the number of pages in the input file, or equiva-
lently, the page number of the last line in the input file.
- %E Replaced by the name of the editor (from the VISUAL environment
- variable, or the EDITOR environment variable if VISUAL is not
+ %E Replaced by the name of the editor (from the VISUAL environment
+ variable, or the EDITOR environment variable if VISUAL is not
defined). See the discussion of the LESSEDIT feature below.
%f Replaced by the name of the current input file.
- %i Replaced by the index of the current file in the list of input
+ %i Replaced by the index of the current file in the list of input
files.
- %lX Replaced by the line number of a line in the input file. The
+ %lX Replaced by the line number of a line in the input file. The
line to be used is determined by the X, as with the %b option.
- %L Replaced by the line number of the last line in the input file.
+ %L Replaced by the line number of the last line in the input file.
%m Replaced by the total number of input files.
- %pX Replaced by the percent into the current input file, based on
- byte offsets. The line used is determined by the X as with the
+ %pX Replaced by the percent into the current input file, based on
+ byte offsets. The line used is determined by the X as with the
%b option.
- %PX Replaced by the percent into the current input file, based on
- line numbers. The line used is determined by the X as with the
+ %PX Replaced by the percent into the current input file, based on
+ line numbers. The line used is determined by the X as with the
%b option.
%s Same as %B.
- %t Causes any trailing spaces to be removed. Usually used at the
+ %t Causes any trailing spaces to be removed. Usually used at the
end of the string, but may appear anywhere.
%x Replaced by the name of the next input file in the list.
@@ -1234,18 +1247,18 @@ LESS(1) LESS(1)
If any item is unknown (for example, the file size if input is a pipe),
a question mark is printed instead.
- The format of the prompt string can be changed depending on certain
- conditions. A question mark followed by a single character acts like
- an "IF": depending on the following character, a condition is evalu-
- ated. If the condition is true, any characters following the question
- mark and condition character, up to a period, are included in the
- prompt. If the condition is false, such characters are not included.
- A colon appearing between the question mark and the period can be used
+ The format of the prompt string can be changed depending on certain
+ conditions. A question mark followed by a single character acts like
+ an "IF": depending on the following character, a condition is evalu-
+ ated. If the condition is true, any characters following the question
+ mark and condition character, up to a period, are included in the
+ prompt. If the condition is false, such characters are not included.
+ A colon appearing between the question mark and the period can be used
to establish an "ELSE": any characters between the colon and the period
- are included in the string if and only if the IF condition is false.
+ are included in the string if and only if the IF condition is false.
Condition characters (which follow a question mark) may be:
- ?a True if any characters have been included in the prompt so far.
+ ?a True if any characters have been included in the prompt so far.
?bX True if the byte offset of the specified line is known.
@@ -1257,7 +1270,7 @@ LESS(1) LESS(1)
?e True if at end-of-file.
- ?f True if there is an input filename (that is, if input is not a
+ ?f True if there is an input filename (that is, if input is not a
pipe).
?lX True if the line number of the specified line is known.
@@ -1268,46 +1281,46 @@ LESS(1) LESS(1)
?n True if this is the first prompt in a new input file.
- ?pX True if the percent into the current input file, based on byte
+ ?pX True if the percent into the current input file, based on byte
offsets, of the specified line is known.
- ?PX True if the percent into the current input file, based on line
+ ?PX True if the percent into the current input file, based on line
numbers, of the specified line is known.
?s Same as "?B".
- ?x True if there is a next input file (that is, if the current
+ ?x True if there is a next input file (that is, if the current
input file is not the last one).
- Any characters other than the special ones (question mark, colon,
- period, percent, and backslash) become literally part of the prompt.
- Any of the special characters may be included in the prompt literally
+ Any characters other than the special ones (question mark, colon,
+ period, percent, and backslash) become literally part of the prompt.
+ Any of the special characters may be included in the prompt literally
by preceding it with a backslash.
Some examples:
?f%f:Standard input.
- This prompt prints the filename, if known; otherwise the string "Stan-
+ This prompt prints the filename, if known; otherwise the string "Stan-
dard input".
?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-...
- This prompt would print the filename, if known. The filename is fol-
- lowed by the line number, if known, otherwise the percent if known,
- otherwise the byte offset if known. Otherwise, a dash is printed.
- Notice how each question mark has a matching period, and how the %
+ This prompt would print the filename, if known. The filename is fol-
+ lowed by the line number, if known, otherwise the percent if known,
+ otherwise the byte offset if known. Otherwise, a dash is printed.
+ Notice how each question mark has a matching period, and how the %
after the %pt is included literally by escaping it with a backslash.
?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t
- This prints the filename if this is the first prompt in a file, fol-
- lowed by the "file N of N" message if there is more than one input
- file. Then, if we are at end-of-file, the string "(END)" is printed
- followed by the name of the next file, if there is one. Finally, any
+ This prints the filename if this is the first prompt in a file, fol-
+ lowed by the "file N of N" message if there is more than one input
+ file. Then, if we are at end-of-file, the string "(END)" is printed
+ followed by the name of the next file, if there is one. Finally, any
trailing spaces are truncated. This is the default prompt. For refer-
- ence, here are the defaults for the other two prompts (-m and -M
- respectively). Each is broken into two lines here for readability
+ ence, here are the defaults for the other two prompts (-m and -M
+ respectively). Each is broken into two lines here for readability
only.
?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x.:
@@ -1321,22 +1334,22 @@ LESS(1) LESS(1)
?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. .
byte %bB?s/%s. ?e(END) :?pB%pB\%..%t
- The prompt expansion features are also used for another purpose: if an
- environment variable LESSEDIT is defined, it is used as the command to
- be executed when the v command is invoked. The LESSEDIT string is
- expanded in the same way as the prompt strings. The default value for
+ The prompt expansion features are also used for another purpose: if an
+ environment variable LESSEDIT is defined, it is used as the command to
+ be executed when the v command is invoked. The LESSEDIT string is
+ expanded in the same way as the prompt strings. The default value for
LESSEDIT is:
%E ?lm+%lm. %f
Note that this expands to the editor name, followed by a + and the line
- number, followed by the file name. If your editor does not accept the
- "+linenumber" syntax, or has other differences in invocation syntax,
+ number, followed by the file name. If your editor does not accept the
+ "+linenumber" syntax, or has other differences in invocation syntax,
the LESSEDIT variable can be changed to modify this default.
SECURITY
- When the environment variable LESSSECURE is set to 1, less runs in a
+ When the environment variable LESSSECURE is set to 1, less runs in a
"secure" mode. This means these features are disabled:
! the shell command
@@ -1362,54 +1375,54 @@ LESS(1) LESS(1)
COMPATIBILITY WITH MORE
If the environment variable LESS_IS_MORE is set to 1, or if the program
- is invoked via a file link named "more", less behaves (mostly) in con-
- formance with the POSIX "more" command specification. In this mode,
+ is invoked via a file link named "more", less behaves (mostly) in con-
+ formance with the POSIX "more" command specification. In this mode,
less behaves differently in these ways:
- The -e option works differently. If the -e option is not set, less
- behaves as if the -E option were set. If the -e option is set, less
+ The -e option works differently. If the -e option is not set, less
+ behaves as if the -E option were set. If the -e option is set, less
behaves as if the -e and -F options were set.
- The -m option works differently. If the -m option is not set, the
- medium prompt is used, and it is prefixed with the string "--More--".
+ The -m option works differently. If the -m option is not set, the
+ medium prompt is used, and it is prefixed with the string "--More--".
If the -m option is set, the short prompt is used.
- The -n option acts like the -z option. The normal behavior of the -n
+ The -n option acts like the -z option. The normal behavior of the -n
option is unavailable in this mode.
- The parameter to the -p option is taken to be a less command rather
+ The parameter to the -p option is taken to be a less command rather
than a search pattern.
- The LESS environment variable is ignored, and the MORE environment
+ The LESS environment variable is ignored, and the MORE environment
variable is used in its place.
ENVIRONMENT VARIABLES
Environment variables may be specified either in the system environment
- as usual, or in a lesskey (1) file. If environment variables are
- defined in more than one place, variables defined in a local lesskey
- file take precedence over variables defined in the system environment,
+ as usual, or in a lesskey (1) file. If environment variables are
+ defined in more than one place, variables defined in a local lesskey
+ file take precedence over variables defined in the system environment,
which take precedence over variables defined in the system-wide lesskey
file.
COLUMNS
Sets the number of columns on the screen. Takes precedence over
- the number of columns specified by the TERM variable. (But if
+ the number of columns specified by the TERM variable. (But if
you have a windowing system which supports TIOCGWINSZ or
- WIOCGETD, the window system's idea of the screen size takes
+ WIOCGETD, the window system's idea of the screen size takes
precedence over the LINES and COLUMNS environment variables.)
EDITOR The name of the editor (used for the v command).
- HOME Name of the user's home directory (used to find a lesskey file
+ HOME Name of the user's home directory (used to find a lesskey file
on Unix and OS/2 systems).
HOMEDRIVE, HOMEPATH
- Concatenation of the HOMEDRIVE and HOMEPATH environment vari-
+ Concatenation of the HOMEDRIVE and HOMEPATH environment vari-
ables is the name of the user's home directory if the HOME vari-
able is not set (only in the Windows version).
- INIT Name of the user's init directory (used to find a lesskey file
+ INIT Name of the user's init directory (used to find a lesskey file
on OS/2 systems).
LANG Language for determining the character set.
@@ -1420,12 +1433,12 @@ LESS(1) LESS(1)
LESS Options which are passed to less automatically.
LESSANSIENDCHARS
- Characters which may end an ANSI color escape sequence (default
+ Characters which may end an ANSI color escape sequence (default
"m").
LESSANSIMIDCHARS
- Characters which may appear between the ESC character and the
- end character in an ANSI color escape sequence (default
+ Characters which may appear between the ESC character and the
+ end character in an ANSI color escape sequence (default
"0123456789;[?!"'#%()*+ ".
LESSBINFMT
@@ -1442,24 +1455,24 @@ LESS(1) LESS(1)
LESSECHO
Name of the lessecho program (default "lessecho"). The lessecho
- program is needed to expand metacharacters, such as * and ?, in
+ program is needed to expand metacharacters, such as * and ?, in
filenames on Unix systems.
LESSEDIT
- Editor prototype string (used for the v command). See discus-
+ Editor prototype string (used for the v command). See discus-
sion under PROMPTS.
LESSGLOBALTAGS
- Name of the command used by the -t option to find global tags.
+ Name of the command used by the -t option to find global tags.
Normally should be set to "global" if your system has the global
(1) command. If not set, global tags are not used.
LESSHISTFILE
- Name of the history file used to remember search commands and
- shell commands between invocations of less. If set to "-" or
- "/dev/null", a history file is not used. The default is
- "$HOME/.lesshst" on Unix systems, "$HOME/_lesshst" on DOS and
- Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini"
+ Name of the history file used to remember search commands and
+ shell commands between invocations of less. If set to "-" or
+ "/dev/null", a history file is not used. The default is
+ "$HOME/.lesshst" on Unix systems, "$HOME/_lesshst" on DOS and
+ Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini"
on OS/2 systems.
LESSHISTSIZE
@@ -1473,13 +1486,13 @@ LESS(1) LESS(1)
Name of the default system-wide lesskey(1) file.
LESSMETACHARS
- List of characters which are considered "metacharacters" by the
+ List of characters which are considered "metacharacters" by the
shell.
LESSMETAESCAPE
- Prefix which less will add before each metacharacter in a com-
- mand sent to the shell. If LESSMETAESCAPE is an empty string,
- commands containing metacharacters will not be passed to the
+ Prefix which less will add before each metacharacter in a com-
+ mand sent to the shell. If LESSMETAESCAPE is an empty string,
+ commands containing metacharacters will not be passed to the
shell.
LESSOPEN
@@ -1489,7 +1502,7 @@ LESS(1) LESS(1)
Runs less in "secure" mode. See discussion under SECURITY.
LESSSEPARATOR
- String to be appended to a directory name in filename comple-
+ String to be appended to a directory name in filename comple-
tion.
LESSUTFBINFMT
@@ -1498,16 +1511,16 @@ LESS(1) LESS(1)
LESS_IS_MORE
Emulate the more (1) command.
- LINES Sets the number of lines on the screen. Takes precedence over
+ LINES Sets the number of lines on the screen. Takes precedence over
the number of lines specified by the TERM variable. (But if you
- have a windowing system which supports TIOCGWINSZ or WIOCGETD,
- the window system's idea of the screen size takes precedence
+ have a windowing system which supports TIOCGWINSZ or WIOCGETD,
+ the window system's idea of the screen size takes precedence
over the LINES and COLUMNS environment variables.)
- PATH User's search path (used to find a lesskey file on MS-DOS and
+ PATH User's search path (used to find a lesskey file on MS-DOS and
OS/2 systems).
- SHELL The shell used to execute the ! command, as well as to expand
+ SHELL The shell used to execute the ! command, as well as to expand
filenames.
TERM The type of terminal on which less is being run.
@@ -1520,21 +1533,21 @@ LESS(1) LESS(1)
COPYRIGHT
- Copyright (C) 1984-2008 Mark Nudelman
+ Copyright (C) 1984-2009 Mark Nudelman
- less is part of the GNU project and is free software. You can redis-
- tribute it and/or modify it under the terms of either (1) the GNU Gen-
- eral Public License as published by the Free Software Foundation; or
+ less is part of the GNU project and is free software. You can redis-
+ tribute it and/or modify it under the terms of either (1) the GNU Gen-
+ eral Public License as published by the Free Software Foundation; or
(2) the Less License. See the file README in the less distribution for
more details regarding redistribution. You should have received a copy
- of the GNU General Public License along with the source for less; see
- the file COPYING. If not, write to the Free Software Foundation, 59
- Temple Place, Suite 330, Boston, MA 02111-1307, USA. You should also
+ of the GNU General Public License along with the source for less; see
+ the file COPYING. If not, write to the Free Software Foundation, 59
+ Temple Place, Suite 330, Boston, MA 02111-1307, USA. You should also
have received a copy of the Less License; see the file LICENSE.
less is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT-
- NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT-
+ NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
@@ -1549,4 +1562,4 @@ LESS(1) LESS(1)
- Version 429: 11 Apr 2009 LESS(1)
+ Version 436: 07 Jul 2009 LESS(1)
OpenPOWER on IntegriCloud