#h STDOUT paths from STDIN that pass ARGV test #h #h find . | $0 -d #h #h #h For details about supported tests man test. #h #h #h test while read f ; do echo "[[ $@ '$f' ]] && echo $f || true" done | bash