#!/usr/bin/perl # version 1.1, April 15, 1999 # (un)comments some feature of .eps files produced by conplot use Getopt::Long; while ($ARGV[0]=~m/\.eps$/){ $temp=shift @ARGV; push @thefiles,$temp; } @alta=@ARGV; $numfiles=@thefiles; $start='%uncomment to NOT'; for $alt (@alta){ $alt=~s/\s+//; $end=$alt; $end=~s/no//; for $infile (@thefiles){ open (INFILE,"<$infile") || die ("cannot open $infile for reading"); @all=; close INFILE; open (OUTFILE,">$infile") || die ("cannot open $infile for writing"); while ($line=shift(@all)) { if ($line=~m/$start.*$end\s+$/){ $line=~s/^%// if $alt=~m/^no/; $line=~s/^/%/ unless ($alt=~m/^no/ || $line=~m/^%/); print OUTFILE $line; print "modified $infile with $alt\n"; $didit=1; last; } print OUTFILE $line; } print "could not find $alt to alter...\n" unless $didit; print OUTFILE @all; close OUTFILE; } close OUTFILE; } $infile= @thefiles[-1]; system ("gv $infile") if $numfiles < 2;