Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Counting characters in command output?
- X-seq: zsh-users 29676
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: "Ray Andrews" <rayandrews@xxxxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: Counting characters in command output?
- Date: Thu, 15 Feb 2024 09:34:57 -0500
- Archived-at: <https://zsh.org/users/29676>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <58e3e416-1e9f-424c-b9af-b96b93dc9938@eastlink.ca>
- 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> <0b3cf56b-004d-4a9f-a643-a53ccb50e278@eastlink.ca> <CAA=-s3yahhzqxELBD=oWy_OjLcbL_N9cu5y-PwJ_qOdYcKm6dA@mail.gmail.com> <58e3e416-1e9f-424c-b9af-b96b93dc9938@eastlink.ca>
On Wed, Feb 14, 2024, at 11:30 AM, Ray Andrews wrote:
> So really there is a logical problem too. We have another 'invisible'
> transformation. We 'have' quarts but liters are what's counted, yes?
>
>> I would in general have expected *foo $(bar) * to behave identically to *baz=$(bar); foo $baz*.
>
> Yes, it would be non-negotiable in algebra. a=b; b=c; ergo a=c.
The shell language isn't algebra. This is hardly the only case in
which the substitution principle doesn't hold without putting in
some extra work (which I'm omitting here for demonstration purposes).
% foo=(a b c)
% printf '<%s>' $foo; echo
<a><b><c>
% bar=$foo
% printf '<%s>' $bar; echo
<a b c>
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author