Yes, you can export such an environment variable, but not from the bash export statement.
While bash refuses to create an environment variable called, for example, a/b , we can create it using python and subshells created by python, and see this.
As an example, consider the following python command:
$ python -c 'import os; os.environ["a/b"]="2"; os.system("/bin/bash");'
If we run this command, we put it in a subshell. From this subshell, you can see that creating the environment variable was successful:
$ printenv | grep a/b a/b=2
(At this point, you can exit the subshell (type exit or ctrl-D) to return to the python program, which will exit and return us to the main shell.)
source share