#!/usr/bin/perl # Usage: # epstogif [pnm-options] file.eps [gif-options] # will create file.gif in the current directory if ($#ARGV >= 1) { if ($#ARGV == 1) { system "epstopnm $ARGS[0]" ; $ARGV[0] =~ /([^\/]+)(.eps)?$/ ; $j = $1; system "ppmtogif " . $j . "001.ppm >" . $j . ".gif" ; system "rm " . $j . "0*.ppm" ; } else { for ($pos=0 ; $pos<=$#ARGV ; ++$pos) { $ARGV[$pos] =~ /([^\/]+).eps$/ ; $j = $1; last if $1 ; if ($pos == $#ARGV) { print "Usage: epstogif [pnm-options] file.eps [gif-options] \n" . " [will create file.gif in current dir]\n" ; exit(1); } } system "epstopnm " . join(" ",@ARGV[0..$pos]) ; system "ppmtogif " . join(" ",@ARGV[$pos+1..$#ARGV]) . " ". $j . "001.ppm >" . $j . ".gif" ; system "rm " . $j . "0*.ppm" ; } } else { print "Usage: epstogif [pnm-options] file.eps [gif-options] \n" . " [will create file.gif in current dir]\n" ; }