http://www.geoiptool.com/en/?IP=
I need some help to write a bash script that will allow me to pass any given IP to this URL. The site above is URL I’d like to my script to call. Can someone get me started? Thanks!
I’d like to use my script like this: echo IP_ADDRESS | geoiptool
When I echo an IP and pipe it to my script, I get this error below. Is that because
the pipe command is not installed?
-bash-3.2$ echo 173.192.108.135 | geo
-bash: echo: write error: Broken pipe
I’d recommend using a command line parameter instead of reading from stdin. You can use $1 to refer to the first parameter, $2 for the second, etc.
Then you just fire it by: