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 identifierSetting mule_home works but not mule.home. Any ideas, suggestions?
1 Answer
That is because a name with a dot—and you can believe your shell here—is not a valid identifier. From man bash:
nameA 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.