#!/bin/bash for FILE in "$@" do gnuplot <<- EOF set term png set output "${FILE}.png" plot "${FILE}" using 1 EOF done