#!/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>CSCI 330 Assn03 Command Sequences</title>"
echo "</head>";  echo  "<body>"
echo "<p>"
echo "<p>"
for choice in `./rrand.ruby $num`
do
   question=`sed -n "${choice}p" cmdsall`
   echo "echo '$question'<br>"
   echo "$question<p>"
   echo " "
   cnt=`expr $cnt + 1`
done
echo "</body>"
echo "</html>"
