From 19d30a9fb1a4bddb2a23333398a4dba0e581f31b Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Fri, 23 Jun 2017 11:54:02 -0400 Subject: Swapped out 'echo' calls w/ 'printf ...' Continuation of pull request #217 re: printf usage. --- www/index.sh | 36 ++++++++++++++++++------------------ www/publish.sh | 8 ++++---- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'www') diff --git a/www/index.sh b/www/index.sh index c70c5a7a..938baca1 100755 --- a/www/index.sh +++ b/www/index.sh @@ -24,15 +24,15 @@ title() { } meta() { - URL=$(echo ${f%.md}.html | sed -e s-news/--) + URL=$(printf '%s\n' ${f%.md}.html | sed -e s-news/--) - echo "[$(title)]($URL){.title}" - echo "[$(sed -n 3p $f | sed -e s-^..--)]{.date}" - echo "" + printf '%s\n' "[$(title)]($URL){.title}" + printf '%s\n' "[$(sed -n 3p $f | sed -e s-^..--)]{.date}" + printf '\n' tail -n +5 $f | perl -p0e 's/(\.|\?|\!)( |\n)(.|\n)*/.../g' - echo "" - echo "" + printf '\n' + printf '\n' } # generate the index file @@ -50,12 +50,12 @@ done # generate an RSS index rss() { - echo '' - echo '' + printf '%s\n' '' + printf '%s\n' '' - echo "$BLOGTITLE" - echo ""$BLOGBASE"news/" - echo "$BLOGDESCRIPTION" + printf '%s\n' "$BLOGTITLE" + printf '%s\n' ""$BLOGBASE"news/" + printf '%s\n' "$BLOGDESCRIPTION" for f in $FILES do @@ -63,15 +63,15 @@ rss() { desc=$(sed ${f%.md}.bare.html -e 's//\>/g') url="${f%.md}.html" - echo '' - echo "$(title)" - echo "$BLOGBASE$url" - echo "$desc" - echo '' + printf '%s\n' '' + printf '%s\n' "$(title)" + printf '%s\n' "$BLOGBASE$url" + printf '%s\n' "$desc" + printf '%s\n' '' done - echo '' - echo '' + printf '%s\n' '' + printf '%s\n' '' } rss > news/feed.xml diff --git a/www/publish.sh b/www/publish.sh index e1ebe016..0be47a78 100755 --- a/www/publish.sh +++ b/www/publish.sh @@ -19,7 +19,7 @@ [ "x${DEBUG+set}" = 'xset' ] && set -v set -e -echo $1 +printf '%s\n' $1 FILE=${1%.md} cat $1 > temp.md @@ -46,7 +46,7 @@ else fi if [[ $FILE = *suppliers ]]; then - env printf '\n%s\n' "Edit this page -- Back to previous page" >> temp.md + printf '\n%s\n' "Edit this page -- Back to previous page" >> temp.md fi if [ "${FILE}" != "./docs/fdl-1.3" ] && [ "${FILE}" != "./conduct" ]; then @@ -62,10 +62,10 @@ sed temp.md -i -e 's/\.md\(#[a-z\-]*\)*)/.html\1)/g' sed temp.md -i -e 's/\.md\(#[a-z\-]*\)*]/.html\1]/g' # work around issue #2872 -TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc --toc-depth=2") || TOC="" +TOC=$(grep -q "^x-toc-enable: true$" temp.md && printf '%s\n' "--toc --toc-depth=2") || TOC="" # work around heterogenous pandoc versions -SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart") || SMART="" +SMART=$(pandoc -v | grep -q '2\.0' || printf '%s\n' "--smart") || SMART="" # chuck through pandoc pandoc $TOC $SMART temp.md -s --css /global.css $OPTS \ -- cgit v1.2.3-70-g09d2