Hi,
I find that share/spack/setup-env.sh fails when executed indirectly from a symlink, say, from /etc/profile.d/spack-setup.sh
This is easily fixed by changing line 155 of setup-env.sh to use the readlink function:
_sp_source_file=$(readlink -f "${BASH_SOURCE[0]}") # Bash's location of last sourced file.
Agreed?
I tested in zsh too.
I promise I will get with the pull-requests soon.
~Malcolm