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

Re: execcmd() reordering



> 1) exec, noglob, - and command are treated more like commands; they can
> appear from substitution, though not globbing (which would be stupid).

Yes stupid, but that's how other shells behave.  But since noglob must be
detected before globlist() that's the best we can do.

> 6) globbing is expanded before the fork.  Other than getting the
> prompt back an iota later when running background commands, I don't
> see this is a big deal.  One thing which seems to be a plus is that
> failures to match are now handled synchronously for background
> commands:

Also it makes debugging much easier.  Now prefork is really a historic
name.  There used to be prefork and postfork and a lot of substitutions had
been done in the later.

> 8)  fixcline() got moved up. This means things in the command line which
> expand to nothing are removed (if completely blank), or untokenised
> (if something like '') earlier.  The only consequent changes are that
> for AUTOCD the word mustn't be completely blank, since
> otherwise "$nonexistent" would have caused cd to home, which is a
> little counterintuitive.  Also, `[' doesn't need specially
> untokenising any more --- this must be a sign we're Doing the Right Thing.

Also makecline can be simplified after that patch.

>   (iv)  The new tests for `command', `exec', etc., are just simple
>         strcmp's.  It really didn't seem worth doing anything fancy
>         for four short strings.

I was thinking about adding these into builtintab with some new BINF_
flags: e.g. all of these would have BINF_PREFIX and there would be one more
BINF_ flag for each.  This would improve sh compatibility.  Hopefully a
hash-table lookup is not slower than these strcmps.  If something is found
with BINF_PREFIX shfunctab may be searched which may override builtintab
similarily to ksh.

Zoltan




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