Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Created July 25, 2022 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderofsalvation/75e7d6af9e5c674e80b97f7a876d512f to your computer and use it in GitHub Desktop.
Save coderofsalvation/75e7d6af9e5c674e80b97f7a876d512f to your computer and use it in GitHub Desktop.
highlight color part in string awk bash
echo "0 astroids are hitting your house" | awk '( $1 > 0 ) { $1 = "\033[31m" $1 "\033[0m" } 1'
echo "10 astroids are hitting your house" | awk '( $1 > 0 ) { $1 = "\033[31m" $1 "\033[0m" } 1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment