#!/usr/local/bin/gawk -f BEGIN { RS="<" ; ORS="<" ; FS="\"" ; OFS="\"" ; MOON="moon" } /country\// { a=$1 ; b=$2 ; c=$3 ; "grep Country: /home/www/monitor/hyper/" b "|cut -d: -f2 | cut -d'<' -f1 | sed -e 's/^ //'| sed -e 's/ $//'| sed -e 's/ /+/g' | sed -e 's/-/+/g' " | getline ; MOON=$0 ; print ( a "\"http:/cgi-bin/country-query?country=" MOON "\"" c ) ; next } #/country\// { print "Dollar One: " $1 " Dollar two: " $2 " Dollar Three: " $3 } { print }