@Aalis: here's your script. i hoped to adapt the one by Luc, which is awesome in how concise it is. however, i ended up not being able to use much of it so made my own again. Luc, feel free to make your adaptations! 
#!/bin/bash
# a script for outputting a small portion of the Tao Te Ching.
# this script starts from a random full stop, then prints the following
# sentence(s) until reaching a full stop.
tao="tao_te_ching.txt"
# you can chose between /dev/random which is slow but provides ``more random''
# numbers than the faster /dev/urandom
dev_rand=/dev/urandom
#dev_rand=/dev/random
startline_num=0
lines=($(cat tao_te_ching.txt | grep -n -s "\." | sed 's/:.*//'))
# shuffle function based on Knufth-Fisher-Yayes shuffle algorithm
# http://mywiki.wooledge.org/BashFAQ/026 thank you!
# takes an array as input through 'shuffle ARRAY[@]', outputs arr[@]
shuffle() {
local i tmp size max rand
arr=("${!1}") # retrieve array from $1
# $RANDOM % (i+1) is biased because of the limited range of $RANDOM
# Compensate by using a range which is a multiple of the array size.
size=${#arr[*]}
max=$(( 32768 / size * size ))
for ((i=size-1; i>0; i--)); do
while (( (rand=$RANDOM) >= max )); do :; done
rand=$(( rand % (i+1) ))
tmp=${arr[i]} arr[i]=${arr[rand]} arr[rand]=$tmp
done
}
# if we have no arguments we pick a random verse
if [ $# -eq 0 ]; then
shuffle lines[@] && startline_num=${arr[1]}
else
# we got the wrong number of arguments
echo "Stop giving arguments. They will make you stray from the path." >&2
exit 1
fi
startline_num=$(($startline_num+1))
startline="$(sed -n "$startline_num"'p' $tao)"
while [[ ${startline:0:1} == "" ]] || [[ ${startline:0:1} == "-" ]]; do
startline_num=$(($startline_num+1))
startline=$(sed -n "$startline_num"'p' $tao)
done
stopline_num=$startline_num
stopline="$startline"
stopline_length=$((${#stopline}-1))
while [[ ${stopline:$stopline_length:1} != "." ]]; do
stopline_num=$(($stopline_num+1))
stopline="$(sed -n "$stopline_num"'p' $tao)"
stopline_length=$((${#stopline}-1))
done
sed -n "$startline_num,$stopline_num"'p' $tao
how it works is explained in the comments at the start of the script.
it gives pretty okay results:
[21:44:31]$ taoshort
He never expects results;
thus he is never disappointed.
[21:44:33]$ taoshort
You can use it any way you want.
[21:44:38]$ taoshort
When they know that they don't know,
people can find their own way.
[21:44:40]$ taoshort
Content with an ordinary life,
you can show all people the way
back to their own true nature.
the ones which are clearly broken up remind me of Brian Eno and Peter Schmidt's awesome 'Oblique Strategies' set of texts, so i suppose that is okay too 
edit: here's the twmn-script: http://crunchbanglinux.org/forums/post/186179/#p186179
now all i got left to do is have that script pop-up at random times, to surprise myself with weird texts. 
Last edited by rhowaldt (2012-02-03 21:21:24)