Tell me more ×
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
2  
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

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.