Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with bash emulation regarding ':'
- X-seq: zsh-workers 30163
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: Bug with bash emulation regarding ':'
- Date: Tue, 31 Jan 2012 00:15:05 +0200
- Authentication-results: mr.google.com; spf=pass (google.com: domain of felipe.contreras@xxxxxxxxx designates 10.152.131.40 as permitted sender) smtp.mail=felipe.contreras@xxxxxxxxx; dkim=pass header.i=felipe.contreras@xxxxxxxxx
- Cc: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>, zsh-workers@xxxxxxx, Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=q5hfyoFshFAD0Uc8qWqPEHNj8QzJH50Pd8r19FUYVXE=; b=vcK/5z3Z8DixrSWpyrhcKESP8t+mklfam7iSMTiBnAE6H7k0wGLSCSXFewA/X6yNLC mZL2uEovZgYmL72cZRH18lvXrFdocFsUo61x7nN6FGnZhYX6SPP4bxyhGUX5p3c9AhEX OOqzd2U/yjP4kJSFGgrxNzqJouULF6WIuQwSY=
- In-reply-to: <CAHYJk3SbVD5UEccBNtv0abn+T4qrJMcRsgwfmzhAt++ocKJ-xQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAMP44s2Zo5U=RVuznntDOFeqUZeJdmg1XfHMg4egu-1PRjnkKA@mail.gmail.com> <alpine.LNX.2.01.1201290026500.11259@hp.internal> <CAMP44s0au9K+PKsJHAsMt2qohKYDXx1gaE6nR8Y4kGh2AqSpTw@mail.gmail.com> <CAHYJk3SbVD5UEccBNtv0abn+T4qrJMcRsgwfmzhAt++ocKJ-xQ@mail.gmail.com>
On Sun, Jan 29, 2012 at 4:25 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 29 January 2012 14:44, Felipe Contreras <felipe.contreras@xxxxxxxxx> wrote:
>> On Sun, Jan 29, 2012 at 7:31 AM, Benjamin R. Haskell <zsh@xxxxxxxxxx> wrote:
>>> On Sun, 29 Jan 2012, Felipe Contreras wrote:
>>>> Seems like there's a bug in bash emulation:
>>>>
>>>> [...]
>>>>
>>>> Zsh with bash emulation generates [...]
>>>
>>>
>>> When you say "bash emulation" what do you mean?
>>
>> emulate bash
>
> There's no such emulation mode.
>
> emulate [ -LR ] [ {zsh|sh|ksh|csh} [ -c arg ] ]
> With single argument set up zsh options to emulate the specified shell
> as much as possible. csh will never be fully emulated. If the
> argument is not one of the shells listed above, zsh will be used as a
> default
>
> This seems to not actually be true though,
> if (ch == 'r')
> ch = zsh_name[1];
>
> /* Work out the new emulation mode */
> if (ch == 'c')
> emulation = EMULATE_CSH;
> else if (ch == 'k')
> emulation = EMULATE_KSH;
> else if (ch == 's' || ch == 'b')
> emulation = EMULATE_SH;
> else
> emulation = EMULATE_ZSH;
And to add more to the confusion:
#define EMULATE_SH (1<<3) /* Bourne shell */
To me it looks like ksh is closer to bash than sh... perhaps it would
make more sense to map 'b' to ksh. Even better would be to just create
another separate emulation option to avoid the confusion.
Cheers.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author