bug-grep
[Top][All Lists]
Advanced

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

bug#56888: 'echo message | grep []' is affected by files in local direct


From: Carlo Arenas
Subject: bug#56888: 'echo message | grep []' is affected by files in local directory when using bracket
Date: Tue, 2 Aug 2022 08:56:21 -0700

This behaviour is expected and described in the manual (albeit it
might be a good candidate for a FAQ) :

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

Even before grep gets to see the expression, the shell would try to
match it and expand it as needed, which is obviously not what you want
for your usecase and why it would be better if you quote it.

  time echo "axyz" | grep '[abcd]xyz'

should behave as you expect, regardless of what the current directory has.

Carlo





reply via email to

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