My microblog Bourne shell script. I wrote it to automatically generate my tilde.center home page (~papa).
#!/bin/sh # soc - Stream Of Consciousness mini-logger # Copyright 2014 David Meyer <papa@sdf.org> +JMJ socdir=/home/papa/public_html/soc socext=soc outfile=/home/papa/public_html/index.html BASENAME=/usr/bin/basename CAT=/bin/cat DATE=/bin/date ECHO=echo FORTUNE=/usr/games/fortune LS=ls SORT=/usr/bin/sort date=$($DATE +%F) time=$($DATE +%R) $ECHO "<li>[$time] $*</li>" >>$socdir/$date.$socext $CAT >$outfile <<EOF <!DOCTYPE html> <html> <head> <title>~papa</title> <link rel="stylesheet" type="text/css" href="/screen.css"> </head> <body> <h1>~papa</h1> <p><em>What shall I do or write / Against the fall of night?</em> — A.E. Housman. "Smooth Between Sea and Land"</p> <p> <a href="soc.html">soc</a> <a href="about.html">About</a> <a href="contact.html">Contact</a> <a href="#fortune">↓Fortune</a> </p> <hr> EOF for f in $($LS -r $socdir/*.$socext); do bn=${f##*/} fd=${bn%.*} $ECHO "<h2>$fd</h2>" >>$outfile $ECHO "<ul>" >>$outfile $SORT -r $f >>$outfile $ECHO "</ul>" >>$outfile done $CAT >>$outfile <<EOF <hr> <pre id="fortune"> EOF $FORTUNE >>$outfile $CAT >>$outfile <<EOF </pre> <div id="sitelink" style="width=100%;text-align:center;"> <a href="/"><em>tilde.center</em></a> </div> </body> </html> EOF