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
  • 1
    As mentioned in my answer, it doesn't split at any whitespace, it splits on characters of $IFS. By default, in bash, $IFS contains space, tab and newline which are some (of many) whitespace characters. And $(...) in list context in bash is subject to globbing which should also be disabled here with set -o noglob. Commented Aug 4 at 18:59
  • The fact that it splits on other whitespace characters is irrelevant here. The file contains spaces, and they're the problem. Setting IFS to just newline solves that. Commented Aug 4 at 19:19
  • But I've reworded to just say that it will also split on the spaces. Commented Aug 4 at 19:21
  • this worked for me. appreciate your help, thank you so much! Commented Aug 5 at 2:00