I have a program that would output something like this:
^[0;33m"2015-02-09 11:42:36 +0700 114.125.x.x access"^[0m
Is there built in linux program that could clean that output up into something like this
"2015-02-09 11:42:36 +0700 114.125.x.x access"
Best Answer
Those are ANSI control sequences. There are no programs built-in that remove those codes, at least that I am aware of. A simple
sed
script, however, will the job for you:Using the above with your sample input:
OSX or other BSD system
With OSX (BSD)
sed
, commands cannot be chained together with semicolons. Try, instead: