posted on: 2015-11-21 10:30:42
I have a directory full of files that I want to analyze, so I loop all of the files in a bash script, extract part of the name and pass it to a gnuplot script. The gnuplot script recombines the name, and alternate names for output files.

The first is the bash script:

#!/bin/bash

for f in *"-course.txt"
do
  echo ${f%%"-course.txt"}
  gnuplot -c course.plt ${f%%"-course.txt"}
done

This iterates over all of the files ending in -course.txt. It then strips the -course.txt as per this stack overflow answer.

The argument is passed and used in the gnuplot script as follows from this stack overflow answer.

cname=ARG1."-course.txt"
fraction = ARG1."-fraction.eps"

set term postscript color enhanced
set out fraction

plot cname u 1:($3/$5):($4/$5) w errorlines

set out

Voila, a directory full of eps files.

Comments

Name: