#!/bin/bash

# playing with a bash array

play_array=("$@")

echo "array has ${#play_array[*]} elements"

echo "array contents (where blanks misbehave):"
for item in ${play_array[*]}
do
    echo $item
done

echo "array contents by their indices"
for index in ${!play_array[*]}
do
    echo ${play_array[$index]}
done