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.

2
  • 1
    "command substitution ... drops trailing newlines" this part is correct, but the rest isn't. The \b helps keep the \n because then the newline isn't a trailing newline, it now has one more character after it. Commented Oct 21, 2019 at 5:22
  • 1
    why? for x in *.mp3 is better and shorter, and works with any valid filename. parrsing ls doesn't, no matter how you set IFS. Also, you don't need the echo -en"\n\b" trick, you can just use IFS=$'\n' - that still won't make parsing ls a good idea, but at least it's not a work-around for a self-made problem. Commented Oct 21, 2019 at 9:20