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*

7
  • 2
    Or set a new delimiter with mapfile -d? Commented Dec 3, 2019 at 15:46
  • Huh! I didn't know about that one. Can you point to documentation concerning this, none of the article I found mentioned it. Commented Dec 3, 2019 at 15:51
  • You'll get a newline in the last position of the array though... Maybe better to read it from tr ' ' '\n' or something? Commented Dec 3, 2019 at 15:53
  • Thanks AdminBee, That does work though every thing I have read about mapfile led me to believe it would adhere to the IFS settings. Commented Dec 3, 2019 at 16:07
  • 1
    It seems the -d option was introduced in bash version 4.4 Commented Dec 3, 2019 at 17:27