#! /pkg/gnu/bin/gawk -f # looks through the file "data" for regexp matches # also logs all queries BEGIN { print "Content-type: text/html\n" q = ENVIRON["QUERY_STRING"] sub(/.*=/, "", q) gsub(/+/, " ", q) gsub(/%28/, "(", q) gsub(/%29/, ")", q) gsub(/%7C/, "|", q) #print "
"
  #print "/"q"/"
  #exit

  com = "egrep '" q "' data"
  print com
  print "
" print "
"
  system(com)

  system("date >> cgilog")
  print ENVIRON["REMOTE_ADDR"] >> "cgilog"
  print q >> "cgilog"

}