zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: pws@ifh.de (Peter Stephenson)
Cc: zsh-workers@math.gatech.edu
Subject: Re: $(nooutput) problem
Date: Tue, 28 May 1996 13:34:37 +0200 (MET DST)	[thread overview]
Message-ID: <199605281134.NAA18699@turan.elte.hu> (raw)
In-Reply-To: <199605280918.LAA10810@hydra.ifh.de> from Peter Stephenson at "May 28, 96 11:18:09 am"

> It seems care is needed: (1) if a command is not a simple one no
> arguments may be necessary, so that having no arguments in execcmd()
> is perfectly legal; (2) single word substitution needs to keeps its
> arguments, for example the variable assignment code expects something
> back from prefork(); (3) there's another bug/incompatibility (nearer
> the latter than the former) resulting from the failure to delete empty
> arguments:
> 
> % ksh -c 'cmd=; $cmd print foo'
> foo
> % zsh -fc 'cmd=; $cmd print foo'
> zsh: permission denied: print
> 
> (which is certainly not the right answer in any case).
> 
> For these reasons I've fixed the problem by getting prefork() to junk
> empty nodes if and only if it is not doing single word substitution,
> and execcmd() to return if and only if it is a `simple' command with
> no arguments.

I'm thinking about a different solution.  The problem is more complicated
since if one write foo* and there is no file beginning with foo and
nullglob is set globlist() will produce empty args.  I think globlist
should be move before fork().  Probably it should be executed right after
prefork.  fixcline may come right after that.  In execcmd there is a test
for empty(args).  This should be moved after prefork/globlist/fixcline.

Also I think that command, exec, noglob, nocorrect and - should be removed
from reswdtab and the related code should be removed from parse.c, and
these should be handled in execcmd.  This would enable to do things like

FOO=exec ; $FOO something

which whould improve sh compatibility.  In bash and ksh exec is a builtin
so it can be disabled or a function called exec can be defined.  This may
be implemented is zsh as well.  Unfortunately I do not fully understand
exec.c so it may take a while for me unless someone else wiser than me
makes these changes.

Zoltan



  reply	other threads:[~1996-05-28 11:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-28  9:18 Peter Stephenson
1996-05-28 11:34 ` Zoltan Hidvegi [this message]
1996-05-30 16:58   ` execcmd() reordering Peter Stephenson
1996-05-30 18:00     ` Zoltan Hidvegi
1996-05-30 18:26       ` Barton E. Schaefer
1996-05-30 18:46         ` Zoltan Hidvegi
1996-05-30 18:41       ` Zoltan Hidvegi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199605281134.NAA18699@turan.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=pws@ifh.de \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).