LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-11-2003, 06:34 AM   #1
smellofsunshine
LQ Newbie
 
Registered: Aug 2003
Posts: 5

Rep: Reputation: 0
Program returning ip-address?


Hi,

do you know a program in linux, which returns the ip-address of a network interface, so i can use it in a script?

it should work like this

eval ipaddr=/usr/bin/program

so that now, ipaddr is filled with my ip

thanx a lot in advance

greetings
markus
 
Old 08-11-2003, 06:47 AM   #2
DIYLinux
Member
 
Registered: Jul 2003
Location: NL
Distribution: My own
Posts: 92

Rep: Reputation: 18
ifconfig
 
Old 08-11-2003, 06:52 AM   #3
smellofsunshine
LQ Newbie
 
Registered: Aug 2003
Posts: 5

Original Poster
Rep: Reputation: 0
well, ok, but it returns a really big string with much more information in it....
 
Old 08-11-2003, 06:54 AM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
How's about a string:
/sbin/ifconfig eth0 | grep inet

You could probably awk the rest of that out? I'm no programmer, just talking...

Cool
 
Old 08-11-2003, 06:59 AM   #5
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Or cut but for the life of me I can't figure it out at 4AM.

Cool
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird card problem - DHCP returning IPv6 address lacitpo Linux - Wireless Networking 2 03-17-2005 12:28 AM
read gateway address from C program cranium2004 Programming 6 11-20-2004 07:20 PM
gethostbyname() is not returning my IP address hal2000 Programming 5 10-11-2004 06:54 PM
find MAC ADDRESS program C ofada Programming 4 01-15-2004 02:27 PM
kmalloc returning overlapped address dipakn Linux - General 4 10-30-2003 12:29 AM


All times are GMT -5. The time now is 11:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration