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*

4
  • 2
    I don't think Awk can reliably be expected to cope correctly with null bytes either, though. Commented Apr 23, 2022 at 7:22
  • I think I understand what you are trying to say, @tripleee, but I want to be sure. Are you saying that a filename containing a null character will cause problems when passed to awk -F'\0'? That would absolutely be the case, and I'm not sure how to deal with it. Commented May 17, 2022 at 0:17
  • However, with more reflection, a filename can't have a null character, cf. stackoverflow.com/questions/54205087/… . Could you further explain what you mean, @tripleee ? If this answer doesn't work for certain nontrivial filenames, I don't want to keep it here. Commented May 17, 2022 at 0:42
  • The -print0 specifically adds a null byte between file names as the only separator which absolutely cannot be part of the filename itself. Some Awk versions can deal with that, but others can't. For more background, perhaps see also mywiki.wooledge.org/BashFAQ/020 Commented May 17, 2022 at 5:25