Here is an example, using IP provider service IPEcho.net
Code:
wget -qO- http://ipecho.net/plain ;echo
The code in action:
Code:
[root@devopsrun1 ~]# wget -qO- http://ipecho.net/plain ; echo
198.1.1.30
Notes:
In this example, the IP address has been changed for security reasons.
We are adding an echo command to add a newline character at the end of the line, otherwise your bash prompt will appear on the same line where ip address gets printed.