#!/bin/bash

read num
num=`echo $num|sed 's/^[^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1/'`

cnt=1
echo "Content-Type: text/html"
echo ""
echo ""
echo "<html>"
echo "<head>"
echo "<title>20 Grep question picker</title>"
echo "</head>";  echo  "<body>"
echo "<p>"
echo "<p>"
echo "Name : ____________________________"
echo "<p>"
for choice in `./shuffle20.ruby $num`
do
   question=`sed -n "${choice}p" greplist`
   echo "$question<p>"
   echo " "
   cnt=`expr $cnt + 1`
done
echo "</body>"
echo "</html>"
