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.

3
  • 2
    @OliverWeiler: It will even work in Bourne shells such as Dash and the Heirloom Bourne Shell. Commented Jun 10, 2012 at 17:05
  • 19
    Not great if you need this in a function because you'll either need to 1) outdent the string all the way to the left of your file or 2) keep it indented to line up with the rest of your code but then it prints with the indents as well
    – s g
    Commented Oct 19, 2018 at 20:45
  • 4
    Works. Also note use ' (single quotes) instead of " (double quotes) if you don't want the interpretation of the string. If you want $something or something in the output instead of it getting replaced.
    – Eric
    Commented Nov 6, 2021 at 15:03