Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

After installing/uninstalling homebrew and other command line software such as zsh, I had an issue with my command line prompt, which let me to remove several configuration files such as .bashrc, .bash_profile, .zprofile, and .zshrc. Now every time I start my Terminal I show the following. I'm on OS X 10.8.4.

Last login: Tue Aug 20 07:59:07 on ttys000
/etc/zprofile:source:2: no such file or directory: /etc/profile.d/rvm.sh

How do I fix this?

share|improve this question
    
This is one of the very clear error messages ;): Remove or comment (#) line 2 in /etc/zprofile which reads probably source /etc/profile.d/rvm.sh. –  mpy Aug 20 '13 at 15:15
    
Awesome! Thank you so much for the help, it worked marvelously :))) –  fenomalist Aug 20 '13 at 19:29

1 Answer 1

A better solution than the crude approach proposed in my comment:

If you need to source a file from your .zshrc or some other profile file, it is good practice to check if this file exists in order to prevent such error messages ("no such file or directory").

[[ -f /etc/profile.d/rvm.sh ]] && source /etc/profile.d/rvm.sh

-f checks if /etc/profile.d/rvm.sh is a file. If true the part after the logical AND (&&) gets executed.

Now you don't get an error message on systems the file isn't present, but on systems where is does exist it gets sourced. This is very valuable when you share your .zshrc on different machines!

share|improve this answer

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.