Fix md2point title and filename generation. - pointtools - Simple point utilities to hold text presentations. HTML git clone git://bitreich.org/pointtools/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/pointtools/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 59ccbc5ce8a8a064b6f022c9c74f54b8ffdc5a76 DIR parent c9cabf113958e40665b11a0fed6c61fecc1bb3d4 HTML Author: Christoph Lohmann <20h@r-36.net> Date: Sun, 22 Jul 2018 18:00:39 +0200 Fix md2point title and filename generation. Diffstat: M bin/md2point | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- DIR diff --git a/bin/md2point b/bin/md2point @@ -1,10 +1,11 @@ #!/bin/sh -# -# See LICENSE for license details. -# + +# colors +reset="$(tput sgr0)" +quoteformat="$(tput setaf 6)" mkfilename() { - printf "%.4d-%s" "$1" "$2" | tr '# :.' '_' + printf "%.4d-%s" "$1" "$2" | tr '# :.()/' '_' printf ".txt" } @@ -30,11 +31,11 @@ do fname="$(mkfilename "$snum" "$title")" snum=$((snum + 1)) printf "\n %s\n %s\n\n" \ - "$title" "$(mkunderline $titlelen "=")" > $fname + "$title" "$(mkunderline $titlelen "=")" >> $fname ;; *) [ -n "$fname" ] && \ - printf " %s\n" "$line" \ + printf " %s\n" "$line" \ | sed 's,\t, ,' \ | sed 's,\*,o,' >> $fname ;;