From 010a5bccd4279331f234bd25a661f1db2981e52e Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 16 Mar 2019 01:44:27 -0400 Subject: tools/shman.sh: Use tools/mtime.sh --- (limited to 'tools') 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 -- cgit v0.9.1