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*

8
  • Is sed not easy or elegant? Commented Oct 26, 2014 at 4:51
  • Maybe there is a command line utility that automagically removes the control chars? Commented Oct 26, 2014 at 4:52
  • There is [:cntrl:] pattern and indeed sed 's/[[:cntrl:]]//g' file1 > file2 is first what comes to my mind. You can use also tr, awk, pure bash... but hard to judge which tool is more easy or elegant. Commented Oct 26, 2014 at 4:59
  • 1
    Oh, from your update I see, that the problem is not with control characters but with characters which are interpreted as control by shell as \e[0m (colors), although I'm not sure if ^M is control or literal in you log. Commented Oct 26, 2014 at 5:02
  • ^M is control char in the log. I tried your sed, it does remove the control chars but not the other bits like [60G[[0;32m Commented Oct 26, 2014 at 5:11