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.

Required fields*

3
  • 1
    if I'm reading this correctly, it will strip leading whitespace from every line (above and beyond removing one-line comments). Commented May 22, 2019 at 15:35
  • Thanks for your help but unfortunately when I put in this command this is what I get $ sed -r "s/^\s+//g" test.c|sed '/^\/\*.*\*\/$/d' sed: illegal option -- r usage: sed script [-Ealn] [-i extension] [file ...] sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...] Commented May 23, 2019 at 11:43
  • -r is only available for GNU sed. Most sed flavors (including GNU) understand -E for extended regular expressions instead. Anyhow, this code will modify c indention. Commented May 23, 2019 at 19:32