zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Alexandre Duret-Lutz <duret_g@epita.fr>, zsh-workers@math.gatech.edu
Subject: Re: *suggestion* for NULLCMD and emulate [ck]sh
Date: Tue, 8 Feb 2000 18:07:00 +0000	[thread overview]
Message-ID: <1000208180700.ZM31285@candle.brasslantern.com> (raw)
In-Reply-To: <mvbog9sotg8.fsf@phobos.lrde.epita.fr>

On Feb 8, 11:54am, Alexandre Duret-Lutz wrote:
} Subject: *suggestion* for NULLCMD and emulate [ck]sh
}
} When doing redirections with no file, shells can show three behaviours:
} 
} > file
} 
} is equivalent to 
} 
} [k]sh)     : > file
} csh)       forbiden
} zsh)       $NULLCMD > file
} 
} Zsh can emulate the to first by setting NULLCMD to ':' or unsetting NULLCMD.
} 
} What I would like zsh do is [let the user choose any of the three].
} 
} I thought this could be accomplished by adding two options to zsh,
} one would tell wether the NULLCMD parameter should be considered 
} or not by the exec.c code, and the other could say what the
} default behaviour (sh or csh) when NULLCMD is unset.

I think something along these lines might be OK, but that the semantics
and names that you chose are not quite right.

Rather than have zsh change the value of NULLCMD when it starts up as sh
or ksh, the proposed SH_NULLCMD option should cause the ": > file" style
to be used regardless of the value of NULLCMD.

The second option, which I'd call CSH_NULLCMD for consistency, would also
ignore the value of NULLCMD but give the "redirection with no command"
error.

We then pick one of these to "win" when both are set, as presently happens
with e.g. NULLGLOB and CSH_NULLGLOB.  I don't really care which one wins.

Do we need something similar for READNULLCMD?  Can these same two options
be overloaded for both at once?  If the answers are "yes" and "no" then I
think the right thing is to not change it at all, as it's just too sloppy
to get it right.  If the first is "no" or the second is "yes," go ahead.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~2000-02-08 18:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-08 10:54 Alexandre Duret-Lutz
2000-02-08 18:07 ` Bart Schaefer [this message]
2000-02-08 22:42   ` Alexandre Duret-Lutz
2000-02-09 18:54     ` Bart Schaefer

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=1000208180700.ZM31285@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=duret_g@epita.fr \
    --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).