Last active
December 30, 2019 15:32
-
-
Save kkdd/f849b0a4ae3a6ae5a4cd559da10d6916 to your computer and use it in GitHub Desktop.
sed 出力をカラー表示 ref: https://qiita.com/kkdd/items/c0247c35fce5c31fb27f
This file contains hidden or 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
$ echo -e "11pp22\n33qq" | while read line; do esc=$(printf '\033'); echo $line | gsed -e "s,\([0-9]\+\)\([a-z]\+\)\([0-9]\+\)$,\1${esc}[32m\2${esc}[0m\3,"; done | |
11pp22 | |
33qq |
This file contains hidden or 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
$ echo -e "111a222\n333" | GREP_COLOR='01;32' grep -E --color '^|\d+a' | |
111a222 | |
333 | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment