TOOLS/zsh.pl: complete profiles

Implemented in shell, because it has to be done at runtime.
TOOLS/zsh.pl: fix a ret that hadn't been changed to rc
TOOLS/zsh.pl: protect global environment