Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: trap ERR



On Feb 21, 11:57am, Ray Andrews wrote:
}
} I don't execute scripts much because they are 'naked', but if I put
} the whole thing in .zshenv are you saying that every script will have
} everything available?

If the script starts with "#! /bin/zsh -f" (for example), then no, the
-f option turns off .zshenv too; but any scripts that don't use -f will
read ~/.zshenv, whereas only interactive or login shells read the
others (it's rare but possible for a shell to be a login shell yet not
be interactive).

Generally speaking there are going to be some things that you don't
want to have happen in non-interactive shells, so I wouldn't suggest
blindly "mv ~/.zshrc ~/.zshenv" -- and you should be cautious about
e.g. "ssh somehost somecommand" behaving differently because somehost
has stuff in .zshenv.



Messages sorted by: Reverse Date, Date, Thread, Author