Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have Lion on my Mac Air. I wrote some aliases in ~/.bashrc file, which looks like:

# Aliases
alias p='pdflatex *.tex;open *.pdf'
alias bromine='ssh administrator@bromine.org'

I then sourced my .bashrc file from .bash_profile, which I believe is sourced upon startup. My .bash_profile file looks like

# Setting PATH for EPD-7.2-2
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
export PATH

MKL_NUM_THREADS=1
export MKL_NUM_THREADS

# MacPorts Installer addition on 2012-02-27_at_18:19:09: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

# source bashrc
. .bashrc

Why is it that my aliases work sometimes upon startup, but not always - (sometimes, I have to manually source .bash_profile)?

share|improve this question
    
Can you identify a reproducible way to get a bash that doesn't have the aliases? When this happens, what does ps -p $$ -p $PPID show? –  Gilles Apr 1 '12 at 17:28
4  
Have you tried sourcing with the full path, i.e. ${HOME}/.bashrc instead of .bashrc? –  kopischke Apr 11 '12 at 17:16
    
I had similar issues a long time ago. I simply mashed everything into .profile, removed .bashrc and .bash_profile, and stopped having issues. –  kccricket Jul 5 '12 at 18:55
    
Thanks, I'll give that a shot and see if loading the aliases becomes more reliable. –  David Faux Jul 7 '12 at 7:50
    
How do you startup? –  Mark Nov 2 '13 at 9:43

1 Answer 1

It seems like your bash shell is looking for .profile instead of .bashrc . What you can do is make a symbolic link:

ln -s ~/.bashrc ~/.profile

and restart your session (close, reopen Terminal). Any future bash setting updates can be made to .profile or .bashrc.

share|improve this answer
    
That might be a fix but why has this happened that seems a nasty bug. What else is broken –  Mark Nov 2 '13 at 9:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.