zsh-workers
 help / color / mirror / code / Atom feed
* Feature request: Bash compliance
@ 2016-07-21 18:22 Sebastian Höffner
  2016-07-21 18:33 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Höffner @ 2016-07-21 18:22 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

Hi zsh developers,

I recently stumbled across a problem with compatibility:
https://www.gnu.org/software/bash/manual/bashref.html#index-case
Bash allows ;& in switch-case statements as a fall-through, for which zsh
has ;| . It would be great, if zsh could adapt to (also?) support ;& .
More details about this problem can be found here:
http://wiki.bash-hackers.org/syntax/ccmd/case#portability_considerations

Have a good day
Sebastian

P.S.: I did not subscribe to the mailing list, so if you have questions
please CC me.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Feature request: Bash compliance
  2016-07-21 18:22 Feature request: Bash compliance Sebastian Höffner
@ 2016-07-21 18:33 ` Bart Schaefer
  2016-07-22 15:51   ` Sebastian Höffner
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2016-07-21 18:33 UTC (permalink / raw)
  To: Sebastian Höffner; +Cc: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

On Jul 21, 2016 11:29 AM, "Sebastian Höffner" <info@sebastian-hoeffner.de>
wrote:
>
> Hi zsh developers,
>
> Bash allows ;& in switch-case statements as a fall-through, for which zsh
> has ;| .

Zsh has allowed the ;& syntax for a long time now.  Where are you
encountering a problem with it?  Or are you just assuming it's a problem
based on someone's write-up?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Feature request: Bash compliance
  2016-07-21 18:33 ` Bart Schaefer
@ 2016-07-22 15:51   ` Sebastian Höffner
  2016-07-22 18:35     ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Höffner @ 2016-07-22 15:51 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

I ran into problems which are detailed here:
https://github.com/intuit/wasabi/issues/49 . My zsh is installed via
homebrew: zsh 5.2 (x86_64-apple-darwin15.4.0).

On Thu, Jul 21, 2016 at 11:33 AM Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Jul 21, 2016 11:29 AM, "Sebastian Höffner" <info@sebastian-hoeffner.de>
> wrote:
> >
> > Hi zsh developers,
>
>
> >
> > Bash allows ;& in switch-case statements as a fall-through, for which zsh
> > has ;| .
>
> Zsh has allowed the ;& syntax for a long time now.  Where are you
> encountering a problem with it?  Or are you just assuming it's a problem
> based on someone's write-up?
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Feature request: Bash compliance
  2016-07-22 15:51   ` Sebastian Höffner
@ 2016-07-22 18:35     ` Bart Schaefer
  2016-07-22 19:40       ` Sebastian Höffner
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2016-07-22 18:35 UTC (permalink / raw)
  To: Sebastian Hoffner; +Cc: Zsh hackers list

On Jul 22,  3:51pm, Sebastian Hoffner wrote:
} Subject: Re: Feature request: Bash compliance
}
} I ran into problems which are detailed here:
} https://github.com/intuit/wasabi/issues/49 . My zsh is installed via
} homebrew: zsh 5.2 (x86_64-apple-darwin15.4.0).

torch% case this in
case> this) echo now that;&
case> that) echo this is that;;
case> esac
now that
this is that
torch% 

I would note that wasabi.sh begins with

    #!/usr/bin/env bash

which has the consequence that zsh is going to hand it off to bash even
if your $SHELL is zsh, unless you are explicitly passing it to zsh with
e.g. "zsh wasabi.sh".  So I think the problem here is all bash-3.2 and
not zsh.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Feature request: Bash compliance
  2016-07-22 18:35     ` Bart Schaefer
@ 2016-07-22 19:40       ` Sebastian Höffner
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Höffner @ 2016-07-22 19:40 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]

Thanks Bart, it you are completely right.
Sadly even zsh wasabi.sh won't run it correctly, due to = expansion in the
first equality check as well as some array slicing problem in the very same
case/esac.
Thanks for looking into it!
Sebastian

On Fri, Jul 22, 2016 at 11:35 AM Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Jul 22,  3:51pm, Sebastian Hoffner wrote:
> } Subject: Re: Feature request: Bash compliance
> }
> } I ran into problems which are detailed here:
> } https://github.com/intuit/wasabi/issues/49 . My zsh is installed via
> } homebrew: zsh 5.2 (x86_64-apple-darwin15.4.0).
>
> torch% case this in
> case> this) echo now that;&
> case> that) echo this is that;;
> case> esac
> now that
> this is that
> torch%
>
> I would note that wasabi.sh begins with
>
>     #!/usr/bin/env bash
>
> which has the consequence that zsh is going to hand it off to bash even
> if your $SHELL is zsh, unless you are explicitly passing it to zsh with
> e.g. "zsh wasabi.sh".  So I think the problem here is all bash-3.2 and
> not zsh.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-22 19:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-21 18:22 Feature request: Bash compliance Sebastian Höffner
2016-07-21 18:33 ` Bart Schaefer
2016-07-22 15:51   ` Sebastian Höffner
2016-07-22 18:35     ` Bart Schaefer
2016-07-22 19:40       ` Sebastian Höffner

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).