how to get ipaddress of my computer

Posted by astha goyal on Stack Overflow See other posts from Stack Overflow or by astha goyal
Published on 2010-03-29T11:50:49Z Indexed on 2010/03/29 11:53 UTC
Read the original article Hit count: 469

Filed under:

hello i want to knw the ipaddress of my computer. /sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' this command gives the ipaddress of my computer and print result on console but i want it in a varible sothat i can use it in my C program. How can i do that.

© Stack Overflow or respective owner

Related posts about linux