Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I couldn't find a way to set an environmental variable with dot (.).

For example:

export mule.home=/Users/chandra/mule/
export {mule.home}=/Users/chandra/mule/
export $mule.home=/Users/chandra/mule/

all throw an error indicating it's not a valid identifier, like:

-bash: export: `.home=/Users': not a valid identifier

Setting mule_home works but not mule.home. Any ideas, suggestions?

share|improve this question
could you try mule\.home? – Kinjal Dixit Oct 30 '12 at 6:29
Doesn't work "restart"... but thanks for the suggestion. – Chandra Mohan Oct 30 '12 at 8:36
up vote 6 down vote accepted

That is because a name with a dot—and you can believe your shell here—is not a valid identifier. From man bash:

name A word consisting only of alphanumeric characters and underscores, and beginning with an alphabetic character or an underscore. Also referred to as an identifier.

The dot is not an alphanumeric character and it's not an underscore either. You can create something like:

env mule.home=/Users/chandra/mule/

But you won't really be able to read this, as far as I know. Also, bash should prevent you from even creating those identifiers in the first place.

My suggestion would be to create the environment variable with an underscore instead, and possibly use UPPERCASE words, as it's common practice.

Or use another shell that supports dots in environment variables, for example csh and tcsh.

share|improve this answer
Thanks slhck. we are setting it as part of some builds - don't have control of changing . to _. Will find out how it's being used and get back. – Chandra Mohan Oct 30 '12 at 8:39
In the case of env, since that's an external command bash doesn't have a say whether it's valid or not. – glenn jackman Oct 30 '12 at 15:08

Your Answer


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.