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

Re: Slurping a file




On 2024-01-14 12:13, Lawrence Velázquez wrote:
https://en.wikipedia.org/wiki/Time_complexity#Table_of_common_time_complexities
Yikes!  I'm sorry I asked.  Thanks tho, but that's scary stuff.
Seems to me that 
at a first estimation one might want: 

1) Full exact copy -- byte identical including blanks, newlines, 
trailing stuff and naughty chars. slurp.
Reading an entire file into a variable is often -- not always, but
often -- a red flag that suggests the entire script is poorly
designed.  It uses more memory and makes it difficult to feed the
data to external utilties (although the latter is less of a concern
with zsh in particular, which relies on external utilities less
than other shells do).

I appreciate  the historical context.  Much is understandable when you know

the history.

Elision of empty values is a property of unquoted expansion.  It
has NOTHING to do with variable types.

I'll take another look, thanks.  I may have gotten my wires crossed.





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