![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 ? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
PS1=`/sbin/ifconfig | sed '/Bcast/!d' | awk '{print $2}' | awk '{print $2}' FS=":"`$
|
|
#3
|
|||
|
|||
|
Thanks Jadu !
my awk version ifconfig|grep Bcast|awk ' { print $2 }'|awk -F":" ' { print $2 }' |
|||
| Google The UNIX and Linux Forums |