Skip to content

Instantly share code, notes, and snippets.

@keimei
Created December 31, 2011 18:31
Show Gist options
  • Save keimei/1544884 to your computer and use it in GitHub Desktop.
Save keimei/1544884 to your computer and use it in GitHub Desktop.
alternate background color
#!/usr/bin/gawk -f
#alternate background color like stripes.el(http://www.emacswiki.org/cgi-bin/wiki/stripes.el)
#usage: something command | stripes
BEGIN{
BG=44
#40 Black
#41 Red
#42 Green
#43 Yellow
#44 Blue
#45 Magenta
#46 Cyan
#47 White
}
NR%2==0{print "\033["BG"m"$0"\033[49m"}
NR%2==1{print}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment