I have got a simple script as follows.
names=("windows" "ubuntu" "raspbian" "debian" "kali linux")
echo "names array length: ${#names[@]}"
for n in ${names[@]}; do
echo $n
done
My intention and hope to get was:
names array length: 5
windows
ubuntu
raspbian
debian
kali linux
but instead the result i got was:
names array length: 5
windows
ubuntu
raspbian
debian
kali
linux
The array seems to have the correct number of entry but printout appears on 6 lines instead of 5. How can i have the desired output?