X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=searchindex.sh;h=66f2704e97472657c7b1c5e97f53fd34043e6e24;hb=7c77b7ea9dca882837840bfe9508801bafeae472;hp=af120f603f26db95b84f095cdadc17c0cec6df25;hpb=c549e1de0245f399b219be8a2bdf1ee7d6152951;p=shellwiki diff --git a/searchindex.sh b/searchindex.sh index af120f6..66f2704 100755 --- a/searchindex.sh +++ b/searchindex.sh @@ -1,5 +1,19 @@ #!/bin/sh +# Copyright 2023 Paul Hänsch +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + export _EXEC="${0%/*}/" _DATA="." verb="" v=0 cmd="" force="" location="" @@ -111,7 +125,7 @@ prune() { printf '%i %s %f %i %i\n' \ "$date" "$location" "$freq" "$num" "$total" elif [ "$verb" ]; then - printf "%${v}s\rRemoving \"%s\" from \"%s\"\n" "" "$location" "$word" >&2 + printf "\rRemoving \"%s\" from \"%s\"\n" "$location" "${word##*/}" >&2 fi done <"${word}.$$" >>"${word}" rm -- "${word}.$$" @@ -134,7 +148,7 @@ index() { -o -f "$_DATA/pages/$PATH_INFO/#page.md" \ -a ! -f "$_DATA/pages/$PATH_INFO/#index.flag" ] 2>&- then - [ "$verb" ] && printf "%${v}s\r%s\r" "$PATH_INFO" >&2 + [ "$verb" ] && printf "%${v}s\r%s\r" "" "$PATH_INFO" >&2 v="${#PATH_INFO}" "$_EXEC/parsers/40_indexer.sh" <"$_DATA/pages/$PATH_INFO/#page.md" >/dev/null fi