GNU bug report logs - #36764
grep -q throwing up No such file or directory error

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: grep; Reported by: Lewis Farnworth <lewfar99@HIDDEN>; Keywords: notabug; Done: Assaf Gordon <assafgordon@HIDDEN>; Maintainer for grep is bug-grep@HIDDEN.
bug closed, send any further explanations to 36764 <at> debbugs.gnu.org and Lewis Farnworth <lewfar99@HIDDEN> Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) notabug. Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 36764 <at> debbugs.gnu.org:


Received: (at 36764) by debbugs.gnu.org; 22 Jul 2019 22:16:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 22 18:16:54 2019
Received: from localhost ([127.0.0.1]:33724 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hpgc1-0005H0-MC
	for submit <at> debbugs.gnu.org; Mon, 22 Jul 2019 18:16:54 -0400
Received: from mail-pg1-f193.google.com ([209.85.215.193]:37952)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>)
 id 1hpgc0-0005Gj-9T; Mon, 22 Jul 2019 18:16:52 -0400
Received: by mail-pg1-f193.google.com with SMTP id f5so9495985pgu.5;
 Mon, 22 Jul 2019 15:16:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=WBJe088eig1sRHxmM9Dhe3Ltr56Jud+B1nYgF/UYiUI=;
 b=lWddbBFzDlqn/7Ctxx70rO4MMcFb9ThYBLOvitQz7LbfgaYc5C92wR3OHP4Di6RrJV
 TqEsAI9pIn0668hOBH/qNXgu0xtjb/JPLbiL8LncdckyAkREJ/7gzy6xLTNHwAMvoc9A
 SjjV8axERKnWxR42HPj2VDXRR3mnuv3VAIi6Wu+FnWMRRk7gC/fVkUUMnQXmO+e82/TG
 91ISX/eNpTYKjTTTIAMX4+wSKKetuDGQieyXAJ1xuUW4OGy4fKCiBi9mvPM7EZcP61Db
 es5lWd3OwKaXXRGRqWrmAdkPpYf2BpBOp06XEab9irJ5MtXHCTtn9G4Bq8ib3NP9vAj4
 Z5/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=WBJe088eig1sRHxmM9Dhe3Ltr56Jud+B1nYgF/UYiUI=;
 b=a3sSmLOJOU0EeAA13/pblzXhn3jwq3EZdsuWZzbzqnqbz3EK316ZodWHbGXj9fS1iB
 ntDBcy9minzMtWgL+wKubCHoS+lv2315wupcjJY0g5Xt7dqp6fuA2Pvi95Dp524+CUcS
 3gwwDYgWdgPy6ZrK4SOP/qGzX1OoVOnMe+J5P+D5AjG/k1QzQs+1jYZTNUuGfFMx0Zkn
 UsChQW3cPkcrDRAcX4xmQxF54mBdvRztAes7by5HA/BarmPlarkmN9V3x5nDW5XUuwJ2
 ddbXjMGB5PIv7SI9IcVqH/EL4Ahf77MMHa88KR/jq5gkRXRmOP+MHr7FsEBtv/suJ0hS
 xYsw==
X-Gm-Message-State: APjAAAWTus3HKIM0GbVfkM2NN9aiU5G1JZVhpq/eCV4kI0r6c/5TKKvq
 hAAMspTTcaq2t34wiRt8nDbN1sYx
X-Google-Smtp-Source: APXvYqw3u5RxlKqKMU+z7oJKI9UZ6cBoW7iiwDJ1XKIfVZUAEiZW6eLWVJd81Oiux8EHnDQbLj76yw==
X-Received: by 2002:a62:6044:: with SMTP id u65mr2350104pfb.15.1563833805580; 
 Mon, 22 Jul 2019 15:16:45 -0700 (PDT)
Received: from tomato (moose.housegordon.com. [184.68.105.38])
 by smtp.gmail.com with ESMTPSA id a3sm32811681pfc.70.2019.07.22.15.16.44
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 22 Jul 2019 15:16:44 -0700 (PDT)
Received: by tomato (Postfix, from userid 1000)
 id A267768218F; Mon, 22 Jul 2019 16:16:43 -0600 (MDT)
