Created
September 26, 2021 16:48
-
-
Save lisa/55599f844c82ca8512c893927604ef07 to your computer and use it in GitHub Desktop.
Strip ANSI with Perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# An implementation of https://superuser.com/questions/380772/removing-ansi-color-codes-from-text-stream/380778 | |
# usage: ./stripansi.sh "src" "dest" | |
cat "${1}" | perl -pe 's/\x1b\[[0-9;]*[mG]//g' > "${2}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment