#!/bin/bash
xMin=-2.0
xMax=2.0
NumProc=8
ProcessorStep=$( echo "scale=16; ($xMax - $xMin) / $NumProc;" | bc -q 2>/dev/null )
xMax=$( echo "scale=3; $xMax + 0.001 ;" | bc -q 2>/dev/null ) ### ReImStEp=0.001 ; EndRanges in Mandelbrot-SeveralLines.sh are exclusive
#
! [ -x "Mandelbrot-SeveralLines.sh" ] && echo "Cheating me huh?? Mandelbrot-SeveralLines.sh is not available or executable ..." && exit 3
! [ -x "Mandelbrot-OnePoint.exe" ] && echo "Cheating me huh?? The base program is not available or executable ..." && exit 5
#
for n in `seq 1 $(( $NumProc - 1 ))` ; do
    EndRange="$( printf "%4.1f" "`echo "scale=16; $xMin + $ProcessorStep ;" | bc -q 2>/dev/null`" )"
    Mandelbrot-SeveralLines.sh $xMin $EndRange  > ${n}.dat &
    xMin=$EndRange
done
Mandelbrot-SeveralLines.sh $xMin $xMax > ${NumProc}.dat &
#
exit 0
#
#### Mandelbrot-SeveralLines.sh -2.0 -1.5 > 1.dat &
#### Mandelbrot-SeveralLines.sh -1.5 -1.0 > 2.dat &
#### Mandelbrot-SeveralLines.sh -1.0 -0.5 > 3.dat &
#### Mandelbrot-SeveralLines.sh -0.5 0.0 > 4.dat &
#### Mandelbrot-SeveralLines.sh 0.0 0.5 > 5.dat &
#### Mandelbrot-SeveralLines.sh 0.5 1.0 > 6.dat &
#### Mandelbrot-SeveralLines.sh 1.0 1.5 > 7.dat &
#### Mandelbrot-SeveralLines.sh 1.5 2.001 > 8.dat &

