Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Scripts to create an IP info summary display' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Scripts to create an IP info summary display
Authored by: knouse on Sep 02, '06 12:50:13PM
the public IP address area prints the complete HTML returned instead of just the IP address

The sed command needs the -E option

get_public ()
{
        curl -s http://checkip.dyndns.org | sed -E 's/.*: ([^<]*)<.*/\1/'
}


[ Reply to This | # ]
Scripts to create an IP info summary display
Authored by: knouse on Sep 02, '06 01:40:41PM

And the replacement string must be escaped \1 instead of 1



[ Reply to This | # ]
Scripts to create an IP info summary display
Authored by: ScottTFrazer on Sep 06, '06 06:09:33AM

I get an error when I try to use -E with sed, changing it to -e doesn't really seem to work either.

Also, I always seem to reply to wrong thread. but that's a user issue :-)



[ Reply to This | # ]