Zsh Mailing List Archive
Messages sorted by:
Re: *suggestion* for NULLCMD and emulate [ck]sh
- X-seq: zsh-workers 9624
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Alexandre Duret-Lutz <duret_g@xxxxxxxx>, zsh-workers@xxxxxxxxxxxxxxx
- Subject: Re: *suggestion* for NULLCMD and emulate [ck]sh
- Date: Tue, 8 Feb 2000 18:07:00 +0000
- In-reply-to: <mvbog9sotg8.fsf@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <mvbog9sotg8.fsf@xxxxxxxxxxxxxxxxxxxx>
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"
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
Messages sorted by: