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

Upon opening a new Terminal window on my Mac, I always get the following message -

Last login: Wed xx xxxxx on xxxxx
-bash: export: `-s': not a valid identifier
-bash: export: `/Users/xxxxxx/.rvm/scripts/rvm': not a valid identifier
-bash: export: `]]': not a valid identifier

Although its not leading to any problems, how can I correct/get rid of the above? Thanks

share|improve this question

migrated from Sep 12 '12 at 12:14

This question came from our site for professional and enthusiast programmers.

Check the contents of .bash_profile; it's probably got some garbage in it. – Wooble Sep 12 '12 at 10:18
Could you edit your question and include your .bashrc and/or .bash_profile. Or, just the offending lines? It looks like bash is not liking the usage of the export command. That could be triggered by something like this: $ export -- -s Another suggestion to isolate the offending line(s) would be to test the script with bash's -x option set. This will print each executed command string before actually executing it. Just open up a new terminal window and try something like: $ bash -x ~/.bashrc – George Sep 13 '12 at 18:34

It seems you have set the bash to run some commands at the starting time. Change the setting from Terminal Preference may solve your problem.

share|improve this answer

Could it be, that you have a file executed on starting a terminal session? Normally this is something like .profile or .bash_profile in your home-folder.

As @Wobble already suggested it seems that execution of one of these files causes that problem.

I think it might be a missing backtick in an export statement.

share|improve this answer

See also my comment under the question. But it looks like you probably just copy and mis-pasted a command to initialize the shell environment for Ruby rvm using rvm's init script. I have a similar line in my .bashrc and it looks like this:

test -s "$HOME/.rvm/scripts/rvm" && source "$HOME/.rvm/scripts/rvm"

I'm guessing yours is using bash's [[ notation for the test command. If you want to stick with that syntax, the line should look like this:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

So, comb over your .bashrc's rvm init line and make it look like one of the above.

share|improve this answer

You must log in to answer this question.