bug#56888: 'echo message | grep []' is affected by files in local directory when using bracket

2022-08-02 Thread H3rm1t
Hi: I use grep to search string in a message like this. > [root@office tmp]# echo "axyz" | grep [abcd]xyz > axyz > [root@office tmp]# echo "cxyz" | grep [abcd]xyz > cxyz > [root@office tmp]# echo "bxyz" | grep [abcd]xyz > bxyz > [root@office tmp]# echo "dxyz" | grep [abcd]xyz > dxyz > [root@off

bug#56888: 'echo message | grep []' is affected by files in local directory when using bracket

2022-08-02 Thread Carlo Arenas
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