LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to set linux environment variable like abc.abc (With DOT in the string) (https://www.linuxquestions.org/questions/linux-general-1/how-to-set-linux-environment-variable-like-abc-abc-with-dot-in-the-string-688153/)

super_hill 12-03-2008 07:21 PM

How to set linux environment variable like abc.abc (With DOT in the string)
 
I want to set a special format environment variable abc.abc.

I tried the command: export abc.abc=test; But the prompt output shows: bash: Exprot: 'abc.abc=test' : not avalid identifier.

Anyone has the solution? Thanks in advance.

garyg007 12-03-2008 07:37 PM

Variable name must begin with an Alphanumeric character or underscore character (_), followed by one or more Alphanumeric characters. That means that the variable name cannot contain any special characters other than underscore.

give the variable a name; then assign a value to it.
For example:
Code:

gary@abitbox:~$ export abc=abc.def
gary@abitbox:~$ echo $abc
abc.def
gary@abitbox:~$


HTH

Gary


All times are GMT -5. The time now is 05:49 PM.