VALUES=(
value1
value2
value3
...
valueN
)
# Alternately:
#VALUES=("value1" "value2" "value3" "..." "valueN")
for ((i=0; i<${#VALUES[@]}; i++))
do
echo ${VALUES[$i]}
done
looping through an array with the for loop in bash
Submitted by sandip on Wed, 01/17/2007 - 11:40
»
- sandip's blog
- Login or register to post comments
bash for loop
VALUES="value1 value2 value3 ... valueN"
for i in $VALUES
do
echo $i
done