I tried this code in my shell script in ubuntu 12.04 bash
IFS=$'\t'
name=(one two three four five)
fam=($(seq -s" " 1 1 5))
for (i=0;i<5;i++)
do
printf "%s\t%s\n" ${fam[i]} ${name[i]}
done
The output I want is like that
1 one
2 two
3 three
4 four
5 five
But the really output is
1 2 3 4 5 one
two
three
four
five
What went wrong in my code? and how to print more than one array variable in a line just using one loop?