Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One way:

    wget -Ufoo -qO- 'http://www.google.com/search?q=ip' |
    sed -n '/.*Your public IP address is [^0-9]*\([0-9.]*\).*/{s//\1/p;q;}'


Google really doesn't it like it when you script their search. Better to use one of the many, many services designed for this purpose. Or set one up yourself in roughly one line of code.


True, but the OP asked explicitly for it and no one else seemed to answer that question.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: