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*

16
  • Have you got a specific use case in mind? It would help to understand the specific problem you're trying to solve Commented Jun 9 at 17:18
  • This is a question regarding the discussion in the link. If the argumentation is that one should not rely on the GNU -print0 as stated, what is the procedure on other systems? Commented Jun 9 at 17:24
  • 1
    The suggestions to "use find in combination with sh" offered in at least two answers provide a general solution, which is why I'm asking if you have a specific use case Commented Jun 9 at 17:38
  • 2
    For the record, -print0 is now standard as of the 2024 edition of the POSIX standard. There are not that many find implementations left that don't support it. Even Solaris' does. In any case, you can always replace it with -exec printf '%s\0' {} +. What is less commonly available is portable ways to process that output. In any case, you don't need xargs, as find can execute commands directly. Commented Jun 9 at 18:11
  • 1
    @Filangieri "not reliable" suggests that it can fail. The issue is that it isn't portable, that it isn't available for every find implementation, not that it is not reliable. It is perfectly reliable when it is available. Commented Jun 10 at 12:00