I'm using GNU Emacs 26.3 on a Windows 10 system (Virtualbox guest on Mac).
The following grep command inside emacs fails:
grep -i -n -d skip -e temp_ * with this error:
grep -i -n -d skip -e temp_ * NUL agrep: NUL: No such file or directory Grep exited abnormally with code 2 at Mon Mar 23 12:27:03 If I run the command in the wsl shell it works.
The following grep command inside emacs also works fine:
grep -i -n -d skip -e temp * Note: the missing _ at the end.
I tried escaping the underscore with \ and \\, nothing helped.
Any ideas? Thanks a lot.
Edit: FYI: I'm using the following shell command, which works fine for other grep, make, etc. commands:
(setq explicit-shell-file-name "C:/Windows/System32/bash.exe") (setq shell-file-name explicit-shell-file-name) as for Tobias request: I run the 'grep command via my shortcut F5:
(global-set-key [f5] 'grep) then:
Run grep (like this): grep -i -n -d skip -e temp_ *
emacs -Q.explicit-shell-file-namehas nothing to do withgrep. What is the value ofshell-file-namethat is really used?explicit-shell-file-nameandshell-file-namerestart Emacs and try again. I assume that/bin/shis used in that case. If you want bash syntax you could setexplicit-shell-file-nameto/bin/bash.