3

Whenever I use the sudo command, none of my environment variables appear to be preserved.

I've tried modifying the sudoers file, by removing the env_reset specification.

#Defaults   env_reset

I've also tried adding the env variable that I want using env_keep.

Defaults   env_keep += "DYLD_LIBRARY_PATH"

I'm using Mac Snow Leopard.

Is there something that I am missing?

1 Answer 1

1

DYLD_LIBRARY_PATH seems to be excluded from the Defaults env_keep += "Defaults env_keep += "DYLD_LIBRARY_PATH" "

If you try any other variable it works for example Defaults env_keep += "VAR"

You can probably get over this by providing DYLD_LIBRARY_PATH on the commandline for example (where cmd is the command you want to pass DYLD_LIBRARY_PATH)

# sudo DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH cmd

Hope this helps

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .