#!/bin/sh months="jan feb mar apr may jun jul aug sep oct nov dec" _t=/tmp/_.iiiiiiiiinnnnnnnnnnndddecczzz _ti=/tmp/_.rrrrrrrrrreeeeeesssssss ext=rm gen () { rm -Rf $_t $_ti touch $_t touch $_ti /bin/ls -1 *.${ext} > $_t for y in 2001 2003 2004 2005 2006; do for m in ${months}; do grep ${y} $_t | grep ${m} | sort >> $_ti done done cat ${_ti} | while read FILE; do du -h ${FILE} | awk '{ print $2 "\t" $1}' done rm -rf $_ti rm -rf $_t } ext=rm gen; ext=mp3 gen