-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: child/parent operators #141
Comments
This is an interesting idea, and the kind of thing that's come up before (e..g #92), where you want to match directories or not based on their contents. There are a couple tricks that currently work:
This kinda reminds me of the $ bfs -not -has \( -maxdepth 1 -name CACHEDIR.TAG \) via a recursive Footnotes
|
That's precisely what I'm doing now; however, it doesn't allow to
Yes,
Nice! Yes, this is exactly what I was proposing. Thanks for the hint, I might try actually doing this because the lengths I have to go to to work around lack of this feature are not really pleasant.
If that's too complex, perhaps the second, more limited form of this proposal (one that basically lets you do a $ bfs -not -has CACHEDIR.TAG \( -type f \) |
I think a nicer middle-ground might be
which would behave semantically like
Btw for correct |
It would be an interesting addition to the GNU find syntax to have some sort of possibility to evaluate parts of the find expression in context of a child/parent file.
If that's too confusing, a few examples in pseudo-find syntax with the proposed extension:
Exclude all directories containing a
CACHEDIR.TAG
file:Find all directories that look like a Borg repository:
If this syntax is infeasible to implement efficiently due to requirement to perform nested iterations in general case, I can imagine another variant of this syntax:
In this case, the
-child
operator has two operands: (1) a string representing a specific child file name to examine, and (2) a subexpression that is evaluated at most one time against the specific file named by the first operand (or not at all if there is no such file).The text was updated successfully, but these errors were encountered: