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 /www/index.sh | |
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.
Diffstat (limited to 'www/index.sh')
-rwxr-xr-x | www/index.sh | 36 |
1 files changed, 18 insertions, 18 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 |