bash completion

cfleck

tired
i used fink to download/install the bash-completion package. problem is, now i dont know how to "activate" it. it says it installed correctly, but i dont know how to make it work.

i have bash running by telling terminal to run /bin/bash at startup. it then reads from my .bash_profile by default. the only thing in my .bash_profile are a few aliases i have set up. do i need to do anything else?
 
Try adding this at the end of

.bashrc:
Code:
# prompt - courtesy of Rasterman, Gnea and JoelP
GRAD1='\333\262\261\260'
GRAD2='\260\261\262\333'
YLOBRN='\[\033[01;33;43m\]'
WHTBRN='\[\033[01;37;43m\]'
REDBRN='\[\033[00;31;43m\]'
REDBLK='\[\033[00;31;40m\]'
PPLBLK='\[\033[01;35;40m\]'
WHTBLK='\[\033[01;37;40m\]'
NONE='\[\033[00m\]'
HBLK='\[\033[00;30;30m\]'
HBLU='\[\033[01;34;34m\]'
BLU='\[\033[00;34;34m\]'
YEL='\[\033[00;33;33m\]'
WHT='\[\033[01;37;37m\]'
PRPL='\[\033[00;34;35m\]'
RED='\[\033[01;31;31m\]'
NORM='\[\033[01;00;0m\]'

export PS1="[$BLU \u$RED \W/$NONE]$ "
export PS2=$BLU$GRAD1$REDBRN$GRAD2$HBLU$GRAD1$PPLBLK'>'$NONE' '

This will give you a nifty colored name prompt.


I use .bash_profile to add some things to my PATH so that, for instace, the openoffice modules get picked up and I can launch OOO from the command line.

.bash_profile:
Code:
PATH=$PATH:$HOME/bin:/usr/bin:/usr/bin/X11R6:/usr/local/bin:/usr/local/X11/bin/:/usr/sbin:
/usr/games/:/Developer/Tools/:/sw/bin:/Applications/OpenOffice.org1.0.1/program


in .bashrc, I have made sure to source the fink config file that they told me to source:
.bashrc:
Code:
source /sw/bin/init.sh


Speaking of sourcing (which means something like "reading a config file"), in my bashrc, I have an alias to source bashrc. This makes it much easier to make changes take effect. When I was working out the colored prompts (above) I could make a change, save changes, then sourceall to see if it worked right:

.bashrc:
Code:
alias sourceall='source ~/.bash_profile ; source ~/.bashrc'


That's a sample. There are lots of web pages that describe much more sophisticated uses of the .bash* files.


=-Adam
 
Back
Top