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