Linuxathome.net

Linux news and help for home broadband internet users
It is currently Fri Mar 29, 2024 6:09 am

All times are UTC + 10 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Oct 15, 2002 5:48 pm 
Offline
Newbie

Joined: Sun Jun 30, 2002 12:58 am
Posts: 36
Does anyone have a nice way to extract the ip address associated with an adapter in a shell script??

Thanks

_________________
DM


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 15, 2002 6:22 pm 
Offline
Newbie

Joined: Sun Jun 30, 2002 10:51 am
Posts: 24
Location: /dev/null
ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e "s/addr\://"
or for some basic numeric checking
ifconfig eth0 | sed -n 's/inet addr: *\([0-9.]*\).*/\1/p' | awk '{print $1}'


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 15, 2002 6:43 pm 
Offline
Newbie

Joined: Sun Jun 30, 2002 12:58 am
Posts: 36
I really should learn to use pattern matching tools properly :roll:

Thanks redlander

_________________
DM


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 10 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group