1. 18

  2. 7

    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.

    1. 7

      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.

      1. 4

        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.

        1. 1

          That’s fair. There is more flow control in the find expressions than I first gave it credit for.

      2. 4

        This is so much fun! I love creative silly hacks like this!

        1. 3

          Posted it here because I remembered your find fork and thought you’d like it :)