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.

5
  • The question was to take a variable and remove newlines. Commented Sep 24, 2013 at 20:08
  • POSIX-compliant shells don't have arrays. The positional parameters array-like structure is as close as you'll get. Commented Sep 24, 2013 at 20:22
  • See edit, and consider reading the rest of the question too. Commented Sep 24, 2013 at 20:27
  • In place of printf, substitute your program of choice. The "$@" is the key bit here. I don't think I have anything to add or remove from this answer.' Commented Sep 24, 2013 at 23:51
  • It doesn't even include the variable I need to read from. It's completely irrelevant. Commented Sep 25, 2013 at 14:25