fn=/path/to/quotes.txt
cnt=$(wc -l $fn)
lns=${cnt:6:2}
if [ "$lns" = 0 ]; then
rnd=1
else
let "lns += 1"
rnd=$(expr $RANDOM % $lns)
let "rnd += 1"
fi
sed -n ${rnd}p $fn
Set the fn variable in the first line to the path and name of your quotes file. Each quote should be on its own line, with no extra lines between the quotes.
[robg adds: This worked for me -- note that this will not replace Terminal's welcome message (Welcome to Darwin!) with the quote -- it shows up after the welcome message. If you want to change the welcome message, you need to edit /etc/motd. Replacing the welcome message with a random quotation is left as an exercise for the reader (i.e. I don't have a clue...), but this hint might get you started.]

