Did a bit of improving on the original:
# This script creates a random password using sha1sum
while [ $MASTONE != $MASTTWO ] ; do
echo "Enter the master password"
read -s MASTONE
echo "Retype the master password"
read -s MASTTWO
if [ $MASTONE != $MASTTWO ] ; then
echo "Password entries don't match, try again" 1>&2
echo "Enter the reason"
read -s REASON
echo "Enter desired number of characters"
read -s DESNUM
echo "Your random password is:"
echo $MASTONE $REASON | sha1sum | cut -c1-$DESNUM