for file in wer srr do tail -n 50 "${file}.txt" > temp.txt gnuplot <<- EOF set term png set output "${file}.png" plot temp.txt with lines notitle EOF done