#!/bin/sh mapid="" truncate -s 0 map.txt curl http://faux.uwcs.co.uk/progcomp20110127/ | while read line do if [[ $line == "EOF" ]] then output=no fi if [[ $output == "yes" ]] then echo $line >> map.txt fi if [[ $line == "
" ]] then output=yes fi if [[ `echo $line|grep Problem` != "" ]] then mapid=`echo "$line"|sed -e "s/.*value=\"\([^\"]*\).*/\1/"` echo $mapid output=`java Faux` curl http://faux.uwcs.co.uk/progcomp20110127/?a=$output\&n=james\&p=$mapid fi done