persist-env give more flexibility to set or unset system wide environment variable.
persist-env is a set of functions desgined to create, edit or remove any environment variables accessible all throughout the system, by each and every user, both locally and remotely.
source the persist-env.sh script at the beginning of any Bash program.
#!/bin/bash
source /path/to/persist-env.sh
set a variables
env_set MYVAR "myvalue"
get it
env_get MYVAR
# or
printenv MYVAR
then unset it
env_unset MYVAR