You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing a weird issue when using grep (ucrt64): command line arguments containing wildcards seem to be automatically expanded by grep itself. This does not happen with the msys2 version.
For example, I wanted to grep double-stars in a specific file, /usr/bin/grep works as expected:
$ /usr/bin/grep --fixed-string -- '**' some_file.txt
This line contains **
--> here ** gets expanded with the list of files in the current directory ($HOME in my case), then the 1st file of the list (would be .bashrc here) is used as search pattern and grepped in other files!!
This issue reports a similar problem, it points to a feature --enable-wildcard activated in mingw-w64-crt-git that seems to be the rootcause.
I've a few questions about this:
what is the advantage of enabling the wildcard in MINGW packages? in particular, which concrete usecase does it solves?
shouldn't the wildcard expansion be done by the calling shells, instead of the application themselves?
isn't that risky to make core programs behave differently on Windows vs Linux?
has this an impact on POSIX compliance?
and more importantly, is there a way to disable this without recompiling mingw packages? e.g. with an environment variable, like msys2 controls the paths conversion?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'm facing a weird issue when using
grep
(ucrt64): command line arguments containing wildcards seem to be automatically expanded by grep itself. This does not happen with the msys2 version.For example, I wanted to grep double-stars in a specific file,
/usr/bin/grep
works as expected:but when using
/ucrt64/bin/grep
, I get instead:--> here
**
gets expanded with the list of files in the current directory ($HOME in my case), then the 1st file of the list (would be.bashrc
here) is used as search pattern and grepped in other files!!This issue reports a similar problem, it points to a feature
--enable-wildcard
activated in mingw-w64-crt-git that seems to be the rootcause.I've a few questions about this:
Beta Was this translation helpful? Give feedback.
All reactions