CVSROOT: /webcvs/grep Module name: grep Changes by: Jim Meyering <meyering> 22/09/03 15:33:15
Index: html_node/Environment-Variables.html =================================================================== RCS file: /webcvs/grep/grep/manual/html_node/Environment-Variables.html,v retrieving revision 1.32 retrieving revision 1.33 diff -u -b -r1.32 -r1.33 --- html_node/Environment-Variables.html 14 Aug 2021 20:46:40 -0000 1.32 +++ html_node/Environment-Variables.html 3 Sep 2022 19:33:14 -0000 1.33 @@ -5,7 +5,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- This manual is for grep, a pattern matching engine. -Copyright (C) 1999-2002, 2005, 2008-2021 Free Software Foundation, +Copyright (C) 1999-2002, 2005, 2008-2022 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document @@ -14,10 +14,10 @@ Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". --> -<title>Environment Variables (GNU Grep 3.7)</title> +<title>Environment Variables (GNU Grep 3.8)</title> -<meta name="description" content="Environment Variables (GNU Grep 3.7)"> -<meta name="keywords" content="Environment Variables (GNU Grep 3.7)"> +<meta name="description" content="Environment Variables (GNU Grep 3.8)"> +<meta name="keywords" content="Environment Variables (GNU Grep 3.8)"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> @@ -62,8 +62,10 @@ <hr> <span id="Environment-Variables-1"></span><h3 class="section">2.2 Environment Variables</h3> -<p>The behavior of <code>grep</code> is affected -by the following environment variables. +<p>The behavior of <code>grep</code> is affected by several environment +variables, the most important of which control the locale, which +specifies how <code>grep</code> interprets characters in its patterns and +data. </p> <span id="index-LANGUAGE-environment-variable"></span> <span id="index-LC_005fALL-environment-variable"></span> @@ -75,8 +77,8 @@ in that order. The first of these variables that is set specifies the locale. For example, if <code>LC_ALL</code> is not set, -but <code>LC_COLLATE</code> is set to ‘<samp>pt_BR</samp>’, -then the Brazilian Portuguese locale is used +but <code>LC_COLLATE</code> is set to ‘<samp>pt_BR.UTF-8</samp>’, +then a Brazilian Portuguese locale is used for the <code>LC_COLLATE</code> category. As a special case for <code>LC_MESSAGES</code> only, the environment variable <code>LANGUAGE</code> can contain a colon-separated list of languages that @@ -88,7 +90,32 @@ with national language support (NLS). The shell command <code>locale -a</code> lists locales that are currently available. </p> -<p>Many of the environment variables in the following list let you +<span id="index-environment-variables"></span> +<p>The following environment variables affect the behavior of <code>grep</code>. +</p> +<dl compact="compact"> +<dt id='index-GREP_005fCOLOR-environment-variable'><span><code>GREP_COLOR</code><a href='#index-GREP_005fCOLOR-environment-variable' class='copiable-anchor'> ¶</a></span></dt> +<dd><span id="index-highlight-markers"></span> +<p>This obsolescent variable interacts with <code>GREP_COLORS</code> +confusingly, and <code>grep</code> warns if it is set and is not +overridden by <code>GREP_COLORS</code>. Instead of +‘<samp>GREP_COLOR='<var>color</var>'</samp>’, you can use +‘<samp>GREP_COLORS='mt=<var>color</var>'</samp>’. +</p> +</dd> +<dt id='index-GREP_005fCOLORS-environment-variable'><span><code>GREP_COLORS</code><a href='#index-GREP_005fCOLORS-environment-variable' class='copiable-anchor'> ¶</a></span></dt> +<dd><span id="index-highlight-markers-1"></span> +<p>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>ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36</samp>’ +with the ‘<samp>rv</samp>’ and ‘<samp>ne</samp>’ boolean capabilities omitted (i.e., false). +The two-letter capability names +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. +Non-empty capability values control highlighting using Select Graphic Rendition (SGR) commands interpreted by the terminal or terminal emulator. @@ -116,37 +143,7 @@ and ‘<samp>48;5;0</samp>’ to ‘<samp>48;5;255</samp>’ for 88-color and 256-color modes background colors. </p> -<p>The two-letter names used in the <code>GREP_COLORS</code> 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> -<span id="index-environment-variables"></span> - -<dl compact="compact"> -<dt id='index-GREP_005fCOLOR-environment-variable'><span><code>GREP_COLOR</code><a href='#index-GREP_005fCOLOR-environment-variable' class='copiable-anchor'> ¶</a></span></dt> -<dd><span id="index-highlight-markers"></span> -<p>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>mt</samp>’, ‘<samp>ms</samp>’, and ‘<samp>mc</samp>’ capabilities of <code>GREP_COLORS</code> -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>-v</samp> command-line option is omitted, -or a context line when <samp>-v</samp> is specified). -The default is ‘<samp>01;31</samp>’, -which means a bold red foreground text on the terminal’s default background. -</p> -</dd> -<dt id='index-GREP_005fCOLORS-environment-variable'><span><code>GREP_COLORS</code><a href='#index-GREP_005fCOLORS-environment-variable' class='copiable-anchor'> ¶</a></span></dt> -<dd><span id="index-highlight-markers-1"></span> -<p>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>ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36</samp>’ -with the ‘<samp>rv</samp>’ and ‘<samp>ne</samp>’ boolean capabilities omitted (i.e., false). -Supported capabilities are as follows. +<p>Supported capabilities are as follows. </p> <dl compact="compact"> <dt id='index-sl-GREP_005fCOLORS-capability'><span><code>sl=</code><a href='#index-sl-GREP_005fCOLORS-capability' class='copiable-anchor'> ¶</a></span></dt> @@ -256,7 +253,7 @@ <span id="index-national-language-support"></span> <span id="index-NLS"></span> <p>These variables specify the locale for the <code>LC_COLLATE</code> category, -which might affect how range expressions like ‘<samp>[a-z]</samp>’ are +which might affect how range expressions like ‘<samp>a-z</samp>’ are interpreted. </p> </dd> @@ -299,8 +296,11 @@ 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 -invalid bracket expression. See <a href="Character-Classes-and-Bracket-Expressions.html#invalid_002dbracket_002dexpr">invalid-bracket-expr</a>. +</p> +</dd> +<dt id='index-TERM-environment-variable'><span><code>TERM</code><a href='#index-TERM-environment-variable' class='copiable-anchor'> ¶</a></span></dt> +<dd><p>This variable specifies the output terminal type, which can affect +what the <samp>--color</samp> option does. See <a href="General-Output-Control.html">General Output Control</a>. </p> </dd> <dt id='index-_005fN_005fGNU_005fnonoption_005fargv_005fflags_005f-environment-variable'><span><code>_<var>N</var>_GNU_nonoption_argv_flags_</code><a href='#index-_005fN_005fGNU_005fnonoption_005fargv_005fflags_005f-environment-variable' class='copiable-anchor'> ¶</a></span></dt>