Date: Mon, 22 Jul 2019 16:16:43 -0600
From: Assaf Gordon <assafgordon@HIDDEN>
To: Lewis Farnworth <lewfar99@HIDDEN>
Subject: Re: bug#36764: grep -q throwing up No such file or directory error
Message-ID: <20190722221643.GC2676@HIDDEN>
References: <CALsk4_GcsFwnkf0Y=dOe37v6_TKykrgKEdvaTggw7Z18yAf=RA@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CALsk4_GcsFwnkf0Y=dOe37v6_TKykrgKEdvaTggw7Z18yAf=RA@HIDDEN>
User-Agent: Mutt/1.11.4 (2019-03-13)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36764
Cc: 36764 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tag 36764 notabug
close 36764
stop

Hello,

(answering out-of-order)

On Mon, Jul 22, 2019 at 06:12:10PM +0100, Lewis Farnworth wrote:

> To reiterate:
> 
> if grep -q "thing_i'm_looking_for" $variable_i'm_looking_in; then
> 
> doesn't work, on CentOS 7 or Debian 9.

This is incorrect usage, and has never worked with gnu grep.
The correct usage is:

   grep -q "thing_i'm_looking_for" "FILE to look in"

Or, to check the content of a variable, use:

   echo "$variable_i'm_looking_in" | grep -q "$thing_i'm_looking_for"

or the more robust:

   printf "%s" "$variable_i'm_looking_in" | grep -q "$thing_i'm_looking_for"

> I previously had a working script, that used -q in this context here:
> 
> if grep -q "RewriteCond %{HTTP_REFERER} !.*example.com*" $line; then
> 
> -----------------------------------------------------------------------------------------------------
> That syntax was perfectly functioning as a conditional inside of a while
> loop, to detect a colleague's error inside of a bunch of .htaccess rules.

As for the above, I would guess that the "while" loop read a FILENAME
into the variable $line (e.g. a path of an .htaccess file),
and then grep would search for the pattern in that file.

If you have access to the machine where the above works,
add "echo LINE=$line" to print the content of the variable,
and you'll see it contains a file name.


> This time, I'm trying to basically ascertain which servers on a given
> domain are using Gmail. I've ran some dig, grep, sed & awk to ascertain a
> list of mail servers the domain is using. One of the outputs which I'm
> looking for looks something like this:
> 
> $   echo $mailServ:
> alt3.aspmx.l.google.com.
> alt4.aspmx.l.google.com.
> alt1.aspmx.l.google.com.
> alt2.aspmx.l.google.com.
> aspmx.l.google.com.
> 
> *The script I'm running:*
> 
> if grep -q "google.com" $mailServ; then
> printf "%s uses google for mail \n" $mailServ
> fi
> 
> I've run into a few weird error messages when trying to use the -q
> option... And I'm 100% certain that this is not a syntax issue (but there's
> a part of me wishing it is).
> 
> *The error I get is: *
> 
> grep: aspmx.l.google.com.: No such file or directory
> grep: alt1.aspmx.l.google.com.: No such file or directory
> grep: alt4.aspmx.l.google.com.: No such file or directory
> grep: alt2.aspmx.l.google.com.: No such file or directory
> grep: alt3.aspmx.l.google.com.: No such file or directory

This is expected, as explained above.

> When in actual fact, all I need is the  printf command output. I tried to
> run the exact same script on Debian 9, to ensure that was not the issue...
> Apparently that doesn't work either.

Use something like:

  if echo "$mailServ" | grep -q "google.com"; then
     printf "%s uses google for mail \n" $mailServ
  fi

Note that this operates on the entire content of "$mailServ" (all lines
together), not line-by-line.


> I tried to use the first script I wrote again, for the sake of a sanity
> check, and that script is now broken too.

If an unmodified script used to work on CentOS before an upgrade,
and stops working after the upgrade (again, unmodified),
and you've isolated the issue to grep, please provide more details
(e.g. the entire script).

As such, I'm closing this as "not a bug", but discussion can continue
by replying to this thread.

regards,
 - assaf

