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