The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sourcing the .bashrc Nusy UNIX for Dummies Questions & Answers 3 05-27-2008 02:23 PM
.bashrc question re: rm -i & ls --colors kthatch UNIX for Dummies Questions & Answers 16 04-21-2008 02:06 PM
alias rm = 'rm -i' in .bashrc and vnc cy163 UNIX for Dummies Questions & Answers 0 05-23-2007 06:57 AM
history -c in my .bashrc yankee428 UNIX for Dummies Questions & Answers 1 06-23-2005 01:13 PM
from bashrc to sh..?? moxxx68 Shell Programming and Scripting 3 09-13-2004 02:39 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-26-2008
Registered User
 

Join Date: Jul 2007
Location: India
Posts: 14
IP address in prompt using .bashrc

I know to display hostname, username .... etc in command prompt using .bashrc. But what i want is to display IP of the system in prompt.

Any way to do it ?
Reply With Quote
Forum Sponsor
  #2  
Old 01-26-2008
jaduks's Avatar
Registered User
 

Join Date: Aug 2007
Location: Assam,India
Posts: 146
Code:
PS1=`/sbin/ifconfig | sed '/Bcast/!d' | awk '{print $2}' | awk '{print $2}' FS=":"`$
//Jadu
Reply With Quote
  #3  
Old 01-26-2008
Registered User
 

Join Date: Jul 2007
Location: India
Posts: 14
Thanks Jadu !
my awk version

ifconfig|grep Bcast|awk ' { print $2 }'|awk -F":" ' { print $2 }'
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0