Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 16
    I think this is sort of like "Never parse ls output!" - you can certainly do either one on a one off basis, but they're more of a quick hack than production quality. Or, more generally, definitely never be dogmatic. Commented Nov 7, 2016 at 18:41
  • 22
    More generally: Why does my shell script choke on whitespace or other special characters? Commented Nov 7, 2016 at 22:44
  • 10
    Because the point of find is to loop over what it finds. Commented Nov 8, 2016 at 9:24
  • 4
    One ancillary point -- you may want to send the output to a file, and then process it later in the script. This way the file list is available for review if you need to debug the script. Commented Nov 11, 2016 at 17:58
  • Note, that the output of find needn't be filenames (see -print variants), so the reasoning is slightly too general. :) Commented Mar 5, 2020 at 15:52