Reputation: 1534
I have a shell script with something like
#!/bin/bash
export DYLD_LIBRARY_PATH=/path/to/:$DYLD_LIBRARY_PATH
echo $DYLD_LIBRARY_PATH
When i execute it, it shows nicely the updated 'DYLD_LIBRARY_PATH'. However, when i try to check what's in there after i run the script via
echo $DYLD_LIBRARY_PATH
from the command line, i see no changes what so ever.
p/s/ I run OS-X 10.8
Upvotes: 1
Views: 376
Reputation: 122458
You need to source
the script:
$ . ./my_script.sh
So that setting environment variables affects the current shell. You are setting it in a sub-shell only.
Upvotes: 1