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.

4
  • My original intent with the array was to allow the NUL character in a filename. From what I can tell, this approach does not allow them. Is that right? Commented Mar 9, 2015 at 21:18
  • 1
    File names cannot have null bytes in them. Bash strings also cannot contain nulls. Commented Mar 9, 2015 at 21:22
  • @AmadeusDrZaius This aproach does force read to use NUL byte as it's line delimiter. Since NUL is not a valid byte in unix filenames, this however is the safest place of feeding an array. See mywiki.wooledge.org/BashFAQ/020 for a better explanation. Commented Mar 9, 2015 at 21:25
  • 1
    Thanks for the confirmation. This answer made it sound as though NUL was allowed on Mac, but I guess it's just allowed by HFS+, but not by the OS. Commented Mar 9, 2015 at 21:27