I'm trying to process a file which has many IP Addresses, the thing is that I want to geolocalizate those IPs with google maps, I did it with its corresponding longitude and latitude, however, I have a problem when create the Google Maps URL, the $13 variable has a comma (,) at the end. How can I delete that last character?
for i in $(awk '{ print ($NF)}' '/var/web/cgi-bin/auth.txt'); do
htmlString+=$(geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat "$i" | awk '{
print "<a target=\"_blank\" href=\"https://www.google.com/maps/search/?api=1&query=" $12 $13 "\"> '$i' </a><br>"}')
done
I want this: https://www.google.com/maps/search/?api=1&query=58.698017,-152.522067
but I got this: https://www.google.com/maps/search/?api=1&query=58.698017,-152.522067,