Archive for February, 2007

Hellaciously long find line

Monday, February 26th, 2007

Find all the extensions used in the cvs repository:

# find all files, skipping the CVSROOT directory
find . -name CVSROOT -prune -false -or -type f | \
# extract the filename skipping everything before the last slash
sed 's/\(.*\)\/\(.*\)$/\2/' | \
# chuck the ,v suffix
sed 's/\(.*\),v$/\1/' \
# ignore files without a . (dot)
| grep "\." | \
# extract the bit past the .
sed 's/\(.*\)\.\(.*\)$/\2/' | \
# easy part: sort it and only show unique entries
sort | uniq