Skip to content

Instantly share code, notes, and snippets.

@ejpcmac
Created September 6, 2024 14:52
Show Gist options
  • Save ejpcmac/c0fd660c5f4b02a1f5088077fd5e9421 to your computer and use it in GitHub Desktop.
Save ejpcmac/c0fd660c5f4b02a1f5088077fd5e9421 to your computer and use it in GitHub Desktop.
Filtering out ANSI colors
some-command-that-output-colors | tee >(sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | sed -r 's/\r//g' > log.txt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment