kjv

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 1da71999acb814148cbef35739fc26ffe0738f3b
parent ed4b2a81c3195719d086161617e5fcbacdb763dc
Author: Tim Cooper <tim.cooper@layeh.com>
Date:   Tue,  7 Aug 2018 16:26:45 -0300

pack data into tar archive rather than base64 encoded blocks

Diffstat:
MMakefile | 9++-------
Mkjv.sh | 6+++---
2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile @@ -3,13 +3,8 @@ kjv: kjv.sh kjv.awk kjv.tsv echo 'exit 0' >> $@ - echo '##SCRIPT##' >> $@ - gzip kjv.awk -c | base64 >> $@ - echo '##/SCRIPT##' >> $@ - - echo '##BIBLE##' >> $@ - tail -n +2 kjv.tsv | gzip -c | base64 >> $@ - echo '##/BIBLE##' >> $@ + echo '#EOF' >> $@ + tar cz kjv.awk kjv.tsv >> $@ chmod +x $@ diff --git a/kjv.sh b/kjv.sh @@ -5,7 +5,7 @@ SELF="$0" get_data() { - sed -n "/^##$1##$/,/^##\\/$1##$/p" < "$SELF" | tail -n +2 | head -n -1 | base64 -d | gunzip -c + sed '1,/^#EOF$/d' < "$SELF" | tar xz -O "$1" } if [ -z "$PAGER" ]; then @@ -28,7 +28,7 @@ while [ $# -gt 0 ]; do break elif [ "$1" = "-l" ]; then # List all book names with their abbreviations - get_data BIBLE | awk -v cmd=list -e "$(get_data SCRIPT)" + get_data kjv.tsv | awk -v cmd=list -e "$(get_data kjv.awk)" exit elif [ "$1" = "-h" ] || [ "$isFlag" -eq 1 ]; then exec >&2 @@ -69,5 +69,5 @@ startIdx=$# fi ref="$1" shift - get_data BIBLE | awk -v cmd=ref -v ref="$ref" -e "$(get_data SCRIPT)" + get_data kjv.tsv | awk -v cmd=ref -v ref="$ref" -e "$(get_data kjv.awk)" done ) | ${PAGER}