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

Re: BUG: cd '' doesn't produce an error



Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx> wrote:
> 1.  Specify "setopt no_unset err_exit" in the script.  This will ensure
>     that no unset variable will ever be silently expanded into an empty
>     string unless you explicitly request it via ${FOO:-} .

These sound like very good ideas, in fact no_unset went into my .zshrc
right away. I'll try to remember these when i write zsh scripts in the
future, it shouldn't be much worse than remembering to use strict and
warnings in perl.

I'm not sure I'll be as likely to remember it when I'm debugging a sh
script and just switch to zsh to see if I've accidentally used some
zshism though, especially since I'll usually want to switch back
afterwards. :|



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