tags:

views:

393

answers:

1

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?

A: 

I think you might need to use .zshenv since it is sourced on all invocations of the shell.

http://zsh.sunsite.dk/Contrib/startup/std/zshenv

Himanshu