On Mon, 16 Jan 2023 01:28:16 -0500
Lawrence Velázquez <vq@larryv.me> wrote:
> On Mon, Jan 16, 2023, at 1:05 AM, Kerin Millar wrote:
> > On Sun, 15 Jan 2023 23:59:54 -0600
> > Peng Yu <pengyu.ut@gmail.com> wrote:
> >
> >> But `echo "$Z"` print "a". Why bash can not treat exporting array as
> >> exporting the first element?
> >
> > Technically, that would be possible.
>
> For what it's worth, ksh exports indexed arrays that way, while zsh
> behaves like bash (i.e., does not export), and yash synthesizes a
> PATH-style scalar. (Of course, dash and POSIXly-correct yash don't
> support arrays.)
Thanks. I never noticed that ksh did so. I would say that yash goes overboard
there.
--
Kerin Millar