I have an array of 2 file paths. When I create the array directly from a find command, zsh tells me the length of the array is 71, which must be the length of all characters combined. When I create an entirely different array, and just hand paste those in, the size is 2, which is what I would expect.
What am I missing?
<code>cbongiorno@snowball [05:50:25 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % find mappers/gitlab/commits/ -type f -name 'predicate.*'
mappers/gitlab/commits/predicate.js
mappers/gitlab/commits/predicate.jq
cbongiorno@snowball [07:14:13 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % preds=$(find mappers/gitlab/commits/ -type f -name 'predicate.*')
cbongiorno@snowball [07:14:22 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#preds}
71
cbongiorno@snowball [07:14:29 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#preds[@]}
71
cbongiorno@snowball [07:14:37 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % preds=$(find mappers/gitlab/commits/ -type f -name 'predicate.*' | tr 'n' ' ')
cbongiorno@snowball [07:14:57 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#preds[@]}
72
cbongiorno@snowball [07:16:54 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % thing=(
array> mappers/gitlab/commits/predicate.js
mappers/gitlab/commits/predicate.jq
)
cbongiorno@snowball [07:17:09 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#thing}
2
</code>
<code>cbongiorno@snowball [05:50:25 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % find mappers/gitlab/commits/ -type f -name 'predicate.*'
mappers/gitlab/commits/predicate.js
mappers/gitlab/commits/predicate.jq
cbongiorno@snowball [07:14:13 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % preds=$(find mappers/gitlab/commits/ -type f -name 'predicate.*')
cbongiorno@snowball [07:14:22 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#preds}
71
cbongiorno@snowball [07:14:29 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#preds[@]}
71
cbongiorno@snowball [07:14:37 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % preds=$(find mappers/gitlab/commits/ -type f -name 'predicate.*' | tr 'n' ' ')
cbongiorno@snowball [07:14:57 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#preds[@]}
72
cbongiorno@snowball [07:16:54 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % thing=(
array> mappers/gitlab/commits/predicate.js
mappers/gitlab/commits/predicate.jq
)
cbongiorno@snowball [07:17:09 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#thing}
2
</code>
cbongiorno@snowball [05:50:25 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % find mappers/gitlab/commits/ -type f -name 'predicate.*'
mappers/gitlab/commits/predicate.js
mappers/gitlab/commits/predicate.jq
cbongiorno@snowball [07:14:13 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % preds=$(find mappers/gitlab/commits/ -type f -name 'predicate.*')
cbongiorno@snowball [07:14:22 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#preds}
71
cbongiorno@snowball [07:14:29 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#preds[@]}
71
cbongiorno@snowball [07:14:37 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % preds=$(find mappers/gitlab/commits/ -type f -name 'predicate.*' | tr 'n' ' ')
cbongiorno@snowball [07:14:57 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#preds[@]}
72
cbongiorno@snowball [07:16:54 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % thing=(
array> mappers/gitlab/commits/predicate.js
mappers/gitlab/commits/predicate.jq
)
cbongiorno@snowball [07:17:09 PM] [~/dev/mine/cqrs] [TICKET-1234 *]
-> % echo ${#thing}
2