LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-02-2003, 03:09 PM   #1
mahamkali
Member
 
Registered: Oct 2003
Posts: 67

Rep: Reputation: 15
shell script for IP...


can any one provide me a simple shell script to find out my IP address for linux system. I really appreciate your help.

thank,
siva
 
Old 12-02-2003, 03:10 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
type in 'ifconfig' - it works in a similar way to Wiindows' ipconfig.
 
Old 12-02-2003, 03:12 PM   #3
mahamkali
Member
 
Registered: Oct 2003
Posts: 67

Original Poster
Rep: Reputation: 15
actually i want to capture onlu the ipaddress to a variable so that i can write the cron job to mail me daily. so if you can provide me shell script that just captures only the ipaddress, i would be grateful...

thanks,
siva
 
Old 12-02-2003, 03:19 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
try:
/sbin/ifconfig eth0|grep "inet addr"|cut -d" " -f12|cut -d: -f2
 
Old 12-02-2003, 03:23 PM   #5
mahamkali
Member
 
Registered: Oct 2003
Posts: 67

Original Poster
Rep: Reputation: 15
great!.. thank you very much.


siva
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script inside shell script treotan Linux - General 4 02-19-2009 06:34 AM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 03:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:39 PM.

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
Open Source Consulting | Domain Registration