I've inherited a zsh script which sets up a bunch of environment variables for some simulations. It wants to edit the $path variable so that some perl scripts can be found:
typeset -U path
path=( ${SIMENV_BIN} $path )
However, when I source the script (source setup.source
) the $path variable remains untouched. If I copypaste these lines to the command prompt, they do update $path. If I sprinkle 'echo's in the script and source it again, the typeset command seems to clear the $path variable.
Would someone mind explaining to me what is going on, and how I can fix it?