emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#56077: closed (Pattern Beginning With Dash Throws Error)


From: GNU bug Tracking System
Subject: bug#56077: closed (Pattern Beginning With Dash Throws Error)
Date: Sat, 18 Jun 2022 21:51:02 +0000

Your message dated Sat, 18 Jun 2022 16:49:58 -0500
with message-id <475a372e-2c87-703c-1b7e-99bdc566bc7f@cs.ucla.edu>
and subject line Re: bug#56077: Pattern Beginning With Dash Throws Error
has caused the debbugs.gnu.org bug report #56077,
regarding Pattern Beginning With Dash Throws Error
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
56077: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56077
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Pattern Beginning With Dash Throws Error Date: Sat, 18 Jun 2022 22:05:07 +0200 (CEST)
Hello,

I just encountered a problem where when the search pattern starts with a dash, grep interprets it as an argument parameter. It does not matter in what kind of quotes the pattern is wrapped. See examples below.

$ echo "- break -" | grep "- break -"
grep: invalid option -- ' '
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
$ echo "- break -" | grep '- break -'
grep: invalid option -- ' '
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
$ echo "- break -" | grep '^- break -'
- break -
$ echo "- break -" | grep "^- break -"
- break -
$ echo "- break -" | grep "-s break -"
grep: invalid option -- ' '
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.


grep Version: grep (GNU grep) 3.7


Sincerely,
Gazi

--- End Message ---
--- Begin Message --- Subject: Re: bug#56077: Pattern Beginning With Dash Throws Error Date: Sat, 18 Jun 2022 16:49:58 -0500 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1
On 6/18/22 15:05, gazip--- via Bug reports for GNU grep wrote:
I just encountered a problem where when the search pattern starts with a dash, 
grep interprets it as an argument parameter.


That's normal for grep. See question 3 of:

https://www.gnu.org/software/grep/manual/html_node/Usage.html



--- End Message ---

reply via email to

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