untested md5 handler

This commit is contained in:
Thomas Levine 2016-04-06 23:58:26 +00:00
parent 42c09b775b
commit 27592e58ac
1 changed files with 17 additions and 1 deletions

18
urchin
View File

@ -98,13 +98,29 @@ urchin_exit() {
exit "$@"
}
urchin_md5_quiet() {
md5 -q
}
urchin_md5sum_quiet() {
md5sum | cut -d\ -f1
}
if which md5 > /dev/null; then
md5=urchin_md5_quiet
elif which md5sum > /dev/null; then
md5=urchin_mdsum_quiet
else
echo Could not find md5sum command >&2
urchin_exit 1
fi
stdout_file() {
the_test="${1}"
the_shell="${2}"
x="${urchin_tmp}/stdout$(fullpath "$the_test")"
mkdir -p "${x}"
echo "${x}/$(echo "${the_shell}" | md5sum | cut -d\ -f1)"
echo "${x}/$(echo "${the_shell}" | $md5)"
}
# Expand relative paths