#!/bin/bash # "makequiz": shell script to generate a multiple choice quiz in # Javascript for use on the Web. # We need as input a quiz description file, the name of # which is supplied to "makequiz" as a parameter. See the # sample file "myquiz.txt". We also need Bash 2.0 or higher # (use of arrays). if ! echo $BASH_VERSION | grep 2 >/dev/null ; then echo "Sorry, this script requires bash version 2.0 or higher." echo "You are using $BASH_VERSION." exit 1 fi if [ "$#" = "0" ] ; then echo "Please supply the name of a quiz description file." exit 1 fi if [ ! -r "$1" ] ; then echo "Sorry, could not read \"$1\"." exit 1 else . $1 fi echo "
" echo "