Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/

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/ – 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

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/ ]] && source /etc/profile.d/

-f checks if /etc/profile.d/ 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .