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
  • That did not work for me. What shell are you using?
    – four43
    Commented Jun 11, 2019 at 22:55
  • Did not work in bash 4.4.19 in Ubuntu. It did not remove the spacing before line1 and line2
    – four43
    Commented Jun 12, 2019 at 20:22
  • 1
    @four43, You were right. Does not work to remove leading spaces. However, does remove leading tabs. So I corrected my answer from tabs and spaces, to tabs and not spaces. Sorry for the mistake. I checked the manual and it clearly just says tabs are removed. Thanks for bringing this to my attention. Commented Jun 13, 2019 at 23:03
  • It works with bash and zsh on MacOS 11.4. Great tip!
    – Philipp
    Commented Jun 6, 2021 at 22:03
  • ProTip: Use double quotes around your delimiter to escape things, like "xx". Commented May 3, 2022 at 21:16