GNU bug report logs - #54174
(MacOS Monterey 12.2.1: zsh): grep "string" * is interpreted as grep -V when directory has a filename "-Vfilename.ext"

Previous Next

Package: grep;

Reported by: Marja Koivunen <marja <at> innomore.com>

Date: Sat, 26 Feb 2022 22:33:02 UTC

Severity: normal

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Marja Koivunen <marja <at> innomore.com>
To: 54174 <at> debbugs.gnu.org
Subject: bug#54174: (MacOS Monterey 12.2.1: zsh): grep "string" * is interpreted as grep -V when directory has a filename  "-Vfilename.ext"
Date: Sat, 26 Feb 2022 13:33:35 -0500
I had a directory with filenames that started with “-“

doing grep on that directory for a “string" did not find anything
although “string was on some of the files”

grep just kept repeating something … FreeBSD

Finally, (with some help) I understood that grep interpreted “-Vfiename” as an option -V and 
gave the version info instead of doing grep “string” *

Maybe there is a way to add space after “-V “ and possibly also other options that could be used as  part of a filename in some operating systems?



This bug report was last modified 3 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.