====== perlのスクリプト ======
* perlのことをよく知らないので汚いと思います.
===== ディレクトリ内のepsをjpgに変換 =====
epsをjpgに変換しておくと,nautilusやビューワでサムネイルが見れる.
(epsを見れるビューワがあればいいんだけど)
:-) 普通にnautilusでepsファイルのサムネイルを見れました...
#!/usr/bin/perl
$dir = './';
opendir DH, $dir or die "$dir:$!";
while ($file = readdir DH) {
if( $file =~ m/\.eps$/ ){
@array = split(/\./,$file);
$value = $array[0].".jpg";
print $file,$value;
system "convert $file $value";
}
}
closedir DH;
===== 数値計算で得られた連番ファイルを可視化 =====
#!/usr/bin/perl
$gpfile .= sprintf("%s\n","set terminal gif");
$gpfile .= sprintf("%s\n","set pm3d map");
for($i=1;$i < 30;$i++){
$file = sprintf("hoge%04d",$i*10);
$gpfile .= sprintf("%s\n","set output \"$file.gif\"");
$gpfile .= sprintf("%s\n","splot \"$file.dat\" using 1:2:5");
};
open (GP, "| gnuplot" ) or die "no gnuplot";
print GP "$gpfile";
close GP;
system("gifsicle --delay 50 hoge*gif > anime.gif");
gifsicle はgifアニメを作成するツール.アニメを見るにはgifview.
gifview -a anim.gif