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
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