From unknown Wed Jun 18 00:25:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#26205 <26205@debbugs.gnu.org> To: bug#26205 <26205@debbugs.gnu.org> Subject: Status: Unhappy with deprecating GREP_OPTIONS Reply-To: bug#26205 <26205@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:25:49 +0000 retitle 26205 Unhappy with deprecating GREP_OPTIONS reassign 26205 grep submitter 26205 Thomas G=C3=BCttler severity 26205 normal tag 26205 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 21 11:39:41 2017 Received: (at submit) by debbugs.gnu.org; 21 Mar 2017 15:39:41 +0000 Received: from localhost ([127.0.0.1]:38135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqLsr-0007G1-CX for submit@debbugs.gnu.org; Tue, 21 Mar 2017 11:39:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqLsp-0007Fm-WF for submit@debbugs.gnu.org; Tue, 21 Mar 2017 11:39:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqLsj-0004eO-Qe for submit@debbugs.gnu.org; Tue, 21 Mar 2017 11:39:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38607) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqLsj-0004eD-Ni for submit@debbugs.gnu.org; Tue, 21 Mar 2017 11:39:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqLsi-0005Ci-G8 for bug-grep@gnu.org; Tue, 21 Mar 2017 11:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqLsc-0004Z5-Os for bug-grep@gnu.org; Tue, 21 Mar 2017 11:39:32 -0400 Received: from hz1.yz.to ([178.63.61.147]:56184) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqLsc-0004XE-JB for bug-grep@gnu.org; Tue, 21 Mar 2017 11:39:26 -0400 Received: from [192.168.178.45] (i5E86D4CF.versanet.de [94.134.212.207]) by hz1.yz.to (Postfix) with ESMTPSA id 5C0E68198ED8 for ; Tue, 21 Mar 2017 16:39:17 +0100 (CET) To: bug-grep@gnu.org From: =?UTF-8?Q?Thomas_G=c3=bcttler?= Subject: Unhappy with deprecating GREP_OPTIONS Message-ID: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> Date: Tue, 21 Mar 2017 16:39:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Thunderbird/49.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) I am not happy with GREP_OPTIONS being deprecated. I asked here for help, but received no solution I like: http://unix.stackexchange.com/questions/351083/colored-grep-output-not-gr= ep-options-not-alias Here the question: I want colored output of `grep`. .... But * Strategy 1: GREP_OPTIONS. But this is deprecated. See http://www.gnu.= org/software/grep/manual/html_node/Environment-Variables.html * Stragegy 2: GREP_COLORS look like a solution at the first sight, but = this does something different. * Strategy 3: alias. This does not work for `find ... | xargs grep`, si= nce xargs does not evaluate aliases. * Strategy 4: Write a simple wrapper script. No, I think this is too di= rty and makes more trouble than it solves. * Strategy 5: patch the source code - No * Strategy 6: Contact grep developers, ask for a replacement of GREP_OP= TIONS * Strategy NICE-and-EASY: ... this is missing. I have no clue. How to solve this? Now I follow Strategy 6. Why is GREP_OPTIONS deprecated? I guess this can do confusing things if you exclude directories via this = environment variable. But setting color=3Dauto looks like something which does not do harm. May= be I am too naive. Then please tell me. What do you think? Regards, Thomas G=C3=BCttler --=20 http://www.thomas-guettler.de/ From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 21 11:55:58 2017 Received: (at 26205) by debbugs.gnu.org; 21 Mar 2017 15:55:58 +0000 Received: from localhost ([127.0.0.1]:38155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqM8b-0007eZ-Nd for submit@debbugs.gnu.org; Tue, 21 Mar 2017 11:55:57 -0400 Received: from freefriends.org ([96.88.95.60]:44802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqM8Z-0007eR-VE for 26205@debbugs.gnu.org; Tue, 21 Mar 2017 11:55:56 -0400 X-Envelope-From: arnold@skeeve.com Received: from freefriends.org (localhost [127.0.0.1]) by freefriends.org (8.14.9/8.14.9) with ESMTP id v2LFtsxM028750; Tue, 21 Mar 2017 09:55:55 -0600 Received: (from arnold@localhost) by freefriends.org (8.14.9/8.14.9/submit) id v2LFtsDB028749; Tue, 21 Mar 2017 15:55:54 GMT From: arnold@skeeve.com Message-Id: <201703211555.v2LFtsDB028749@freefriends.org> X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to arnold@skeeve.com using -f Date: Tue, 21 Mar 2017 09:55:54 -0600 To: guettliml@thomas-guettler.de, 26205@debbugs.gnu.org Subject: Re: bug#26205: Unhappy with deprecating GREP_OPTIONS References: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> In-Reply-To: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 26205 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Create a shell script named grep with /usr/bin/grep --color "$@" in it, and put it in a directory in your search path that is found before the standard grep. HTH, Arnold Thomas Güttler wrote: > I am not happy with GREP_OPTIONS being deprecated. > > I asked here for help, but received no solution I like: > > http://unix.stackexchange.com/questions/351083/colored-grep-output-not-grep-options-not-alias > > Here the question: > > I want colored output of `grep`. > > .... But > > * Strategy 1: GREP_OPTIONS. But this is deprecated. See http://www.gnu.org/software/grep/manual/html_node/Environment-Variables.html > * Stragegy 2: GREP_COLORS look like a solution at the first sight, but this does something different. > * Strategy 3: alias. This does not work for `find ... | xargs grep`, since xargs does not evaluate aliases. > * Strategy 4: Write a simple wrapper script. No, I think this is too dirty and makes more trouble than it solves. > * Strategy 5: patch the source code - No > * Strategy 6: Contact grep developers, ask for a replacement of GREP_OPTIONS > * Strategy NICE-and-EASY: ... this is missing. I have no clue. > > How to solve this? > > > Now I follow Strategy 6. > > Why is GREP_OPTIONS deprecated? > > I guess this can do confusing things if you exclude directories via this environment variable. > > But setting color=auto looks like something which does not do harm. May be I am too naive. Then please tell me. > > What do you think? > > Regards, > Thomas Güttler > > > -- > http://www.thomas-guettler.de/ > > > > From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 21 12:05:31 2017 Received: (at 26205) by debbugs.gnu.org; 21 Mar 2017 16:05:31 +0000 Received: from localhost ([127.0.0.1]:38167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqMHr-0007tc-52 for submit@debbugs.gnu.org; Tue, 21 Mar 2017 12:05:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqMHo-0007tL-Pj for 26205@debbugs.gnu.org; Tue, 21 Mar 2017 12:05:29 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8E387573B; Tue, 21 Mar 2017 16:05:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A8E387573B Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=eblake@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A8E387573B Received: from [10.10.121.124] (ovpn-121-124.rdu2.redhat.com [10.10.121.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0728117AAC; Tue, 21 Mar 2017 16:05:22 +0000 (UTC) Subject: Re: bug#26205: Unhappy with deprecating GREP_OPTIONS To: =?UTF-8?Q?Thomas_G=c3=bcttler?= , 26205@debbugs.gnu.org References: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <1efe9c8e-5330-1497-5d6d-b344399a4e58@redhat.com> Date: Tue, 21 Mar 2017 11:05:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jTStKdJiL0MnL13VNiFoA2t4KK3LE9ogf" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Mar 2017 16:05:23 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26205 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jTStKdJiL0MnL13VNiFoA2t4KK3LE9ogf Content-Type: multipart/mixed; boundary="XVfVH42iR3SjGueAGg4X3kJKSICDQt8CK"; protected-headers="v1" From: Eric Blake To: =?UTF-8?Q?Thomas_G=c3=bcttler?= , 26205@debbugs.gnu.org Message-ID: <1efe9c8e-5330-1497-5d6d-b344399a4e58@redhat.com> Subject: Re: bug#26205: Unhappy with deprecating GREP_OPTIONS References: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> In-Reply-To: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> --XVfVH42iR3SjGueAGg4X3kJKSICDQt8CK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/21/2017 10:39 AM, Thomas G=C3=BCttler wrote: >=20 > * Strategy 1: GREP_OPTIONS. But this is deprecated. See > http://www.gnu.org/software/grep/manual/html_node/Environment-Variables= =2Ehtml >=20 > * Stragegy 2: GREP_COLORS look like a solution at the first sight, but= > this does something different. > * Strategy 3: alias. This does not work for `find ... | xargs grep`, > since xargs does not evaluate aliases. It can if you teach it to (assuming you are using a sh-like shell): alias xargs=3D'xargs ' (I can't help you if you are using a csh-like shell) > * Strategy 4: Write a simple wrapper script. No, I think this is too > dirty and makes more trouble than it solves. What trouble does it cause? This our preferred recommendation, by the way= =2E > * Strategy 5: patch the source code - No Why not? It's open source, so you are free to do so, for your local setup= =2E > * Strategy 6: Contact grep developers, ask for a replacement of > GREP_OPTIONS Which you've done. But it won't help, because we made a conscious decision to kill environment variables that have the chance of breaking scripts, and we are unlikely to be persuaded to change our minds. > Why is GREP_OPTIONS deprecated? Because it has the tendency to break unsuspecting scripts that don't sanitize GREP_OPTIONS out of their environment. Environment variables that change default output are very dangerous. Environment variables that only modify behavior that has to be opted into (like GREP_COLORS) are not as bad, but once you are explicitly opting into something, a wrapper script is a lot more direct than a wrapper script + an environment variable. >=20 > I guess this can do confusing things if you exclude directories via thi= s > environment variable. Yes, that was one of the things known to break scripts. >=20 > But setting color=3Dauto looks like something which does not do harm. You're right that 'color=3Dauto' tends to not break scripts, but 'color=3Dalways' does, and it gets rather hard, rather fast, if you try t= o special-case WHICH aspects of GREP_OPTIONS are safe, vs. just a blanket statement that GREP_OPTIONS is in general unsafe. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --XVfVH42iR3SjGueAGg4X3kJKSICDQt8CK-- --jTStKdJiL0MnL13VNiFoA2t4KK3LE9ogf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJY0U9BAAoJEKeha0olJ0NqZG0H/RH/igrQV0DpiyB7q9yCcnFd KlM3/fyd8mm3ahMLUQgauhh7b0r6vmp0N0qBL8zmUgXZ5E7UCZEHbQMGv6F4htPO ta9rblTVeXlYQnGIbU67Khi61Eo7kJsyD5fpxBYb4hRIDgiHLVAEAcX2F2gMeNlB jfIMndbrZJ/lF0DFTmkMeBitT55VLnNr7KYOcFS/92L7HsvE2eVkY1QlHCcnTnJ3 DTvRpcRqf460l2YW3n9negcVOuiHg+fTyrymO1+Ongc70HqcxvMkR7Y6AfsaplSy 41Re9Y212FwFvZxEmdbXEvsQu20yQD5UbqFgjoX1oMYBpb+8zE15jBNaSZycqAs= =uvDk -----END PGP SIGNATURE----- --jTStKdJiL0MnL13VNiFoA2t4KK3LE9ogf-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 21 12:43:53 2017 Received: (at 26205) by debbugs.gnu.org; 21 Mar 2017 16:43:53 +0000 Received: from localhost ([127.0.0.1]:38193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqMsz-0000M6-D9 for submit@debbugs.gnu.org; Tue, 21 Mar 2017 12:43:53 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:38532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqMsw-0000Lt-VF for 26205@debbugs.gnu.org; Tue, 21 Mar 2017 12:43:51 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CE2A61600A1; Tue, 21 Mar 2017 09:43:43 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id OmHTfHZknHel; Tue, 21 Mar 2017 09:43:43 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 27E4A1600A2; Tue, 21 Mar 2017 09:43:43 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ApKnapCv-a41; Tue, 21 Mar 2017 09:43:43 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 118761600A1; Tue, 21 Mar 2017 09:43:43 -0700 (PDT) Subject: Re: bug#26205: Unhappy with deprecating GREP_OPTIONS To: =?UTF-8?Q?Thomas_G=c3=bcttler?= , 26205@debbugs.gnu.org References: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Tue, 21 Mar 2017 09:43:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 26205 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 03/21/2017 08:39 AM, Thomas G=C3=BCttler wrote: > Why is GREP_OPTIONS deprecated?=20 The main reason is that it breaks shell scripts. Scripts generally=20 expect 'grep' to behave as specified in POSIX and as implemented via=20 traditional 'grep' implementations. GREP_OPTIONS breaks this. Some shell scripts work around the problem by explicitly unsetting=20 GREP_OPTIONS before they call 'grep'. However, most scripts don't, I=20 expect because their authors are not generally aware of this=20 compatibility issue. So in practice the convenience of GREP_OPTIONS can=20 be more trouble than it's worth. > * Strategy 4: Write a simple wrapper script. No, I think this is too=20 > dirty and makes more trouble than it solves. Why is it dirty? What trouble does it cause, other than the trouble=20 GREP_OPTIONS causes? From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 21 17:30:18 2017 Received: (at control) by debbugs.gnu.org; 21 Jun 2017 21:30:18 +0000 Received: from localhost ([127.0.0.1]:60323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNnCc-00057T-5d for submit@debbugs.gnu.org; Wed, 21 Jun 2017 17:30:18 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNnCa-00057G-98 for control@debbugs.gnu.org; Wed, 21 Jun 2017 17:30:16 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AE5AE1600D6 for ; Wed, 21 Jun 2017 14:30:09 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 4G11jw1wRRzd for ; Wed, 21 Jun 2017 14:30:07 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 67B681600D7 for ; Wed, 21 Jun 2017 14:30:07 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id AC5K_oB9XB8h for ; Wed, 21 Jun 2017 14:30:07 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 2EB731600D5 for ; Wed, 21 Jun 2017 14:30:07 -0700 (PDT) To: control@debbugs.gnu.org From: Paul Eggert Subject: bug maintenance Organization: UCLA Computer Science Department Message-ID: <9e82e823-bd48-3182-900c-2130ac56a4ef@cs.ucla.edu> Date: Wed, 21 Jun 2017 14:30:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) tags 27398 moreinfo severity 26726 wishlist tags 26205 wontfix severity 26146 wishlist From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 07 16:19:12 2017 Received: (at submit) by debbugs.gnu.org; 7 Nov 2017 21:19:12 +0000 Received: from localhost ([127.0.0.1]:57150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCBH6-0000Ef-6D for submit@debbugs.gnu.org; Tue, 07 Nov 2017 16:19:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCAza-0008DH-Ib for submit@debbugs.gnu.org; Tue, 07 Nov 2017 16:01:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCAzU-0005cp-AQ for submit@debbugs.gnu.org; Tue, 07 Nov 2017 16:01:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47622) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eCAzU-0005ci-64 for submit@debbugs.gnu.org; Tue, 07 Nov 2017 16:01:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCAzS-0001ue-La for bug-grep@gnu.org; Tue, 07 Nov 2017 16:00:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCAzR-0005XR-7p for bug-grep@gnu.org; Tue, 07 Nov 2017 16:00:58 -0500 Received: from mail-ot0-x234.google.com ([2607:f8b0:4003:c0f::234]:47139) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eCAzQ-0005Sy-W3 for bug-grep@gnu.org; Tue, 07 Nov 2017 16:00:57 -0500 Received: by mail-ot0-x234.google.com with SMTP id s88so525126ota.4 for ; Tue, 07 Nov 2017 13:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version; bh=By7H+swD+x5g6rdsoirLHJykavbqASMm7iCNjQdBybs=; b=EmAh1UZWULCg+rzGSUBiAvRoFYH4eIc0O1wGK77PFw4qchj6r0G2YTslcHs57hrSI7 9FBsfBqgRHfgz8dns7vLJBvYosUWK0ZHUa33pfz1i2p+UBTU+jNcX6ivQNFvuW9ByYWO ogwY0xDKCf8418syKP9kt7Awl9Dx3lLhzR+pRUJInuRh1L5bnkLDLj+ILv5M3cZontEH QeCxGMSVZEd/YvDSWnAQxj4Ihp/FG5E2o+nkM0XnIN0SIGK1DtQqU2tg9SkdQkpURmiH XfBl6TTGCArB6zonK6bzzliPCxCml7ZhS5gpf0XKtHBsov7+6W3MQPzQenmDpelTFCdt Usug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:message-id:subject :mime-version; bh=By7H+swD+x5g6rdsoirLHJykavbqASMm7iCNjQdBybs=; b=GwCIWYMFrai3FWhUauTbgqF9tYWhQpYW7+Ss72Y+XQMrvLGykPOEJUKkmvLYmC0jio JxVXgnoePN7xRnj8hkNUvM5sj8bXfOrGddAmO5L0Kxvg2Aj9+8cr/ctN8t8xEwfrZX0o D2EPLVF9bRj0/GrenTpWgKi1pyXqXqY48TBQx1AoSeCZ9TsvGXkmAtcqSo/0biwWfIO1 lNl5Y50tF7Mr6RjxzqXdy2tkHSqH/9W8dzf7ic6DQXnT6XJz92X7wnubu/AaEsgDX/Ci XA7yKpiDLgMJgjDRPpBOqv316ZOBlzVtD7HiWIm7r2GLgGZ6nF6Z84msr4DYU6jSmuDq XSAw== X-Gm-Message-State: AJaThX7LSJBpMM1YYiVZPHHd5FPCbrgHbEjkKEJvnJmHQ+1/sBMAZB1x pS6FHJBj4UdARMdVP0U4p3O9iFZY X-Google-Smtp-Source: AGs4zMbhJxYTTmM27zkX6yvD/8wuNpYOgJEVu5PSdc6ZJbqLrK8uHf8DCFQQv6Ji4pUnx+DWYq4lfg== X-Received: by 10.157.67.99 with SMTP id y32mr24108oti.447.1510088454196; Tue, 07 Nov 2017 13:00:54 -0800 (PST) Received: from AnkeetPswalaMBP.mail ([2602:306:37c9:d6c0:95c:835f:5697:9302]) by smtp.gmail.com with ESMTPSA id y7sm1005741oie.1.2017.11.07.13.00.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 13:00:53 -0800 (PST) Date: Tue, 7 Nov 2017 13:00:52 -0800 From: Ankeet To: bug-grep@gnu.org Message-ID: Subject: Re: bug#26205: Unhappy with deprecating GREP_OPTIONS X-Mailer: Airmail (442) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="5a021f04_287d34b3_12691" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 07 Nov 2017 16:19:11 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --5a021f04_287d34b3_12691 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >> Why is GREP=5FOPTIONS deprecated=3F =C2=A0=C2=A0 > The main reason is that it breaks shell scripts. Scripts generally=C2=A0= > expect 'grep' to behave as specified in POSIX and as implemented via=C2= =A0 > traditional 'grep' implementations. GREP=5FOPTIONS breaks this. =C2=A0 > Some shell scripts work around the problem by explicitly unsetting=C2=A0= > GREP=5FOPTIONS before they call 'grep'. However, most scripts don't, I=C2= =A0 > expect because their authors are not generally aware of this=C2=A0 > compatibility issue. So in practice the convenience of GREP=5FOPTIONS c= an be more trouble than it's worth. Here's a simpler fix: grep should test for an interactive shell before pa= rsing GREP=5FOPTIONS. =5BThere are a number of methods outlined in the ma= n page=5D(http://www.tldp.org/LDP/abs/html/intandnonint.html). At least t= wo of these methods (PS1=5B1=5D and test =22=24(=240)=E2=80=9D are POSIX = compatible if i=E2=80=99m not mistaken. Interactive shell users can still export GREP=5FOPTIONS to get a persiste= nt configuration. But this way, shell scripts get grep without the variab= le set, and if they really need to, can still use those options by callin= g =E2=80=9Cgrep =24GREP=5FOPTIONS =E2=80=A6=E2=80=9D explicitly. --5a021f04_287d34b3_12691 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
>> Why is GREP=5FOPTIONS deprecated=3F   
> The main reason is that it breaks shell scripts. Scripts gen= erally 
> expect 'grep' to behave as specified in POSIX= and as implemented via 
> traditional 'grep' implement= ations. GREP=5FOPTIONS breaks this.  
> Some shell scri= pts work around the problem by explicitly unsetting 
> = GREP=5FOPTIONS before they call 'grep'. However, most scripts don't, I&nb= sp;
> expect because their authors are not generally aware o= f this 
> compatibility issue. So in practice the conve= nience of GREP=5FOPTIONS can be more trouble than it's worth.
<= br>
Here's a simpler fix: grep should test for an interactive s= hell before parsing GREP=5FOPTIONS. =5BThere are a number of methods outl= ined in the man page=5D(http://www.tldp.org/LDP/abs/html/intandnonint.htm= l). At least two of these methods (PS1=5B1=5D and test =22=24(=240)=E2=80= =9D are POSIX compatible if i=E2=80=99m not mistaken.

