#!/bin/sh SEARCH_STR="${1}" SEARCH_DIR="${2:-${HOME}/mail}" if [ -z "${SEARCH_STR}" ]; then printf "ERROR: search string required\n" >&2 exit 1 fi for name in `find ${SEARCH_DIR} -type f`; do if ~/bin/maybe-gzcat "${name}" | grep "${SEARCH_STR}"; then echo "*** ^^ ${name} ***" fi done