P.S.
Note that in your regex patterns you use "." as a literal dot,
but it is in fact a regex special character meaning "any character".
So:

     grep "google.com" $FILE

would also match a file containing "googleXcom".

To match a literal dot, use "\.".




Information forwarded to bug-grep@HIDDEN:
bug#36764; Package grep. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Jul 2019 17:53:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 22 13:53:19 2019
Received: from localhost ([127.0.0.1]:33598 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hpcUw-0005RL-Te
	for submit <at> debbugs.gnu.org; Mon, 22 Jul 2019 13:53:19 -0400
Received: from lists.gnu.org ([209.51.188.17]:53960)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lewfar99@HIDDEN>) id 1hpbrN-00046p-ME
 for submit <at> debbugs.gnu.org; Mon, 22 Jul 2019 13:12:27 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:47476)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <lewfar99@HIDDEN>) id 1hpbrM-0006H7-8R
 for bug-grep@HIDDEN; Mon, 22 Jul 2019 13:12:25 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: *
X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50,
 FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <lewfar99@HIDDEN>) id 1hpbrK-0003Q7-RN
 for bug-grep@HIDDEN; Mon, 22 Jul 2019 13:12:24 -0400
Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:34606)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <lewfar99@HIDDEN>) id 1hpbrK-0003PW-L3
 for bug-grep@HIDDEN; Mon, 22 Jul 2019 13:12:22 -0400
Received: by mail-ot1-x341.google.com with SMTP id n5so41047352otk.1
 for <bug-grep@HIDDEN>; Mon, 22 Jul 2019 10:12:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=snFg1jqZEusfHuWY3FyBpqtLI5GbLhGl88/NJV28HK4=;
 b=Lj8fNIoI1HsdQtKz6Sat3QEgqJEFRrbdE9o2rY2EvuujvW25ojDz4OhOm04AriB/4x
 QkpboSXYHJC94UwbquKLth+OFYbQBMswwmZ1V07mtugwRBsrUh5kIsgi5drUspXf/CGQ
 R6WolK0hbN1nd2vtvGtbaMj4ZbLhld1DTqzP/hL7DF+adOlNlxl60U7+4Tl/JLqOT8aE
 2wRkM+a60gpkxr8KNRKrYCXdw/l+GbC5TEwNkueBUfEyuuMPNNrmm730/2ER7qJG4l+I
 r0RO+PQh/nzYk4n3HmO20ea3nhzYPSJZ8PYXgMUKiJGZIOr7TBLCH67nCj8jlCd33wlc
 BQ5A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=snFg1jqZEusfHuWY3FyBpqtLI5GbLhGl88/NJV28HK4=;
 b=fAInSxIV7FeuEZ+sR/Za0WdKyYWk4On2IEU5rrTDVFj98zH4t1pznIaTs7tCmzZxM9
 jGifc4Rz3GYvBGwBg5yWrWgwuuhYiA4YhAoTJDytgfSlocViLuOARvxfsE2I+MmP/wRs
 FSRX4rB1QyPpVpaYxpd/Mkuia9mcCejOZDDgovguzqgkYCKZopqTt6hLz3B8YaUuwsN/
 vwNGfEU04xJSKYmE+Hp4VmweH1Ra7p6gBbqKV6xrelTrEcyzW94cphTns5b2/MolVgbZ
 CH48kwxiShItsAfb91gSSQiXi3OQQgGYqPsMItY3VqRvE2P9d1G2BUf/dieUpfsL6nMs
 TITw==
X-Gm-Message-State: APjAAAXHBlZ/e0mldO6DaaNiTPyFpE9BJ3llzr5ah/Kb2JsFvhQV9vRK
 TtyxWMtMyyowW1GKe+SpehqRFYO0y9Mx/ahwdu3+bz7g
X-Google-Smtp-Source: APXvYqzWihq1KsBQ83HXtEEhuBdwM0EUfBNp+ULuMAFdQC70vt4h2OZVMl+/LHJqmQy100MLQn63xLBRMg0pgWSWnus=
X-Received: by 2002:a9d:7352:: with SMTP id l18mr48659278otk.292.1563815541218; 
 Mon, 22 Jul 2019 10:12:21 -0700 (PDT)
