#!/usr/bin/tcsh
# Set j to a list of the filenames in ~/.quotes
set j=`ls ~/.quotes`
# This uses the PID of this process as a "random enough" number, which
# is wrapped around the possible filenames. This idea came from a
# script Gordon Chan wrote to play a random sound on login.
@ a = $$ % ${#j} + 1
# Get that quote!
cat ~/.quotes/${j[$a]}
# Add the fixed part.
cat ~/.fixedsig
The .quotes directory contains (surprise) the quotes, one per file.