How is shelling out to the system shell and running other programs programming in find? Basically this is just using find as a task launcher to launch some shell code, sometimes leaving artifacts behind to help the next iteration along.
As the page explains, the code conditionally creates subdirectories as it executes. find therefore provides control flow. In essence, the filesystem’s recursive structure is being exploited to create recursion in the program.
The external programs are gadgets that implement I/O or arithmetic or whatever; the logic and control flow that glue those gadgets together is in the find expression. That’s how it’s programming in find. If you pushed all of the logic down into the sh -c then it would stop being programming in find.
How is shelling out to the system shell and running other programs programming in find? Basically this is just using
find
as a task launcher to launch some shell code, sometimes leaving artifacts behind to help the next iteration along.As the page explains, the code conditionally creates subdirectories as it executes.
find
therefore provides control flow. In essence, the filesystem’s recursive structure is being exploited to create recursion in the program.The external programs are gadgets that implement I/O or arithmetic or whatever; the logic and control flow that glue those gadgets together is in the find expression. That’s how it’s programming in find. If you pushed all of the logic down into the
sh -c
then it would stop being programming in find.That’s fair. There is more flow control in the find expressions than I first gave it credit for.
This is so much fun! I love creative silly hacks like this!
Posted it here because I remembered your find fork and thought you’d like it :)