Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [bug] backslash stripped in sh/ksh emulation
- X-seq: zsh-workers 21864
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: Re: [bug] backslash stripped in sh/ksh emulation
- Date: Tue, 11 Oct 2005 13:57:30 +0100
- In-reply-to: <20051011123624.70fc9626.pws@xxxxxxx>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20051011083842.GA5380@sc> <20051011123624.70fc9626.pws@xxxxxxx>
- Sender: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
On Tue, Oct 11, 2005 at 12:36:24PM +0100, Peter Stephenson wrote:
> Stephane Chazelas <Stephane_Chazelas@xxxxxxxx> wrote:
> > $ ARGV0=ksh zsh -xc 'a="\\*"; case $a in *\\*) echo a;; esac'
> > + a='\*'
> > + case * (*\*)
> >
> > Can anyone explain it? It's OK if $a is quoted as in <case "$a">
> >
> > After investigation, it appears it is triggered by globsubst.
>
> You're basically pointing out that in:
>
> a='\\*'
> print -r ${~a}
>
> the output is
>
> \*
[...]
Not really. I could be fine with that (though other shells
behave differently) as leaving a variable unquoted in list
context (as in arguments to a command above) is known not to be
reliable anyway.
My concern was more in non-list contexts.
In
emulate sh
var='\\'
newvar=$var
I expect newvar to be the exact copy of var.
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author