Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Counting characters in command output?
- X-seq: zsh-users 29667
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: "Mark J. Reed" <markjreed@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Counting characters in command output?
- Date: Wed, 14 Feb 2024 07:49:19 +0100
- Archived-at: <https://zsh.org/users/29667>
- In-reply-to: <CAA=-s3z3dwdPY4ahJSOZZC7_vH5VwUJxt-UEo9BW=8qzu0WTSg@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>
On Wed, Feb 14, 2024 at 1:46 AM Mark J. Reed <markjreed@xxxxxxxxx> wrote:
>
> On Tue, Feb 13, 2024 at 3:41 PM Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
>>
>> Process substitution gives you an array. Quote it if you need a scalar.
>
> You mean command substitution, but thanks! It wouldn't have
> occurred to me to put quotes around it to change what the `#` was
> counting!
Right, command substitution. In my opinion, it's unfortunate that
command substitution in zsh splits on IFS by default. I wish this
wasn't the case. It's not even common that one wants to split command
output into words. Lines -- perhaps, but not words. So the default
behavior in this case is rarely what is desired and has to be actively
turned off.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author