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