#!/bin/csh

if ($#argv < 1) then
  echo "This program extracts useful informations from PS files"
  echo "generated by xd3d or xgraphic"
  echo "Usage : $0:t <name(s) of Postscript files (can be gzipped)>"
  exit
endif

foreach i ($*)
  if ($#argv != 1) then
    echo "-----------" $i "-----------"
  endif
  if ($i:r.gz == $i) then
    zcat $i | head -1000 > /tmp/bidonbidon$$
    grep Creator /tmp/bidonbidon$$
    grep Date    /tmp/bidonbidon$$
    grep For     /tmp/bidonbidon$$
    grep "%>"    /tmp/bidonbidon$$
    /bin/rm -f /tmp/bidonbidon$$
  else
    head $i | grep Creator
    head $i | grep Date
    head $i | grep For
    head -1000 $i | grep "%>"
  endif
end
