Simply modify .bashrc to use the PS1= construct:
PS1="[\u@\[\e[0;33m\]MBP @ `ifconfig|grep broadcast|awk ' { print $2 }'` \[\e[0m\]\W]$ "
The key bit is enclosed in `...`. Note that modifying this for other *nix systems requires fiddling with the search string. Also note that the complex [\e[0;33m\]... construct controls the prompt color. There are some great online tutorials about that. Just Google "bash color prompt".
Result:
PS1 line in .bashrc to get IP address in command prompt on OSX. |