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

parse vs. runtime errors



How come:

[ .... ]]

is only caught as an error at runtime?  The error kills anything remaining on the same line, but subsequent linesexecute as normal.  I find most errors kill the entire parse, but there are some few that survive parse but throw the error at runtime.  Why is that?  It's a bit annoying that the runtime error can be buried in output and so not be noticed, and it seems like it would have to be an error at parse too.  Either way, can I ask zsh to always make any error stop everything and make itself known?  I'll often do something like:

$ . func-file; func arg1 arg2

... and if 'func-file' has some bug in the contained source of 'func ()', the older version of 'func' just runs anway and one does not see the error messageif the output scrolls off the screen.  True, one might not be so lazy and source the file, then run the command, but still it would be nice if there was some way of making zsh always stop whatever it is doing when any code error shows up.




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