#!/usr/athena/bin/perl use strict; my $gpstr; my $fname = shift or die "No filename specified: $!"; my $gptype = shift; if ($gptype eq undef) { $gptype = "points pointtype 1 pointsize 1" ; } my $str = `which bash`; chomp ($str); $str = "#!" . $str ."\n\n"; $gpstr = " set terminal pbm small color set output '/tmp/$fname.pbm' set nokey set nolabel set size 1.25, 1.030056 set size ratio 0.618033 plot '$fname' with $gptype quit "; $gpstr =~ s/\n/\\n/g; $str = $str . " attach gnuplot attach consult echo -e \"$gpstr\" | gnuplot - convert '/tmp/$fname.pbm' '$fname.png' rm -f '/tmp/$fname.pbm' "; open (MSCRIPT, '>', "tempbashscript") or die "Can't open tempbashscript: $!"; print (MSCRIPT $str) or die "Can't write to tempbashscript: $!"; close (MSCRIPT) or die "Can't close tempbashscript: $!"; chmod (0755, "tempbashscript"); system ("./tempbashscript"); unlink ("tempbashscript"); exit;