Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Counting characters in command output?
- X-seq: zsh-users 29686
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: Counting characters in command output?
- Date: Fri, 16 Feb 2024 14:37:34 -0500
- Archived-at: <https://zsh.org/users/29686>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <CAH+w=7ZcF7PBYqktJCSXDrREqVQbZ9HSorvtRRXB8DZR2a5kWg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAA=-s3zUSg4KYSGTNVSi80u_=9C9kg8nk2CYx2Zewiu70rgSZQ@mail.gmail.com> <CAN=4vMrWzYgyGYghHsp1jEcnN=X+bUM8LDXviL4V+mHtnHpq8A@mail.gmail.com> <CAA=-s3z3dwdPY4ahJSOZZC7_vH5VwUJxt-UEo9BW=8qzu0WTSg@mail.gmail.com> <CAN=4vMp1gcSbE19cbKoW9JJMs_dVhedbOYrwZRVQjbuEg0rNqw@mail.gmail.com> <CAH+w=7brXaXfsCi5wXnYNZgZmKVqis6u3T3bPtQuqCHcbpnqKA@mail.gmail.com> <8fc8b27a-9f1b-4d7f-8865-cbf41cc7374e@app.fastmail.com> <CAH+w=7ZcF7PBYqktJCSXDrREqVQbZ9HSorvtRRXB8DZR2a5kWg@mail.gmail.com>
On Fri, Feb 16, 2024, at 1:03 PM, Bart Schaefer wrote:
> On Thu, Feb 15, 2024 at 8:55 PM Lawrence Velázquez <larryv@xxxxxxx> wrote:
>>
>> + Unless enclosed in double quotes, the expansion of mytt($(command)) is
>> + split on mytt(IFS). In contrast, and contrary to bash and ksh, unquoted
>> + mytt(${ command }) and its variants are not split unless the
>> + mytt(SH_WORD_SPLIT) option is set.
>
> That's not quite accurate, though.
>
> % print -l ${|reply| reply=(a b c)}
> a
> b
> c
>
> It's only ${| REPLY=...} and ${ command } that always behave like scalars.
Ah, you got me. I only tested out ${ command }, and I overlooked
that var in ${|var| command } could be an array.
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author