#! /bin/bash
#
g++ -c -g -Wall track_bar.cpp
if [ $? -ne 0 ]; then
  echo "Compile error."
  exit
fi
#
g++ track_bar.o -lm
if [ $? -ne 0 ]; then
  echo "Load error."
  exit
fi
rm track_bar.o
#
mv a.out track_bar
./track_bar > track_bar.txt
if [ $? -ne 0 ]; then
  echo "Run error."
  exit
fi
rm track_bar
#
#  Call gnuplot.
#
gnuplot < track_commands.txt
#
echo "Normal end of execution."
