All Questions
2 questions
4
votes
5
answers
227
views
Looking for a convenient way to create a "constant array"
In zsh, is there a convenient way to create an array of n copies of the same integer?
Context: In a shell script, I need to create an array, tile_lengths, consisting of two longish constant blocks. A ...
8
votes
3
answers
5k
views
${#array} vs ${#array[@]}
As far as I can tell both ${#array[@]} and ${#array} evaluate to the number of elements in $array. Is there any reason for preferring the longer form (${#array[@]})?