Take, for example, the array definition below:
The following expression evaluates into all values of the array:
It also can be used anywhere a variable or string can be used.
A simple for loop can iterate through this array one value at a time:
names=( Jennifer Tonya Anna Sadie )The following expression evaluates into all values of the array:
${names[@]}It also can be used anywhere a variable or string can be used.
A simple for loop can iterate through this array one value at a time:
for name in ${names[@]} do
echo $name
# other stuff on $name
done
No comments:
Post a Comment