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.

Every time I open a Terminal window the following is printed on the top:

launchctl usage: setenv <key> <value>

I figured something must be wrong with my .bash_profile but I could not find anything in there related to "Daemons/Services".

What else could it be?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

If the message appears every time you open a terminal, there is probably a problem in one of ~/.bash_profile or /etc/profile. You are probably calling launchctl with wrong parameters. Try searching for the relevant line:

grep launchctl ~/.bash_profile /etc/profile ~/.profile ~/bash_login

That should show you which file is calling launchctl and you can then either remove the offending line or correct it.

bash only reads ~/bash_profile and /etc/profile when launched as a login shell. In OS X, when you open a new terminal, this is the case, whereas in most (if not all) other *nix terminals, an interactive, non-login shell is launched and ~/.bashrc is read instead. See here for more info.

share|improve this answer
    
OS X always launches a login shell from the Terminal. See joshstaiger.org/archives/2005/07/bash_profile_vs.html –  slhck May 27 '13 at 16:08
    
@slhck Oh! Thanks, did not know that, will update answer accordingly. –  terdon May 27 '13 at 16:13
    
Thanks! It worked :) –  Ynv May 27 '13 at 16:30
    
I rewrote your answer a little so it makes more sense when looking at it from an OS X perspective. Since launchctl is exclusive to OS X I think it's easy enough to focus this on OS X and mention the difference to Linux at the end. Hope you don't mind :) –  slhck May 27 '13 at 17:13
    
@slhck not in the least, thanks. Any particular reason you removed ~/bash_login? Does that not exist on OSX? –  terdon May 27 '13 at 17:17
show 2 more comments

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.