diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-16 01:44:27 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-16 01:46:19 (EDT) |
commit | 010a5bccd4279331f234bd25a661f1db2981e52e (patch) | |
tree | 2dd0749769bff22ed2f6d384c15d4f4df2bcdf05 | |
parent | ca09e590ef48e2f30e7f5387e88b7904fa455be9 (diff) |
tools/shman.sh: Use tools/mtime.sh
-rwxr-xr-x | tools/shman.sh | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/tools/shman.sh b/tools/shman.sh index f9c993e..6d5c5db 100755 --- a/tools/shman.sh +++ b/tools/shman.sh @@ -33,39 +33,6 @@ warn() printf "shman: Warning: ${fmt}\n" "${@}" >&2 } -get_mtime() -{ - local file="${1}" - shift 1 - local m= - local d= - local y= - local now_m= - local now_y= - - read m d y <<-EOF - $(LC_ALL=POSIX ls -l "${file}" | cut -d ' ' -f 6-8) - EOF - case "${m}" in - 'Jan') m=1;; 'Feb') m=2;; 'Mar') m=3;; 'Apr') m=4;; - 'May') m=5;; 'Jun') m=6;; 'Jul') m=7;; 'Aug') m=8;; - 'Sep') m=9;; 'Oct') m=10;; 'Nov') m=11;; 'Dec') m=12;; - esac - case "${y}" in *':'*) - read now_m now_y <<-EOF - $(date '+%m %Y') - EOF - now_m="${now_m#0}" - if [ ${now_m} -ge ${m} ]; then - y=${now_y} - else - y=$((${now_y} - 1)) - fi - esac - - printf '%d-%02d-%02d' ${y} ${m} ${d} -} - gen_doc_func() { local sym="${1}" @@ -229,7 +196,7 @@ parse_docs() local got_doc=false local is_func=false - date="$(get_mtime "${file}")" + date="$("$(dirname "${0}")/mtime.sh" "${file}")" while IFS='' read -r line; do case "${line}" in |