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
#!/bin/bash | |
#get hex codes in form #fff and #ffffff | |
#checks to see if not - especially needed on #fff matches | |
#FIXME: - currently prints trailing character | |
if [[ ! -a $1 ]]; then | |
echo File not found | |
exit 1 | |
fi | |
sed ':a;N;$!ba;s/\n/ /g' "$1" | grep -o '\#[0-9a-fA-F]\{3\}[^0-9a-fA-F]' | sed 's/[^0-9a-fA-F#]//g' | sort -u |