0

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 !

Ménahem
  • 11
  • 4
  • give a glance to this [link][1] i hope it's what you'd to do. [1]: http://stackoverflow.com/questions/8633461/how-to-keep-environment-variables-when-using-sudo – blurstream Jul 29 '14 at 15:55

1 Answers1

2

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)

Ristridin
  • 13
  • 5
cduffin
  • 200
  • 1
  • 4