GNU bug report logs -
#23590
25.0.94; Errors in default lgrep command
Previous Next
Reported by: Alex <agrambot <at> gmail.com>
Date: Sat, 21 May 2016 00:12:01 UTC
Severity: normal
Tags: fixed, patch
Found in version 25.0.94
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
> Shell commands that Emacs emits support /bin/sh and compatible
> shells. Zsh's default treatment of unmatched wildcards isn't.
>
> I don't know how it happened that lgrep invokes zsh on OP's system,
> but if that is due to user customizations, they should be corrected.
> If that is Emacs's fault (i.e. Emacs invokes zsh without any
> customizations), it should be fixed.
shell-file-name is set to zsh (as it's my default user shell) in emacs
-Q as well. This can be useful for commands like ansi-term. If an Emacs
program expects full sh compatibility, then perhaps there could be an
extra variable they can check before falling back to shell-file-name?
>> GNU Grep has an option (-d ACTION or --directories=ACTION) that can be
>> used to skip over directories (with "skip" as the ACTION), but it's not
>> in POSIX so I doubt we can use it in Emacs. If you know it will be
>> available on your system(s), you could add it to your `grep-template'
>> using the same technique as above.
>
> Yes, but I don't understand why the OP says these are errors. They
> aren't; they are just informative messages from Grep.
When I use lgrep I already know that I'm not going to be searching
directories. I find such messages to be useless clutter.
Additionally, while zsh doesn't error on this part (with the workarounds
that John provided), bash does appear to error because it is including
directories:
Grep exited abnormally with code 2 at ...
PS:
I noticed that between 25.0.94 and 25.0.95 the default command changes
slightly. It now includes a wildcard ..?* that bash doesn't seem to like
if there are no matching files:
grep: ..?*: No such file or directory
Grep exited abnormally with code 2 at ...
This bug report was last modified 4 years and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.