#!/bin/bash plot() { gnuplot < 10000) for (i = 1; i <= n; i += int(n/10000)) print i,array[i,1],array[i,2]; else for (i = 1; i <= n; i++) print i,array[i,1],array[i,2]; } ' $file > $name; plot $name; rm $name; done