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

Re: "setopt noexec" and interactive shells



Bart Schaefer wrote:
>Aha.  But, unlike `interactive', there's no reason not to allow `noexec'
>to become set in a shell function, provided that it's going to be restored
>again by `localoptions' when the function exits.

*grumble*.  What's anyone ever going to use noexec for other than syntax
checking?  I'd prefer that we give the option a consistent behaviour.
For the record, pdksh makes no such distinction between commands in a
function and commands at the top level:

$ foo () { echo foo $-; set -n; echo bar $-; }
$ echo foo $-
foo ims
$ foo
foo ims
bar imns
$ echo bar $-
bar imns

-zefram



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