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

Re: field splitting



zsh -fc 'line="abcd"; echo ${${(As: :)line}[1]} $ZSH_VERSION'
a 5.1.1

Pier Paolo Grassi
linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
founder: https://www.meetup.com/it-IT/Machine-Learning-TO


Il giorno mer 22 apr 2020 alle ore 19:18 Roman Perepelitsa <
roman.perepelitsa@xxxxxxxxx> ha scritto:

> On Wed, Apr 22, 2020 at 7:13 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
> wrote:
> >
> > doesn't seem to work
> >
> > line="abcd"
> > echo -n ${${(As: :)line}[1]}
> > a
>
> Curious. How about this?
>
>   zsh -fc 'line="abcd"; echo ${${(As: :)line}[1]} $ZSH_VERSION'
>
>
> Roman.
>


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