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

Re: better grammar with $#




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.





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