+
+trapret() {(
+ local retvals="$1"; shift
+ local cmd="$1"; shift
+ for retval in $(echo $retvals); do
+ local trap_$retval=1
+ done
+ "$cmd" "$@" || {
+ local retval="$?"
+ eval "trapped=\${trap_$retval}"
+ [ -n "$trapped" ] || {
+ return $retval
+ }
+ }
+)}
+
+md5s() {
+ cat "$@" | (
+ md5sum 2>/dev/null ||
+ md5
+ ) | awk '{print $1}'
+}