#!/bin/sh # I haven't seen yet how random this really is. LINES=`cat $1|wc -l` SEED=`date +%s` # Use this for any-time randomness. #FUNC=`date +%m%S` # Use this for once-a-day randomness. FUNC=`date +%w%d%W` # debug #echo $SEED $FUNC $LINES RANDLINE=`expr $SEED % $FUNC % $LINES` head -$RANDLINE $1 |tail -1