Created
January 25, 2013 14:29
-
-
Save wagnerpinheiro/4634837 to your computer and use it in GitHub Desktop.
Finding unique CSS colors with grep and 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 | |
#Finding unique CSS colors with grep and perl | |
#Just a tiny one-liner I’ve found useful to get unique CSS color values in a style sheet: | |
#source: http://www.itopen.it/2012/02/14/finding-unique-css-values-with-grep-and-perl/ | |
#------------------ | |
egrep -r '#[a-fA-F0-9]{3,6}+(\s|;)' *.css|perl -ne 'if (m/(#[a-fA-F0-9]{3,6}+)(\s|;)/){print "$1\n";}'|sort|uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment