#!/bin/zsh # Copyright muflax , 2012 # License: GNU GPL 3 setopt RE_MATCH_PCRE echo "compressing 'out'..." for f in out/**/*(.); do if [[ $f =~ "\.(html|css|xml|js)$" ]]; then gzip --best -f -v -c "$f" > "$f.gz" fi done