How do you give su the current user environment variables
You need to export the variable. You may not need to use the -m
option to su
to preserve the environment.
export PROJ_HOME=~/Projects/stable
Have you tried the option su -m ?
-m, --preserve-environment
do not reset environment variables
For example: su -m kenneth -c 'echo $PROJ_HOME'