#!/bin/csh -f
if ( $#argv != 1) then
  echo "Usage Can-Fwd <game>"
  exit 1
endif
set game = $1
cd ~/$game
#ADDNEW

foreach x (`awk -F: '{printf ("%s ",$1)}' ~/$game/races:players`)
  set whom = `grep ^"${x}:" ~/$game/races:players | awk -F: '{print $2}'`
  echo $x |grep -s ^#  >/dev/null
  if ($status == 0) then
    (echo "These are the players to whom you ($x) can presently forward:";\
     echo ""; grep ^$x ~/$game/X-ref) | mail -s "$game Forwarding list" $whom
  endif
end

exit 0
