GNU bug report logs - #60038
grep 2.20 - invalid option with search pattern "-/"

Previous Next

Package: grep;

Reported by: Daniel Schättgen <daniel.schaettgen <at> abraxas.de>

Date: Tue, 13 Dec 2022 18:03:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

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 60038 in the body.
You can then email your comments to 60038 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#60038; Package grep. (Tue, 13 Dec 2022 18:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Schättgen <daniel.schaettgen <at> abraxas.de>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Tue, 13 Dec 2022 18:03:02 GMT) Full text and rfc822 format available.

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

From: Daniel Schättgen <daniel.schaettgen <at> abraxas.de>
To: "bug-grep <at> gnu.org" <bug-grep <at> gnu.org>
Subject: grep 2.20 - invalid option with search pattern "-/"
Date: Tue, 13 Dec 2022 09:50:44 +0000
[Message part 1 (text/plain, inline)]
Hello,

When searching for a pattern that includes "-/", the pattern is interpreted as option:

[dsg <at> db01]# grep "-" example.txt
--/--
[dsg <at> db01]# grep "/" example.txt
--/--
[dsg <at> db01]# grep "-/" example.txt
grep: invalid option -- '/'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
[dsg <at> db01]# grep --version
grep (GNU grep) 2.20
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

Kind regards
Daniel

abraxas Softwareentwicklungsgesellschaft mbH
Postfach 110101
D-66070 Saarbrücken

Altenkesselerstr. 17, Geb.C1
66115  Saarbrücken

Tel +49(0)681 976185-59
Daniel.Schaettgen <at> abraxas.de<mailto:Daniel.Schaettgen <at> abraxas.de>
HRB: 9540, Saarbrücken
GF:  Daniel Schaum & Andreas Heid
https://www.abraxas.de<https://www.abraxas.de/>
__________________________
Profidata Group<https://www.profidatagroup.com/>
Investment Management Solutions<https://www.profidatagroup.com/>

[Message part 2 (text/html, inline)]

Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Wed, 14 Dec 2022 05:46:01 GMT) Full text and rfc822 format available.

Notification sent to Daniel Schättgen <daniel.schaettgen <at> abraxas.de>:
bug acknowledged by developer. (Wed, 14 Dec 2022 05:46:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Daniel Schättgen <daniel.schaettgen <at> abraxas.de>
Cc: 60038-done <at> debbugs.gnu.org
Subject: Re: bug#60038: grep 2.20 - invalid option with search pattern "-/"
Date: Tue, 13 Dec 2022 21:45:21 -0800
tags 60038 notabug
thanks

On Tue, Dec 13, 2022 at 10:04 AM Daniel Schättgen
<daniel.schaettgen <at> abraxas.de> wrote:
> When searching for a pattern that includes "-/", the pattern is interpreted as option:
>
> [dsg <at> db01]# grep "-" example.txt
> --/--
> [dsg <at> db01]# grep "/" example.txt
> --/--
> [dsg <at> db01]# grep "-/" example.txt
> grep: invalid option -- '/'
> Usage: grep [OPTION]... PATTERN [FILE]...
> Try 'grep --help' for more information.
> [dsg <at> db01]# grep --version
> grep (GNU grep) 2.20

Thanks, but this is not a bug.
To search for a pattern that starts with "-", use grep's -e option, e.g.,

  grep -e -/ example.txt

Also, you're using grep-2.20, which is more than 8 years old.
The latest is grep-3.8.




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

This bug report was last modified 2 years and 161 days ago.

Previous Next


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