#! /usr/bin/mawk -f
BEGIN { 

ID    =    "dclpscat 0.3"
DATE  =                               "95/03/19(numaguti)" 

EX    =    "concat dcl.ps file"

USAGE =  "% dclpscat <file>..."

#----------------------------------------------------------------------------
# NO OPTION

	  if (ARGV[1]=="help") { 
	      exithelp=1
	      print "  " ID,DATE
	      print " --- " EX
	      print " usage : " USAGE
              exit
          }
          exithelp=0

          head=1; body=0; page=0 

}

/^%%Page:/ 	 { body=1; head=0; page++; 
                   print "%%Page:", page, page; next }
/showpage/       { body=0; print; next }

	         { if ( head==1 || body == 1) print }

END		 { if(exithelp==0) { 
                     print "%%Trailer"
	             print "%%Pages:", page
	             print "%%EOF"   
                   }
                 }


