How can I get the dimension of a vector in a makefile? I want to have a simple loop that goes through each element of 2 same-sized vectors.
Example that doesn't work in terms of loop nor size of vectors but to give you an idea of what I am thinking about. The loop notation was taken from this:
V1=one two three four
V2=bird stones parks bears
print:
size={#$(V1)} <- this is my invented notation, obviously it doesn't work.
i=0
while [[ $$i -le $$size ]] ; do \
echo $(V1)[i] $(V2)[i] ; \
((i = i + 1)) ; \
done
Output:
one bird
two stones
three parks
four bears