Interactive shell users can still export GREP=5FOPTIONS to get a pe= rsistent configuration. But this way, shell scripts get grep without the = variable set, and if they really need to, can still use those options by = calling =E2=80=9Cgrep =24GREP=5FOPTIONS =E2=80=A6=E2=80=9D explicitly.

--5a021f04_287d34b3_12691-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 07 18:58:42 2017 Received: (at 26205) by debbugs.gnu.org; 7 Nov 2017 23:58:42 +0000 Received: from localhost ([127.0.0.1]:57235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCDlR-0004RG-RU for submit@debbugs.gnu.org; Tue, 07 Nov 2017 18:58:42 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:42846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCDlQ-0004R2-Dl for 26205@debbugs.gnu.org; Tue, 07 Nov 2017 18:58:41 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 78485160FC2; Tue, 7 Nov 2017 15:58:34 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id hILMtPJrvB8j; Tue, 7 Nov 2017 15:58:32 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B3114160FA2; Tue, 7 Nov 2017 15:58:32 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8fWXW5cg--qO; Tue, 7 Nov 2017 15:58:32 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 9821D160E51; Tue, 7 Nov 2017 15:58:32 -0800 (PST) Subject: Re: bug#26205: Unhappy with deprecating GREP_OPTIONS To: Ankeet , 26205@debbugs.gnu.org References: <7e2f2588-a61f-4eda-4323-8d053e6a1814@thomas-guettler.de> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <019f245d-1320-4763-477b-c7b1707d0499@cs.ucla.edu> Date: Tue, 7 Nov 2017 15:58:32 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 26205 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On 11/07/2017 01:00 PM, Ankeet wrote: > grep should test for an interactive shell before parsing GREP_OPTIONS. [There are a number of methods outlined in the man page](http://www.tldp.org/LDP/abs/html/intandnonint.html). Most of those methods would not work for grep, which is not a shell script. The only exception (testing whether stdin is a terminal) would run afoul of the GNU coding standards, which say that the behavior of a program should not depend on whether standard input or output is a terminal device. See: https://www.gnu.org/prep/standards/html_node/User-Interfaces.html Although we stretch those rules occasionally, stretching does not seem advisable here. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 02 18:26:34 2022 Received: (at control) by debbugs.gnu.org; 2 Jul 2022 22:26:34 +0000 Received: from localhost ([127.0.0.1]:43016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7lZR-0002bO-R4 for submit@debbugs.gnu.org; Sat, 02 Jul 2022 18:26:33 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7lZP-0002bA-Es for control@debbugs.gnu.org; Sat, 02 Jul 2022 18:26:31 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 12DBB160143 for ; Sat, 2 Jul 2022 15:26:26 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9dzAa2cUdWHo for ; Sat, 2 Jul 2022 15:26:25 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 567EE160145 for ; Sat, 2 Jul 2022 15:26:25 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id wzbBght_QXna for ; Sat, 2 Jul 2022 15:26:25 -0700 (PDT) Received: from [192.168.0.205] (ip72-206-2-24.fv.ks.cox.net [72.206.2.24]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id F1E18160143 for ; Sat, 2 Jul 2022 15:26:24 -0700 (PDT) Message-ID: <32055ca4-b721-1d5b-bc48-01d001b6283e@cs.ucla.edu> Date: Sat, 2 Jul 2022 17:26:24 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US To: control@debbugs.gnu.org From: Paul Eggert Subject: grep bug report maintenance Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) severity 56079 wishlist close 26205 close 20990 From unknown Wed Jun 18 00:25:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 31 Jul 2022 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator