3 .
/usr
/lib
/tool
/bash-utils ||
exit -1
5 opt_maildir
=~
/Mail
/new
/
14 optname
=opt_
${optname//-/_}
15 if [ "${!optname+x}" != x
]
17 warnx
"option is not known: $1"
22 eval "$optname=\$optval"
31 elif [[ $1 =~ ^
--([a-zA-Z0-9_-
]+)=(.
*)$
]]
33 opt_parser_set_opt
"${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" ||
exit -1
34 elif [[ $1 =~ ^
--([a-zA-Z0-9_-
]+)$
]]
37 opt_parser_set_opt
"${BASH_REMATCH[1]}" "$1" ||
exit -1
38 elif [[ $1 =~ ^
-([a-zA-Z0-9_-
]+)$
]]
40 flags
=${BASH_REMATCH[1]}
41 for (( i
=0; i
<${#flags}; i
++ ))
43 opt_parser_set_opt
"${flags:$i:1}" 1 ||
exit -1
51 find "$opt_maildir" -maxdepth 1 -type f \
52 ${opt_newer:+-newermt "$opt_newer"} ${opt_older:+! -newermt "$opt_older"} \
53 ${opt_newer_rel:+-newermt "now - $opt_newer_rel"} ${opt_older_rel:+! -newermt "now - $opt_older_rel"} |\
54 foreach stat
-c "%y %n" |
sort |\
55 foreach
-t -p $
'\n''${FIELD[1]}'$
'\n''${FIELD[0]}'$
'\n' \
56 pipecmd
cat {1} -- pipecmd mail-extract-raw-headers
-n From Delivered-To To Cc Subject
-- mime-header-decode