#!/bin/bash for i in "$@"; do printf '%s ' "$i" geoiplookup "$i" | grep 'GeoIP City Edition, Rev 1:' | sed 's#GeoIP City Edition, Rev 1: ##' done