[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: |
Sun, 23 Nov 2014 22:23:40 +0000 |
CVSROOT: /webcvs/grep
Module name: grep
Changes by: Jim Meyering <meyering> 14/11/23 22:23:33
Index: html_node/Environment-Variables.html
===================================================================
RCS file: /webcvs/grep/grep/manual/html_node/Environment-Variables.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- html_node/Environment-Variables.html 3 Jun 2014 14:47:03 -0000
1.19
+++ html_node/Environment-Variables.html 23 Nov 2014 22:23:31 -0000
1.20
@@ -1,8 +1,8 @@
<html lang="en">
<head>
-<title>Environment Variables - GNU Grep 2.20</title>
+<title>Environment Variables - GNU Grep 2.21</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="description" content="GNU Grep 2.20">
+<meta name="description" content="GNU Grep 2.21">
<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">
@@ -50,15 +50,19 @@
<p>The behavior of <samp><span class="command">grep</span></samp> is affected
by the following environment variables.
- <p>The locale for category <code>LC_</code><var>foo</var><!-- /@w -->
+ <p><a name="index-LANGUAGE-_0040r_007benvironment-variable_007d-135"></a><a
name="index-LC_005fALL-_0040r_007benvironment-variable_007d-136"></a><a
name="index-LC_005fMESSAGES-_0040r_007benvironment-variable_007d-137"></a><a
name="index-LANG-_0040r_007benvironment-variable_007d-138"></a>The locale for
category <code>LC_</code><var>foo</var><!-- /@w -->
is specified by examining the three environment variables
<samp><span class="env">LC_ALL</span></samp>, <samp><span
class="env">LC_</span><var>foo</var></samp><!-- /@w -->, and <samp><span
class="env">LANG</span></samp>,
in that order.
The first of these variables that is set specifies the locale.
For example, if <samp><span class="env">LC_ALL</span></samp> is not set,
-but <samp><span class="env">LC_MESSAGES</span></samp> is set to
‘<samp><span class="samp">pt_BR</span></samp>’,
+but <samp><span class="env">LC_COLLATE</span></samp> is set to
‘<samp><span class="samp">pt_BR</span></samp>’,
then the Brazilian Portuguese locale is used
-for the <code>LC_MESSAGES</code> category.
+for the <samp><span class="env">LC_COLLATE</span></samp> category.
+As a special case for <samp><span class="env">LC_MESSAGES</span></samp> only,
the environment variable
+<samp><span class="env">LANGUAGE</span></samp> can contain a colon-separated
list of languages that
+overrides the three environment variables that ordinarily specify
+the <samp><span class="env">LC_MESSAGES</span></samp> category.
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
@@ -98,28 +102,15 @@
These capabilities are stored in an online database and accessed by
the <code>terminfo</code> library.
- <p><a name="index-environment-variables-135"></a>
+ <p><a name="index-environment-variables-139"></a>
<dl>
-<dt><samp><span class="env">GREP_OPTIONS</span></samp><dd><a
name="index-GREP_005fOPTIONS-_0040r_007benvironment-variable_007d-136"></a><a
name="index-default-options-environment-variable-137"></a>This variable
specifies default options to be placed in front of any
+<dt><samp><span class="env">GREP_OPTIONS</span></samp><dd><a
name="index-GREP_005fOPTIONS-_0040r_007benvironment-variable_007d-140"></a><a
name="index-default-options-environment-variable-141"></a>This variable
specifies default options to be placed in front of any
explicit options.
-For example, if <code>GREP_OPTIONS</code> is
-‘<samp><span class="samp">--binary-files=without-match
--directories=skip</span></samp>’, <samp><span
class="command">grep</span></samp>
-behaves as if the two options ‘<samp><span
class="samp">--binary-files=without-match</span></samp>’ and
-‘<samp><span class="samp">--directories=skip</span></samp>’ had
been specified before
-any explicit options.
-Option specifications are separated by
-whitespace.
-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>.
+As this causes problems when writing portable scripts, this feature
+will be removed in a future release of <samp><span
class="command">grep</span></samp>, and <samp><span
class="command">grep</span></samp>
+warns if it is used. Please use an alias or script instead.
- <br><dt><samp><span class="env">GREP_COLOR</span></samp><dd><a
name="index-GREP_005fCOLOR-_0040r_007benvironment-variable_007d-138"></a><a
name="index-highlight-markers-139"></a>This variable specifies the color used
to highlight matched (non-empty) text.
+ <br><dt><samp><span class="env">GREP_COLOR</span></samp><dd><a
name="index-GREP_005fCOLOR-_0040r_007benvironment-variable_007d-142"></a><a
name="index-highlight-markers-143"></a>This variable specifies the color used
to highlight matched (non-empty) text.
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.
@@ -130,7 +121,7 @@
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-140"></a><a
name="index-highlight-markers-141"></a>This variable specifies the colors and
other attributes
+ <br><dt><samp><span class="env">GREP_COLORS</span></samp><dd><a
name="index-GREP_005fCOLORS-_0040r_007benvironment-variable_007d-144"></a><a
name="index-highlight-markers-145"></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 <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>’
@@ -138,7 +129,7 @@
Supported capabilities are as follows.
<dl>
-<dt><code>sl=</code><dd><a
name="index-sl-GREP_005fCOLORS-_0040r_007bcapability_007d-142"></a>SGR
substring for whole selected lines
+<dt><code>sl=</code><dd><a
name="index-sl-GREP_005fCOLORS-_0040r_007bcapability_007d-146"></a>SGR
substring for whole selected lines
(i.e.,
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).
@@ -147,7 +138,7 @@
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-143"></a>SGR
substring for whole context lines
+ <br><dt><code>cx=</code><dd><a
name="index-cx-GREP_005fCOLORS-_0040r_007bcapability_007d-147"></a>SGR
substring for whole context lines
(i.e.,
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).
@@ -156,12 +147,12 @@
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-144"></a>Boolean
value that reverses (swaps) the meanings of
+ <br><dt><code>rv</code><dd><a
name="index-rv-GREP_005fCOLORS-_0040r_007bcapability_007d-148"></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="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-145"></a>SGR
substring for matching non-empty text in any matching line
+ <br><dt><code>mt=01;31</code><dd><a
name="index-mt-GREP_005fCOLORS-_0040r_007bcapability_007d-149"></a>SGR
substring for matching non-empty text in any matching line
(i.e.,
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).
@@ -169,35 +160,35 @@
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-146"></a>SGR
substring for matching non-empty text in a selected line.
+ <br><dt><code>ms=01;31</code><dd><a
name="index-ms-GREP_005fCOLORS-_0040r_007bcapability_007d-150"></a>SGR
substring for matching non-empty text in a selected line.
(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 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-147"></a>SGR
substring for matching non-empty text in a context line.
+ <br><dt><code>mc=01;31</code><dd><a
name="index-mc-GREP_005fCOLORS-_0040r_007bcapability_007d-151"></a>SGR
substring for matching non-empty text in a context line.
(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 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-148"></a>SGR
substring for file names prefixing any content line.
+ <br><dt><code>fn=35</code><dd><a
name="index-fn-GREP_005fCOLORS-_0040r_007bcapability_007d-152"></a>SGR
substring for file names prefixing any content line.
The default is a magenta text foreground over the terminal's default
background.
- <br><dt><code>ln=32</code><dd><a
name="index-ln-GREP_005fCOLORS-_0040r_007bcapability_007d-149"></a>SGR
substring for line numbers prefixing any content line.
+ <br><dt><code>ln=32</code><dd><a
name="index-ln-GREP_005fCOLORS-_0040r_007bcapability_007d-153"></a>SGR
substring for line numbers prefixing any content line.
The default is a green text foreground over the terminal's default background.
- <br><dt><code>bn=32</code><dd><a
name="index-bn-GREP_005fCOLORS-_0040r_007bcapability_007d-150"></a>SGR
substring for byte offsets prefixing any content line.
+ <br><dt><code>bn=32</code><dd><a
name="index-bn-GREP_005fCOLORS-_0040r_007bcapability_007d-154"></a>SGR
substring for byte offsets prefixing any content line.
The default is a green text foreground over the terminal's default background.
- <br><dt><code>se=36</code><dd><a
name="index-fn-GREP_005fCOLORS-_0040r_007bcapability_007d-151"></a>SGR
substring for separators that are inserted
+ <br><dt><code>se=36</code><dd><a
name="index-fn-GREP_005fCOLORS-_0040r_007bcapability_007d-155"></a>SGR
substring for separators that are inserted
between selected line fields (‘<samp><span
class="samp">:</span></samp>’),
between context line fields (‘<samp><span
class="samp">-</span></samp>’),
and between groups of adjacent lines
when nonzero context is specified (‘<samp><span
class="samp">--</span></samp>’).
The default is a cyan text foreground over the terminal's default background.
- <br><dt><code>ne</code><dd><a
name="index-ne-GREP_005fCOLORS-_0040r_007bcapability_007d-152"></a>Boolean
value that prevents clearing to the end of line
+ <br><dt><code>ne</code><dd><a
name="index-ne-GREP_005fCOLORS-_0040r_007bcapability_007d-156"></a>Boolean
value that prevents clearing to the end of line
using Erase in Line (EL) to Right (‘<samp><span
class="samp">\33[K</span></samp>’)
each time a colorized item ends.
This is needed on terminals on which EL is not supported.
@@ -212,19 +203,19 @@
<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.
- <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-153"></a><a
name="index-LC_005fCOLLATE-_0040r_007benvironment-variable_007d-154"></a><a
name="index-LANG-_0040r_007benvironment-variable_007d-155"></a><a
name="index-character-type-156"></a><a
name="index-national-language-support-157"></a><a
name="index-NLS-158"></a>These variables specify the locale for the
<code>LC_COLLATE</code> category,
+ <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-157"></a><a
name="index-LC_005fCOLLATE-_0040r_007benvironment-variable_007d-158"></a><a
name="index-LANG-_0040r_007benvironment-variable_007d-159"></a><a
name="index-character-type-160"></a><a
name="index-national-language-support-161"></a><a
name="index-NLS-162"></a>These variables specify the locale for the <samp><span
class="env">LC_COLLATE</span></samp> category,
which might affect how range expressions like ‘<samp><span
class="samp">[a-z]</span></samp>’ are
interpreted.
- <br><dt><samp><span class="env">LC_ALL</span></samp><dt><samp><span
class="env">LC_CTYPE</span></samp><dt><samp><span
class="env">LANG</span></samp><dd><a
name="index-LC_005fALL-_0040r_007benvironment-variable_007d-159"></a><a
name="index-LC_005fCTYPE-_0040r_007benvironment-variable_007d-160"></a><a
name="index-LANG-_0040r_007benvironment-variable_007d-161"></a>These variables
specify the locale for the <code>LC_CTYPE</code> category,
+ <br><dt><samp><span class="env">LC_ALL</span></samp><dt><samp><span
class="env">LC_CTYPE</span></samp><dt><samp><span
class="env">LANG</span></samp><dd><a
name="index-LC_005fALL-_0040r_007benvironment-variable_007d-163"></a><a
name="index-LC_005fCTYPE-_0040r_007benvironment-variable_007d-164"></a><a
name="index-LANG-_0040r_007benvironment-variable_007d-165"></a>These variables
specify the locale for the <samp><span class="env">LC_CTYPE</span></samp>
category,
which determines the type of characters,
e.g., which characters are whitespace.
- <br><dt><samp><span class="env">LC_ALL</span></samp><dt><samp><span
class="env">LC_MESSAGES</span></samp><dt><samp><span
class="env">LANG</span></samp><dd><a
name="index-LC_005fALL-_0040r_007benvironment-variable_007d-162"></a><a
name="index-LC_005fMESSAGES-_0040r_007benvironment-variable_007d-163"></a><a
name="index-LANG-_0040r_007benvironment-variable_007d-164"></a><a
name="index-language-of-messages-165"></a><a
name="index-message-language-166"></a><a
name="index-national-language-support-167"></a><a
name="index-translation-of-message-language-168"></a>These variables specify
the locale for the <code>LC_MESSAGES</code> category,
+ <br><dt><samp><span class="env">LANGUAGE</span></samp><dt><samp><span
class="env">LC_ALL</span></samp><dt><samp><span
class="env">LC_MESSAGES</span></samp><dt><samp><span
class="env">LANG</span></samp><dd><a
name="index-LANGUAGE-_0040r_007benvironment-variable_007d-166"></a><a
name="index-LC_005fALL-_0040r_007benvironment-variable_007d-167"></a><a
name="index-LC_005fMESSAGES-_0040r_007benvironment-variable_007d-168"></a><a
name="index-LANG-_0040r_007benvironment-variable_007d-169"></a><a
name="index-language-of-messages-170"></a><a
name="index-message-language-171"></a><a
name="index-national-language-support-172"></a><a
name="index-translation-of-message-language-173"></a>These variables specify
the locale for the <samp><span class="env">LC_MESSAGES</span></samp> category,
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-169"></a>If
set, <samp><span class="command">grep</span></samp> behaves as POSIX requires;
otherwise,
+ <br><dt><samp><span class="env">POSIXLY_CORRECT</span></samp><dd><a
name="index-POSIXLY_005fCORRECT-_0040r_007benvironment-variable_007d-174"></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
@@ -232,10 +223,10 @@
by default,
such options are permuted to the front of the operand list
and are treated as options.
-Also, <code>POSIXLY_CORRECT</code> disables special handling of an
+Also, <samp><span class="env">POSIXLY_CORRECT</span></samp> disables special
handling of an
invalid bracket expression. See <a
href="invalid_002dbracket_002dexpr.html#invalid_002dbracket_002dexpr">invalid-bracket-expr</a>.
- <br><dt><samp><span class="env">_</span><var>N</var><span
class="env">_GNU_nonoption_argv_flags_</span></samp><dd><a
name="index-g_t_005f_0040var_007bN_007d_005fGNU_005fnonoption_005fargv_005fflags_005f-_0040r_007benvironment-variable_007d-170"></a>(Here
<var>N</var> is <samp><span class="command">grep</span></samp>'s numeric
process ID.)
+ <br><dt><samp><span class="env">_</span><var>N</var><span
class="env">_GNU_nonoption_argv_flags_</span></samp><dd><a
name="index-g_t_005f_0040var_007bN_007d_005fGNU_005fnonoption_005fargv_005fflags_005f-_0040r_007benvironment-variable_007d-175"></a>(Here
<var>N</var> is <samp><span class="command">grep</span></samp>'s numeric
process ID.)
If the <var>i</var>th character of this environment variable's value is
‘<samp><span class="samp">1</span></samp>’,
do not consider the <var>i</var>th operand of <samp><span
class="command">grep</span></samp> to be an option,
even if it appears to be one.
@@ -243,7 +234,7 @@
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 GNU C library,
-and only when <code>POSIXLY_CORRECT</code> is not set.
+and only when <samp><span class="env">POSIXLY_CORRECT</span></samp> is not set.
</dl>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Changes to grep/manual/html_node/Environment-Variables.html,v,
Jim Meyering <=