Skip to content

Instantly share code, notes, and snippets.

@larshb
Created January 9, 2019 13:49
Show Gist options
  • Save larshb/05054d4b63c9d0410da4142bffcc5fd2 to your computer and use it in GitHub Desktop.
Save larshb/05054d4b63c9d0410da4142bffcc5fd2 to your computer and use it in GitHub Desktop.
A shell script (using awk) to colorize output of svn status (st)
# Based on colorize (https://unix.stackexchange.com/a/318779)
awk '
function color(c,s) {
printf("\033[%dm%s\033[0m\n",30+c,s)
}
/?/ {color(1,$0);next}
/M/ {color(3,$0);next}
{print}
' $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment