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
  • Using a second variable name resolves the problem. It's weird that you can't do this in bash. But why do I get the same problem with just the line ${input//\n/,} without any assignment? Commented May 27, 2015 at 18:54
  • 2
    Because at that point, you're trying to execute the variable's value, not echo it. You have to have an echo command in front of the variable if you're not assigning it (the modified value) to another variable. Commented May 27, 2015 at 18:56