bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60038: grep 2.20 - invalid option with search pattern "-/"


From: Jim Meyering
Subject: 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@abraxas.de> wrote:
> When searching for a pattern that includes "-/", the pattern is interpreted 
> as option:
>
> [dsg@db01]# grep "-" example.txt
> --/--
> [dsg@db01]# grep "/" example.txt
> --/--
> [dsg@db01]# grep "-/" example.txt
> grep: invalid option -- '/'
> Usage: grep [OPTION]... PATTERN [FILE]...
> Try 'grep --help' for more information.
> [dsg@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]