You are probably used to type “what is my ip” in Google to know this, but how can you do that in a shell script? Here it is:

$ curl ifconfig.co

Simple!