--invert-match works only on lines and not with filenames. is that supposed behaviour? #1795
Answered
by
BurntSushi
saifali-ch
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
BurntSushi
Feb 5, 2021
Replies: 1 comment 1 reply
-
There isn't enough info here to precisely answer. Assuming that This is why the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
saifali-ch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There isn't enough info here to precisely answer. Assuming that
Shortcuts.txt
has at least one line that containsbelow
, then the output is correct.--invert-match
inverts matching in a line oriented way. That is, a matching line is any line that doesn't match the pattern. Thus, any file that contains any line that doesn't match the pattern is considered a matching file by--files-with-matches
.This is why the
--files-without-match
flag exists. It is likely what you want here.