GNU bug report logs -
#34126
grep v. 3.1 – unexpected error message "grep: i.: No such file or directory"
Previous Next
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.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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
[Message part 2 (message/rfc822, inline)]
[Message part 3 (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)]
[Message part 5 (message/rfc822, inline)]
[Message part 6 (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 7 (text/html, inline)]
This bug report was last modified 6 years and 118 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.