MIME-Version: 1.0
From: Lewis Farnworth <lewfar99@HIDDEN>
Date: Mon, 22 Jul 2019 18:12:10 +0100
Message-ID: <CALsk4_GcsFwnkf0Y=dOe37v6_TKykrgKEdvaTggw7Z18yAf=RA@HIDDEN>
Subject: grep -q throwing up No such file or directory error
To: bug-grep@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000d4204d058e482db2"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::341
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 22 Jul 2019 13:53:18 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

--000000000000d4204d058e482db2
Content-Type: text/plain; charset="UTF-8"

Hello,

Never posted a bug report before but I'm certain that the -q flag for grep
is broken.

I previously had a working script, that used -q in this context here:

if grep -q "RewriteCond %{HTTP_REFERER} !.*example.com*" $line; then

-----------------------------------------------------------------------------------------------------
That syntax was perfectly functioning as a conditional inside of a while
loop, to detect a colleague's error inside of a bunch of .htaccess rules.

I ran it and got what I wanted to work.

That was a few weeks back, since then I have ran a yum update (on CentOS 7)
and tried to adopt the same flag in a different script... To no avail.

This time, I'm trying to basically ascertain which servers on a given
domain are using Gmail. I've ran some dig, grep, sed & awk to ascertain a
list of mail servers the domain is using. One of the outputs which I'm
looking for looks something like this:

$   echo $mailServ:
alt3.aspmx.l.google.com.
alt4.aspmx.l.google.com.
alt1.aspmx.l.google.com.
alt2.aspmx.l.google.com.
aspmx.l.google.com.

*The script I'm running:*

if grep -q "google.com" $mailServ; then
printf "%s uses google for mail \n" $mailServ
fi

I've run into a few weird error messages when trying to use the -q
option... And I'm 100% certain that this is not a syntax issue (but there's
a part of me wishing it is).

*The error I get is: *

grep: aspmx.l.google.com.: No such file or directory
grep: alt1.aspmx.l.google.com.: No such file or directory
grep: alt4.aspmx.l.google.com.: No such file or directory
grep: alt2.aspmx.l.google.com.: No such file or directory
grep: alt3.aspmx.l.google.com.: No such file or directory

When in actual fact, all I need is the  printf command output. I tried to
run the exact same script on Debian 9, to ensure that was not the issue...
Apparently that doesn't work either.

I ran an individual grep command (no flags) on text file with the exact
same contents.
It came back with positives, as you'd expect... as every line had the word
google in there.

I tried to use the first script I wrote again, for the sake of a sanity
check, and that script is now broken too.

To reiterate:

if grep -q "thing_i'm_looking_for" $variable_i'm_looking_in; then

doesn't work, on CentOS 7 or Debian 9.  I have tried putting the variable
in single and double quotes, putting the thing I'm looking for in single
and double quotes, putting the if parameters inside square brackets,
exporting the variable to a text file and grepping from that and using the
-s flag... Please can someone take a look and check that I'm not insane and
that this infact a bug and not my own problem.

GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)

Kind regards,
Lewis

--000000000000d4204d058e482db2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello,<div><br></div><div>Never posted a bug report before=
 but I&#39;m certain that the -q flag for grep is broken.</div><div><br></d=
iv><div>I previously had a working script, that used -q in this context her=
e:</div><div><br></div><div>if grep -q &quot;RewriteCond %{HTTP_REFERER} !.=
*<a href=3D"http://example.com">example.com</a>*&quot; $line; then<br><div>=
<br></div><div>------------------------------------------------------------=
-----------------------------------------</div><div>That syntax was perfect=
ly functioning as a conditional inside of a while loop, to detect a colleag=
ue&#39;s error inside of a bunch of .htaccess rules.</div><div><br></div><d=
iv>I ran it and got what I wanted to work.=C2=A0</div><div><br></div><div>T=
hat was a few weeks back, since then I have ran a yum update (on CentOS 7) =
and tried to adopt the same flag in a different script... To no avail.=C2=
=A0</div></div><div><br></div><div>This time, I&#39;m trying to basically a=
scertain which servers on a given domain are using Gmail. I&#39;ve ran some=
 dig, grep, sed &amp; awk to ascertain a list of mail servers the domain is=
 using. One of the outputs which I&#39;m looking for looks something like t=
