Reputation: 11
It is possible to keep some variable when users do "su - xxx" (i know that "-" will erase the environment variable, but i am asking if others solutions or possibilities exists) ?
Thanks !
Upvotes: 0
Views: 2540
Reputation: 210
Use -m
eg
su -m xxxx
-m, --preserve-environment
do not reset environment variables
online manpage with additional information (PATH and IFS might be changed nevertheless)
Upvotes: 2