I'm try to write a small bash command to put in ~/.bashrc on a server to identify reagion and city location from the IP address. I am using a program called "ip2locationio" and the command for this is:
which outputs like this:
The output I want is:
so I'm piping the output through awk like this:
but for some reason I can't glean I'm getting:
How do I eliminate that first line?
Code:
ip2locationio -f region_name,city_name -o pretty
Code:
region_name,city_name "New Jersey","Jersey City"
Code:
New Jersey, Jersey City
Code:
ip2locationio -f region_name,city_name -o pretty | awk -F'"' '{print $2,",", $4}'
but for some reason I can't glean I'm getting:
Code:
, New Jersey , Jersey City
How do I eliminate that first line?
Comment