his:</div><div><br></div><div>$=C2=A0 =C2=A0echo $mailServ:</div><div><a hr=
ef=3D"http://alt3.aspmx.l.google.com">alt3.aspmx.l.google.com</a>.<br><a hr=
ef=3D"http://alt4.aspmx.l.google.com">alt4.aspmx.l.google.com</a>.<br><a hr=
ef=3D"http://alt1.aspmx.l.google.com">alt1.aspmx.l.google.com</a>.<br><a hr=
ef=3D"http://alt2.aspmx.l.google.com">alt2.aspmx.l.google.com</a>.<br><a hr=
ef=3D"http://aspmx.l.google.com">aspmx.l.google.com</a>.<br></div><div><u><=
br></u></div><div><u><b>The script I&#39;m running:</b></u></div><div><br><=
/div><div>if grep -q &quot;<a href=3D"http://google.com">google.com</a>&quo=
t; $mailServ; then<br>printf &quot;%s uses google for mail \n&quot; $mailSe=
rv<br>fi</div><div><br></div><div><div>I&#39;ve run into a few weird error =
messages when trying to use the -q option... And I&#39;m 100% certain that =
this is not a syntax issue (but there&#39;s a part of me wishing it is).=C2=
=A0</div><div><br></div><div><u><b>The error I get is:=C2=A0</b></u></div><=
div><br></div><div>grep: <a href=3D"http://aspmx.l.google.com">aspmx.l.goog=
le.com</a>.: No such file or directory<br>grep: <a href=3D"http://alt1.aspm=
x.l.google.com">alt1.aspmx.l.google.com</a>.: No such file or directory<br>=
grep: <a href=3D"http://alt4.aspmx.l.google.com">alt4.aspmx.l.google.com</a=
>.: No such file or directory<br>grep: <a href=3D"http://alt2.aspmx.l.googl=
e.com">alt2.aspmx.l.google.com</a>.: No such file or directory<br>grep: <a =
href=3D"http://alt3.aspmx.l.google.com">alt3.aspmx.l.google.com</a>.: No su=
ch file or directory<br></div><div><br></div><div>When in actual fact, all =
I need is the=C2=A0 printf command output. I tried to run the exact same sc=
ript on Debian 9, to ensure that was not the issue... Apparently that doesn=
&#39;t work either.=C2=A0</div><div><br></div><div>I ran an individual grep=
 command (no flags) on text file with the exact same contents.=C2=A0</div><=
div>It came back with positives, as you&#39;d expect... as every line had t=
he word google in there.=C2=A0</div><div><br></div><div>I tried to use the =
first script I wrote again, for the sake of a sanity check, and that script=
 is now broken too.=C2=A0</div><div><br></div><div>To reiterate:</div><div>=
<br></div><div>if grep -q &quot;thing_i&#39;m_looking_for&quot; $variable_i=
&#39;m_looking_in; then</div><div><br></div><div>doesn&#39;t work, on CentO=
S 7 or Debian 9.=C2=A0 I have tried putting the variable in single and doub=
le quotes, putting the thing I&#39;m looking for in single and double quote=
s, putting the if parameters inside square brackets, exporting the variable=
 to a text file and grepping from that and using the -s flag... Please can =
someone take a look and check that I&#39;m not insane and that this infact =
a bug and not my own problem.=C2=A0</div><div><br></div><div>GNU bash, vers=
ion 4.2.46(2)-release (x86_64-redhat-linux-gnu)<br></div><div><br></div><di=
v>Kind regards,</div><div>Lewis=C2=A0</div><div><br></div><div><br></div><d=
iv><br></div><div><br></div><div><br></div><div><br></div></div></div>

--000000000000d4204d058e482db2--




Acknowledgement sent to Lewis Farnworth <lewfar99@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-grep@HIDDEN. Full text available.
Report forwarded to bug-grep@HIDDEN:
bug#36764; Package grep. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 22 Jul 2019 22:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.