[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to grep/manual/html_node/Environment-Variables.html,v
From: |
Jim Meyering |
Subject: |
Changes to grep/manual/html_node/Environment-Variables.html,v |
Date: |
Fri, 02 Mar 2012 09:28:39 +0000 |
CVSROOT: /webcvs/grep
Module name: grep
Changes by: Jim Meyering <meyering> 12/03/02 09:28:32
Index: html_node/Environment-Variables.html
===================================================================
RCS file: /webcvs/grep/grep/manual/html_node/Environment-Variables.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- html_node/Environment-Variables.html 25 Jun 2011 09:28:45 -0000
1.9
+++ html_node/Environment-Variables.html 2 Mar 2012 09:28:27 -0000
1.10
@@ -1,8 +1,8 @@
<html lang="en">
<head>
-<title>Environment Variables - GNU Grep 2.9</title>
+<title>Environment Variables - GNU Grep 2.11</title>
<meta http-equiv="Content-Type" content="text/html">
-<meta name="description" content="GNU Grep 2.9">
+<meta name="description" content="GNU Grep 2.11">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Invoking.html#Invoking" title="Invoking">
@@ -12,7 +12,8 @@
<!--
This manual is for `grep', a pattern matching engine.
-Copyright (C) 1999-2002, 2005, 2008-2011 Free Software Foundation, Inc.
+Copyright (C) 1999-2002, 2005, 2008-2012 Free Software Foundation,
+Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
@@ -61,7 +62,41 @@
The ‘<samp><span class="samp">C</span></samp>’ locale is used if
none of these environment variables are set,
if the locale catalog is not installed,
or if <samp><span class="command">grep</span></samp> was not compiled
-with national language support (<span class="sc">nls</span>).
+with national language support (NLS).
+
+ <p>Many of the environment variables in the following list let you
+control highlighting using
+Select Graphic Rendition (SGR)
+commands interpreted by the terminal or terminal emulator.
+(See the
+section
+in the documentation of your text terminal
+for permitted values and their meanings as character attributes.)
+These substring values are integers in decimal representation
+and can be concatenated with semicolons.
+<samp><span class="command">grep</span></samp> takes care of assembling the
result
+into a complete SGR sequence (‘<samp><span
class="samp">\33[</span></samp>’...‘<samp><span
class="samp">m</span></samp>’).
+Common values to concatenate include
+‘<samp><span class="samp">1</span></samp>’ for bold,
+‘<samp><span class="samp">4</span></samp>’ for underline,
+‘<samp><span class="samp">5</span></samp>’ for blink,
+‘<samp><span class="samp">7</span></samp>’ for inverse,
+‘<samp><span class="samp">39</span></samp>’ for default foreground
color,
+‘<samp><span class="samp">30</span></samp>’ to ‘<samp><span
class="samp">37</span></samp>’ for foreground colors,
+‘<samp><span class="samp">90</span></samp>’ to ‘<samp><span
class="samp">97</span></samp>’ for 16-color mode foreground colors,
+‘<samp><span class="samp">38;5;0</span></samp>’ to
‘<samp><span class="samp">38;5;255</span></samp>’
+for 88-color and 256-color modes foreground colors,
+‘<samp><span class="samp">49</span></samp>’ for default background
color,
+‘<samp><span class="samp">40</span></samp>’ to ‘<samp><span
class="samp">47</span></samp>’ for background colors,
+‘<samp><span class="samp">100</span></samp>’ to ‘<samp><span
class="samp">107</span></samp>’ for 16-color mode background colors,
+and ‘<samp><span class="samp">48;5;0</span></samp>’ to
‘<samp><span class="samp">48;5;255</span></samp>’
+for 88-color and 256-color modes background colors.
+
+ <p>The two-letter names used in the <samp><span
class="env">GREP_COLORS</span></samp> environment variable
+(and some of the others) refer to terminal “capabilities,” the
ability
+of a terminal to highlight text, or change its color, and so on.
+These capabilities are stored in an online database and accessed by
+the <code>terminfo</code> library.
<p><a name="index-environment-variables-130"></a>
<dl>
@@ -77,20 +112,27 @@
A backslash escapes the next character, so it can be used to
specify an option containing whitespace or a backslash.
+ <p>The <code>GREP_OPTIONS</code> value does not affect whether
<samp><span class="command">grep</span></samp>
+without file operands searches standard input or the working
+directory; that is affected only by command-line options. For
+example, the command ‘<samp><span class="samp">grep
PAT</span></samp>’ searches standard input and the
+command ‘<samp><span class="samp">grep -r PAT</span></samp>’
searches the working directory, regardless
+of whether <code>GREP_OPTIONS</code> contains <samp><span
class="option">-r</span></samp>.
+
<br><dt><samp><span class="env">GREP_COLOR</span></samp><dd><a
name="index-GREP_005fCOLOR-_0040r_007benvironment-variable_007d-133"></a><a
name="index-highlight-markers-134"></a>This variable specifies the color used
to highlight matched (non-empty) text.
-It is deprecated in favor of <code>GREP_COLORS</code>, but still supported.
-The ‘<samp><span class="samp">mt</span></samp>’,
‘<samp><span class="samp">ms</span></samp>’, and ‘<samp><span
class="samp">mc</span></samp>’ capabilities of <code>GREP_COLORS</code>
+It is deprecated in favor of <samp><span
class="env">GREP_COLORS</span></samp>, but still supported.
+The ‘<samp><span class="samp">mt</span></samp>’,
‘<samp><span class="samp">ms</span></samp>’, and ‘<samp><span
class="samp">mc</span></samp>’ capabilities of <samp><span
class="env">GREP_COLORS</span></samp>
have priority over it.
It can only specify the color used to highlight
the matching non-empty text in any matching line
-(a selected line when the ‘<samp><span
class="samp">-v</span></samp>’ command-line option is omitted,
-or a context line when ‘<samp><span class="samp">-v</span></samp>’
is specified).
+(a selected line when the <samp><span class="option">-v</span></samp>
command-line option is omitted,
+or a context line when <samp><span class="option">-v</span></samp> is
specified).
The default is ‘<samp><span class="samp">01;31</span></samp>’,
which means a bold red foreground text on the terminal's default background.
<br><dt><samp><span class="env">GREP_COLORS</span></samp><dd><a
name="index-GREP_005fCOLORS-_0040r_007benvironment-variable_007d-135"></a><a
name="index-highlight-markers-136"></a>This variable specifies the colors and
other attributes
used to highlight various parts of the output.
-Its value is a colon-separated list of capabilities
+Its value is a colon-separated list of <code>terminfo</code> capabilities
that defaults to ‘<samp><span
class="samp">ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36</span></samp>’
with the ‘<samp><span class="samp">rv</span></samp>’ and
‘<samp><span class="samp">ne</span></samp>’ boolean capabilities
omitted (i.e., false).
Supported capabilities are as follows.
@@ -98,45 +140,45 @@
<dl>
<dt><code>sl=</code><dd><a
name="index-sl-GREP_005fCOLORS-_0040r_007bcapability_007d-137"></a>SGR
substring for whole selected lines
(i.e.,
-matching lines when the ‘<samp><span
class="samp">-v</span></samp>’ command-line option is omitted,
-or non-matching lines when ‘<samp><span
class="samp">-v</span></samp>’ is specified).
+matching lines when the <samp><span class="option">-v</span></samp>
command-line option is omitted,
+or non-matching lines when <samp><span class="option">-v</span></samp> is
specified).
If however the boolean ‘<samp><span class="samp">rv</span></samp>’
capability
-and the ‘<samp><span class="samp">-v</span></samp>’ command-line
option are both specified,
+and the <samp><span class="option">-v</span></samp> command-line option are
both specified,
it applies to context matching lines instead.
The default is empty (i.e., the terminal's default color pair).
<br><dt><code>cx=</code><dd><a
name="index-cx-GREP_005fCOLORS-_0040r_007bcapability_007d-138"></a>SGR
substring for whole context lines
(i.e.,
-non-matching lines when the ‘<samp><span
class="samp">-v</span></samp>’ command-line option is omitted,
-or matching lines when ‘<samp><span class="samp">-v</span></samp>’
is specified).
+non-matching lines when the <samp><span class="option">-v</span></samp>
command-line option is omitted,
+or matching lines when <samp><span class="option">-v</span></samp> is
specified).
If however the boolean ‘<samp><span class="samp">rv</span></samp>’
capability
-and the ‘<samp><span class="samp">-v</span></samp>’ command-line
option are both specified,
+and the <samp><span class="option">-v</span></samp> command-line option are
both specified,
it applies to selected non-matching lines instead.
The default is empty (i.e., the terminal's default color pair).
<br><dt><code>rv</code><dd><a
name="index-rv-GREP_005fCOLORS-_0040r_007bcapability_007d-139"></a>Boolean
value that reverses (swaps) the meanings of
the ‘<samp><span class="samp">sl=</span></samp>’ and
‘<samp><span class="samp">cx=</span></samp>’ capabilities
-when the ‘<samp><span class="samp">-v</span></samp>’ command-line
option is specified.
+when the <samp><span class="option">-v</span></samp> command-line option is
specified.
The default is false (i.e., the capability is omitted).
<br><dt><code>mt=01;31</code><dd><a
name="index-mt-GREP_005fCOLORS-_0040r_007bcapability_007d-140"></a>SGR
substring for matching non-empty text in any matching line
(i.e.,
-a selected line when the ‘<samp><span
class="samp">-v</span></samp>’ command-line option is omitted,
-or a context line when ‘<samp><span class="samp">-v</span></samp>’
is specified).
+a selected line when the <samp><span class="option">-v</span></samp>
command-line option is omitted,
+or a context line when <samp><span class="option">-v</span></samp> is
specified).
Setting this is equivalent to setting both ‘<samp><span
class="samp">ms=</span></samp>’ and ‘<samp><span
class="samp">mc=</span></samp>’
at once to the same value.
The default is a bold red text foreground over the current line background.
<br><dt><code>ms=01;31</code><dd><a
name="index-ms-GREP_005fCOLORS-_0040r_007bcapability_007d-141"></a>SGR
substring for matching non-empty text in a selected line.
-(This is only used when the ‘<samp><span
class="samp">-v</span></samp>’ command-line option is omitted.)
+(This is used only when the <samp><span class="option">-v</span></samp>
command-line option is omitted.)
The effect of the ‘<samp><span class="samp">sl=</span></samp>’ (or
‘<samp><span class="samp">cx=</span></samp>’ if ‘<samp><span
class="samp">rv</span></samp>’) capability
-remains active when this kicks in.
+remains active when this takes effect.
The default is a bold red text foreground over the current line background.
<br><dt><code>mc=01;31</code><dd><a
name="index-mc-GREP_005fCOLORS-_0040r_007bcapability_007d-142"></a>SGR
substring for matching non-empty text in a context line.
-(This is only used when the ‘<samp><span
class="samp">-v</span></samp>’ command-line option is specified.)
+(This is used only when the <samp><span class="option">-v</span></samp>
command-line option is specified.)
The effect of the ‘<samp><span class="samp">cx=</span></samp>’ (or
‘<samp><span class="samp">sl=</span></samp>’ if ‘<samp><span
class="samp">rv</span></samp>’) capability
-remains active when this kicks in.
+remains active when this takes effect.
The default is a bold red text foreground over the current line background.
<br><dt><code>fn=35</code><dd><a
name="index-fn-GREP_005fCOLORS-_0040r_007bcapability_007d-143"></a>SGR
substring for file names prefixing any content line.
@@ -161,7 +203,7 @@
This is needed on terminals on which EL is not supported.
It is otherwise useful on terminals
for which the <code>back_color_erase</code>
-(<code>bce</code>) boolean terminfo capability does not apply,
+(<code>bce</code>) boolean <code>terminfo</code> capability does not apply,
when the chosen highlight colors do not affect the background,
or when EL is too slow or causes too much flicker.
The default is false (i.e., the capability is omitted).
@@ -170,29 +212,6 @@
<p>Note that boolean capabilities have no ‘<samp><span
class="samp">=</span></samp>’... part.
They are omitted (i.e., false) by default and become true when specified.
- <p>See the Select Graphic Rendition (SGR) section
-in the documentation of your text terminal
-for permitted values and their meaning as character attributes.
-These substring values are integers in decimal representation
-and can be concatenated with semicolons.
-<samp><span class="command">grep</span></samp> takes care of assembling the
result
-into a complete SGR sequence (‘<samp><span
class="samp">\33[</span></samp>’...‘<samp><span
class="samp">m</span></samp>’).
-Common values to concatenate include
-‘<samp><span class="samp">1</span></samp>’ for bold,
-‘<samp><span class="samp">4</span></samp>’ for underline,
-‘<samp><span class="samp">5</span></samp>’ for blink,
-‘<samp><span class="samp">7</span></samp>’ for inverse,
-‘<samp><span class="samp">39</span></samp>’ for default foreground
color,
-‘<samp><span class="samp">30</span></samp>’ to ‘<samp><span
class="samp">37</span></samp>’ for foreground colors,
-‘<samp><span class="samp">90</span></samp>’ to ‘<samp><span
class="samp">97</span></samp>’ for 16-color mode foreground colors,
-‘<samp><span class="samp">38;5;0</span></samp>’ to
‘<samp><span class="samp">38;5;255</span></samp>’
-for 88-color and 256-color modes foreground colors,
-‘<samp><span class="samp">49</span></samp>’ for default background
color,
-‘<samp><span class="samp">40</span></samp>’ to ‘<samp><span
class="samp">47</span></samp>’ for background colors,
-‘<samp><span class="samp">100</span></samp>’ to ‘<samp><span
class="samp">107</span></samp>’ for 16-color mode background colors,
-and ‘<samp><span class="samp">48;5;0</span></samp>’ to
‘<samp><span class="samp">48;5;255</span></samp>’
-for 88-color and 256-color modes background colors.
-
<br><dt><samp><span class="env">LC_ALL</span></samp><dt><samp><span
class="env">LC_COLLATE</span></samp><dt><samp><span
class="env">LANG</span></samp><dd><a
name="index-LC_005fALL-_0040r_007benvironment-variable_007d-148"></a><a
name="index-LC_005fCOLLATE-_0040r_007benvironment-variable_007d-149"></a><a
name="index-LANG-_0040r_007benvironment-variable_007d-150"></a><a
name="index-character-type-151"></a><a
name="index-national-language-support-152"></a><a
name="index-NLS-153"></a>These variables specify the locale for the
<code>LC_COLLATE</code> category,
which determines the collating sequence
used to interpret range expressions like ‘<samp><span
class="samp">[a-z]</span></samp>’.
@@ -205,9 +224,9 @@
which determines the language that <samp><span
class="command">grep</span></samp> uses for messages.
The default ‘<samp><span class="samp">C</span></samp>’ locale uses
American English messages.
- <br><dt><samp><span class="env">POSIXLY_CORRECT</span></samp><dd><a
name="index-POSIXLY_005fCORRECT-_0040r_007benvironment-variable_007d-164"></a>If
set, <samp><span class="command">grep</span></samp> behaves as <span
class="sc">posix.2</span> requires; otherwise,
-<samp><span class="command">grep</span></samp> behaves more like other <span
class="sc">gnu</span> programs.
-<span class="sc">posix.2</span>
+ <br><dt><samp><span class="env">POSIXLY_CORRECT</span></samp><dd><a
name="index-POSIXLY_005fCORRECT-_0040r_007benvironment-variable_007d-164"></a>If
set, <samp><span class="command">grep</span></samp> behaves as POSIX requires;
otherwise,
+<samp><span class="command">grep</span></samp> behaves more like other GNU
programs.
+POSIX
requires that options that
follow file names must be treated as file names;
by default,
@@ -223,7 +242,7 @@
A shell can put this variable in the environment for each command it runs,
specifying which operands are the results of file name wildcard expansion
and therefore should not be treated as options.
-This behavior is available only with the <span class="sc">gnu</span> C library,
+This behavior is available only with the GNU C library,
and only when <code>POSIXLY_CORRECT</code> is not set.
</dl>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Changes to grep/manual/html_node/Environment-Variables.html,v,
Jim Meyering <=