How do I set an environmental variable with a dot?

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.