Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug with bash emulation regarding ':'



On 30 January 2012 23:15, Felipe Contreras <felipe.contreras@xxxxxxxxx> wrote:
> 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.

I'm not exactly sure what the point is here, are you perhaps confusing
the bourne shell (sh) with the bourne again shell (bash)?

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author