"David Tang" <22*7*2*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> Hi Chris,> I'm having trouble implementing 'haversine.awk' in bash.
> From the forums I've read, this syntax should work? > echo | awk -v lat1=$1 -v lon1=$2 -v lat2=-31.97156055555560 -v lon2=115.902151666667 -f > haversine.awk
No quite; it's a shellscript (executed by bash) that immediately (and only) calls awk.
make it executable, and then run:
./haversine.awk -31.8 116.0 -31.9 115.9
As provided, it reads the lats+lons from command-line arguments, but you may wish to modify the
script for them to be read from standard input.