You have numerous problems out there. The first in the following line:
coord= ${a[1]} ${a[2]}
- Never put spaces around
=
. - Quote variables if those contain spaces.
Replace the following lines:
name=$line
a=( $name )
coord= ${a[1]} ${a[2]}
outcoord= $("echo $coord | cs2cs +init=esri:102067 +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56 +to +init=epsg:4326")
echo $outcoord
with
outcoord=$(echo "${line[@]}" | cs2cs +init=esri:102067 +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56 +to +init=epsg:4326)
echo "$outcoord"
and it should be good.
If you want only last two elements of the array, you could say:
outcoord=$(echo "${line[1]} ${line[2]}" | cs2cs +init=esri:102067 +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56 +to +init=epsg:4326)
And, instead of:
while read -r line
say
while read -a line
which would assign the line read to an array line
.