-
-
Save tejastank/bae87fd2951782910af36b0bfb7f3fac to your computer and use it in GitHub Desktop.
zipcode lookup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# zipcode--Given a ZIP code, identifies the city and state. Use city-data.com, | |
# which has every ZIP code configured as its own web page. | |
baseURL="http://www.city-data.com/zips" | |
/bin/echo -n "ZIP code $1 is in " | |
curl -s -dump "$baseURL/$1.html" | \ | |
grep -i '<title>' | \ | |
cut -d\( -f2 | cut -d\) -f1 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment