GNU bug report logs - #34126
grep v. 3.1 – unexpected error message "grep: i.: No such file or directory"

Previous Next

Package: grep;

Reported by: Ricky Tigg <ricky.tigg <at> gmail.com>

Date: Fri, 18 Jan 2019 20:28:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34126 in the body.
You can then email your comments to 34126 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#34126; Package grep. (Fri, 18 Jan 2019 20:28:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ricky Tigg <ricky.tigg <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Fri, 18 Jan 2019 20:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ricky Tigg <ricky.tigg <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: grep v. 3.1 – unexpected error message "grep: i.: No such file or directory"
Date: Fri, 18 Jan 2019 21:27:02 +0100
[Message part 1 (text/plain, inline)]
OS: *Fedora*; Component: grep.x86_64  3.1-8.fc29

Commands executed:

$ dnf list|grep -Ei langpack | grep fi.
glibc-langpack-fi.x86_64            2.28-26.fc29         @updates
langpacks-fi.noarch                 1.0-13.fc29          @System
(...)

$ dnf list|grep -Ei langpack | grep fi. | grep "-fi."
grep: i.: No such file or directory

Using grep twice in the same command, the command's last grep is expected
to produce targets, not an STDERR. Probably an issue.
[Message part 2 (text/html, inline)]

Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Fri, 18 Jan 2019 20:38:01 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Fri, 18 Jan 2019 20:38:02 GMT) Full text and rfc822 format available.

Notification sent to Ricky Tigg <ricky.tigg <at> gmail.com>:
bug acknowledged by developer. (Fri, 18 Jan 2019 20:38:02 GMT) Full text and rfc822 format available.

Message #12 received at 34126-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Ricky Tigg <ricky.tigg <at> gmail.com>, 34126-done <at> debbugs.gnu.org
Subject: Re: bug#34126: grep v. 3.1 – unexpected error message "grep: i.: No such file or directory"
Date: Fri, 18 Jan 2019 14:37:30 -0600
[Message part 1 (text/plain, inline)]
tag 34126 notabug
thanks

On 1/18/19 2:27 PM, Ricky Tigg wrote:
> OS: *Fedora*; Component: grep.x86_64  3.1-8.fc29
> 
> Commands executed:
> 
> $ dnf list|grep -Ei langpack | grep fi.
> glibc-langpack-fi.x86_64            2.28-26.fc29         @updates
> langpacks-fi.noarch                 1.0-13.fc29          @System
> (...)
> 
> $ dnf list|grep -Ei langpack | grep fi. | grep "-fi."
> grep: i.: No such file or directory
> 
> Using grep twice in the same command, the command's last grep is expected
> to produce targets, not an STDERR. Probably an issue.

Not an issue in grep, but in your attempt to use a pattern beginning
with - in a way that grep cannot distinguish from options.  That is, you
asked grep to use the -f option, which takes an argument, so it used
"i." as the argument for -f, and failed because there is no file named
'i.' in your current directory.  (That's true whether you write -fi. or
"-fi.", because the shell strips quoting before grep sees its argv[]).

You want to use either of these formulations instead:

grep -e -fi.
grep -- -fi.

where the "-e" option says to treat the next argv[] entry as a pattern,
even if it otherwise would look like an option, and then continue
finding further options; while the "--" argument says that no more
options are present, and that all further command line arguments are
treated according to their traditional positional usage).  The
difference becomes apparent in constructs like:

grep -e -fi. -i     # greps stdin case-insensitively for "-fi."
grep -- -fi. -i     # greps file ./-i case-sensitively for "-fi."

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#34126; Package grep. (Mon, 21 Jan 2019 14:05:02 GMT) Full text and rfc822 format available.

Message #15 received at 34126 <at> debbugs.gnu.org (full text, mbox):

From: Ricky Tigg <ricky.tigg <at> gmail.com>
To: 34126 <at> debbugs.gnu.org
Subject: Re: bug#34126: closed (Re: bug#34126: grep v. 3.1 – unexpected error message "grep: i.: No such file or directory")
Date: Mon, 21 Jan 2019 15:04:20 +0100
[Message part 1 (text/plain, inline)]
Hi. I can't be without thanking you – *Eric Blake* –, both for the
relevance of your detailed explanation and the useful descriptions. Regards.

pe 18. tammik. 2019 klo 21.38 GNU bug Tracking System (help-debbugs <at> gnu.org)
kirjoitti:

> Your bug report
>
> #34126: grep v. 3.1 – unexpected error message "grep: i.: No such file or
> directory"
>
> which was filed against the grep package, has been closed.
>
> The explanation is attached below, along with your original report.
> If you require more details, please reply to 34126 <at> debbugs.gnu.org.
>
> --
> 34126: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34126
> GNU Bug Tracking System
> Contact help-debbugs <at> gnu.org with problems
>
>
>
> ---------- Forwarded message ----------
> From: Eric Blake <eblake <at> redhat.com>
> To: Ricky Tigg <ricky.tigg <at> gmail.com>, 34126-done <at> debbugs.gnu.org
> Cc:
> Bcc:
> Date: Fri, 18 Jan 2019 14:37:30 -0600
> Subject: Re: bug#34126: grep v. 3.1 – unexpected error message "grep: i.:
> No such file or directory"
> tag 34126 notabug
> thanks
>
> On 1/18/19 2:27 PM, Ricky Tigg wrote:
> > OS: *Fedora*; Component: grep.x86_64  3.1-8.fc29
> >
> > Commands executed:
> >
> > $ dnf list|grep -Ei langpack | grep fi.
> > glibc-langpack-fi.x86_64            2.28-26.fc29         @updates
> > langpacks-fi.noarch                 1.0-13.fc29          @System
> > (...)
> >
> > $ dnf list|grep -Ei langpack | grep fi. | grep "-fi."
> > grep: i.: No such file or directory
> >
> > Using grep twice in the same command, the command's last grep is expected
> > to produce targets, not an STDERR. Probably an issue.
>
> Not an issue in grep, but in your attempt to use a pattern beginning
> with - in a way that grep cannot distinguish from options.  That is, you
> asked grep to use the -f option, which takes an argument, so it used
> "i." as the argument for -f, and failed because there is no file named
> 'i.' in your current directory.  (That's true whether you write -fi. or
> "-fi.", because the shell strips quoting before grep sees its argv[]).
>
> You want to use either of these formulations instead:
>
> grep -e -fi.
> grep -- -fi.
>
> where the "-e" option says to treat the next argv[] entry as a pattern,
> even if it otherwise would look like an option, and then continue
> finding further options; while the "--" argument says that no more
> options are present, and that all further command line arguments are
> treated according to their traditional positional usage).  The
> difference becomes apparent in constructs like:
>
> grep -e -fi. -i     # greps stdin case-insensitively for "-fi."
> grep -- -fi. -i     # greps file ./-i case-sensitively for "-fi."
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3226
> Virtualization:  qemu.org | libvirt.org
>
>
>
>
> ---------- Forwarded message ----------
> From: Ricky Tigg <ricky.tigg <at> gmail.com>
> To: bug-grep <at> gnu.org
> Cc:
> Bcc:
> Date: Fri, 18 Jan 2019 21:27:02 +0100
> Subject: grep v. 3.1 – unexpected error message "grep: i.: No such file or
> directory"
> OS: *Fedora*; Component: grep.x86_64  3.1-8.fc29
>
> Commands executed:
>
> $ dnf list|grep -Ei langpack | grep fi.
> glibc-langpack-fi.x86_64            2.28-26.fc29         @updates
> langpacks-fi.noarch                 1.0-13.fc29          @System
> (...)
>
> $ dnf list|grep -Ei langpack | grep fi. | grep "-fi."
> grep: i.: No such file or directory
>
> Using grep twice in the same command, the command's last grep is expected
> to produce targets, not an STDERR. Probably an issue.
>
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 19 Feb 2019 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 39 days ago.

Previous Next


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