towgs=`gawk 'BEGIN {
	years = 2;
	
	xd = -0.0761 + years*0.0110;
	yd = -0.0101 + years*-0.0045;
	zd = 0.0444  + years*-0.0174;
	
	xr = (0.008765 + years*0.001034);
        yr = (0.009361 + years*0.000671);
        zr = (0.009325 + years*0.001039);
	
	cs = 0.007935 + years*-0.000538;

    printf "+towgs84=%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f",
            xd,yd,zd, xr, yr, zr, cs;

}'`


echo towgs parameters:
echo $towgs
echo

# simple Lat/ Lon from ITFR2000 to GDA94 at 2002
# result should be 133d53'7.8478" 23d40'12.4461" 603.350"

echo Computed and Correct results:			

cs2cs +from -w4  +proj=latlong +datum=WGS84 +to +towgs84=$towgs +proj=latlong <<EOF
133d53'7.8574"E  23d40'12.4314"S 603.287
EOF

#show correct result
echo 133d53\'7.8478\"E    23d40\'12.4461\"S 603.350

echo ""
echo Converting geocentric coordinates
echo computed and correct result

cs2cs -f "%.3lf" +from  -w4 +proj=geocent +datum=WGS84 +to +towgs84=$towgs  +proj=geocent <<EOF
-4052052.048 4212836.105 -2545105.587
EOF

echo -4052051.765    4212836.205 -2545106.027