1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh root_dir=$(readlink -f ${1}) mailboxes=$(find "${1}" -name "cur" | xargs dirname | sed "s@$root_dir/@+@g" | grep "${2:-.*}" | sort) echo ${mailboxes}