#!/bin/bash -e linefiles=() codas=() #echo "42nd Krestar, Sourcer Representative" #exit 0 function opt { linefiles=("${linefiles[@]}" "$1") codas=("${codas[@]}" "$2") } opt "ouma.lines" " (http://o-umajirushi.xavid.us/)" #opt "afterlife.lines" " (Afterlife, Oct. 24–56. Quoting \"The Hardest Thing To Prove\", We're About Nine)" # opt "paprika.lines" "" # opt "hogwarts.lines" "" # opt "hitherby.lines" " (Hitherby Dragons, ???. Quoting http://imago.hitherby.com/)" # opt "hagakure.lines" " (from @i(Hagakure))" # opt "dead.lines" " (The NPCs are Dead, X-Games, ~5/18. Quoting R&GaD.)" # opt "basho.lines" " (Bashō)" # opt "persona.lines" " (Persona: Too Late, Intercon P (and Spring 2016?))" # opt "jung.lines" " (Contact, IAP2013. Quoting Carl Jung.)" ## lisa.lines #opt "forest.lines" " (Wishing Well, Gallery 263. Quoting Patricia C. Wrede.)" opt "celeste.lines" " (The Final Voyage of the Mary Celeste (Remix), weekend of 10/7)" coin="$(cat ~/.zsigs/coin)" if [ "$coin" -ge "${#linefiles[@]}" ] ; then coin=0 fi lines="${linefiles[$coin]}" coda="${codas[$coin]}" echo "$((coin + 1))" > ~/.zsigs/coin if [ ! -e ~/.zsigs/$lines.point ] ; then echo 0 > ~/.zsigs/$lines.point fi #fortune ~/.zsigs l=$(($(cat ~/.zsigs/$lines.point) + 1)) if [ $l -gt $(wc -l ~/.zsigs/$lines | awk '{print $1}') ] ; then l=1 fi sig="$(head -n $l ~/.zsigs/$lines | tail -n 1)" #ll=$(($(cat ~/.zsigs/lisapoint) + 1)) #if [ $ll -gt $(wc -l ~/.zsigs/lisa.lines | awk '{print $1}') ] ; then # ll=1 #fi #lsig="$(head -n $ll ~/.zsigs/lisa.lines | tail -n 1)" #echo "Lisa Turpin$lsig (\"@<$sig$coda>\")" echo "@<$sig$coda>" echo $l > ~/.zsigs/$lines.point #echo $ll > ~/.zsigs/lisapoint