Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
how to truncate an array
This should be dead simple, but I can't figure out how to do it. I have
an array that can be
arbitrarily long, and I want to truncate it at 20 elements.
setopt POSIX_STRINGS
string[20]='\0'
echo "string is now truncated: $string"
... I've tried every variation on the above theme that I can think of
with no luck.
I know that zsh likes to not truncate strings on 'null' but
'POSIX_STRINGS' is supposta
force that, no? There must be a simple way to do this. I guess I still
have C on the brain
but it seems to me that it is God's will that a null terminates a string ...
Messages sorted by:
Reverse Date,
Date,
Thread,
Author