summaryrefslogtreecommitdiff
path: root/arraytest.sh
blob: 1a5e866a12364f57d2415c0cfdbbb85c040cacad (plain)
1
2
3
4
5
6
7
8
9
10
11
#! /bin/bash
# testing array assignment and quoting.

declare -a arr=("one" "two" "and three" nakedFOUR)

for x in "${arr[@]}"
do
    echo "With quotes \"\$x\"" :"$x":
    echo "      no quotes \$x" :$x:
    echo "          curly braces \${x}" :${x}:
done