diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-06-23 11:54:02 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-06-23 13:18:45 -0400 |
commit | 19d30a9fb1a4bddb2a23333398a4dba0e581f31b (patch) | |
tree | 1375cbc21d14ad220bd98228a7925166461dfa4a | |
parent | 363455950f9c351b0a87a31fb5641a635bd352a7 (diff) | |
download | librebootfr-19d30a9fb1a4bddb2a23333398a4dba0e581f31b.tar.gz librebootfr-19d30a9fb1a4bddb2a23333398a4dba0e581f31b.zip |
Swapped out 'echo' calls w/ 'printf ...'
Continuation of pull request #217 re: printf usage.
-rwxr-xr-x | www/index.sh | 36 | ||||
-rwxr-xr-x | www/publish.sh | 8 |
2 files changed, 22 insertions, 22 deletions
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 '<rss version="2.0">' - echo '<channel>' + printf '%s\n' '<rss version="2.0">' + printf '%s\n' '<channel>' - echo "<title>$BLOGTITLE</title>" - echo "<link>"$BLOGBASE"news/</link>" - echo "<description>$BLOGDESCRIPTION</description>" + printf '%s\n' "<title>$BLOGTITLE</title>" + printf '%s\n' "<link>"$BLOGBASE"news/</link>" + printf '%s\n' "<description>$BLOGDESCRIPTION</description>" for f in $FILES do @@ -63,15 +63,15 @@ rss() { desc=$(sed ${f%.md}.bare.html -e 's/</\</g' | sed -e 's/>/\>/g') url="${f%.md}.html" - echo '<item>' - echo "<title>$(title)</title>" - echo "<link>$BLOGBASE$url</link>" - echo "<description>$desc</description>" - echo '</item>' + printf '%s\n' '<item>' + printf '%s\n' "<title>$(title)</title>" + printf '%s\n' "<link>$BLOGBASE$url</link>" + printf '%s\n' "<description>$desc</description>" + printf '%s\n' '</item>' done - echo '</channel>' - echo '</rss>' + printf '%s\n' '</channel>' + printf '%s\n' '</rss>' } 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' "<strong><a href=\"/git.html#editing-the-website-and-documentation-wiki-style\">Edit this page</a></strong> -- <a href=\"../\">Back to previous page</a>" >> temp.md + printf '\n%s\n' "<strong><a href=\"/git.html#editing-the-website-and-documentation-wiki-style\">Edit this page</a></strong> -- <a href=\"../\">Back to previous page</a>" >> 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 \ |