zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: better grammar with $#
Date: Sun, 30 Oct 2022 10:49:59 -0700	[thread overview]
Message-ID: <b8f29270-e8fc-4492-5b51-9d26a5ae87e7@eastlink.ca> (raw)
In-Reply-To: <CAN=4vMq2iJCUvWmSjp5ZsF+ETRrv6WN7qYapoeToSq3f=63A=w@mail.gmail.com>


On 2022-10-30 10:29, Roman Perepelitsa wrote:
>
> You can combine the two expansions:
>
>    linecount=${#${(f)output}}

Nuts, I came close I tried: $#{${(f)output}}

If you can replace the `find` command with a glob, it'll be simpler.

Yeah, I'm migrating in that direction already.

> You'll also avoid quoting issues. If your code is supposed to handle
> all sorts of file names, make sure it can handle files with backslash
> and line feed in their names.

God knows.  I tend to crash into problems like that when they happen and 
deal with it at the time.  I wish there was some option to protect 
strings from all such issues, all the time, everywhere.


>
> Roman.
>


      reply	other threads:[~2022-10-30 17:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-30 14:16 Ray Andrews
2022-10-30 17:21 ` Philippe Troin
2022-10-30 17:29 ` Roman Perepelitsa
2022-10-30 17:49   ` Ray Andrews [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b8f29270-e8fc-4492-5b51-9d26a5ae87e7@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).