#!/usr/bin/env rc # # Query the magic 8-ball. Prints one of the standard twenty answers # on standard output. # # Usage: `8ball`. No arguments are accepted. answers=('As I see it, yes' \ 'It is certain' \ 'It is decidedly so' \ 'Most likely' \ 'Outlook good' \ 'Signs point to yes' \ 'Without a doubt' \ 'Yes' \ 'Yes - definitely' \ 'You may rely on it' \ 'Reply hazy, try again' \ 'Ask again later' \ 'Better not tell you now' \ 'Cannot predict now' \ 'Concentrate and ask again' \ 'Don''t count on it' \ 'My reply is no' \ 'My sources say no' \ 'Outlook not so good' \ 'Very doubtful' ) i=`{expr `{dd -if /dev/urandom -count 1 >[2] /dev/null | cksum | sed 's/ .*$//'} % $#answers} echo $answers($i)