Bash for loop with a list variable
Solved
martro1870
Posted messages
3
Status
Membre
-
martro1870 Posted messages 3 Status Membre -
martro1870 Posted messages 3 Status Membre -
Hello,
I am trying to create a loop with a variable:
var="test 01" "test 02" "test 03"
for elem in $var
do
echo $elem
done
doesn't work but
for elem in "test 01" "test 02" "test 03"
echo $elem
done
works fine
the question is how to write a list-type variable?
thank you for your help
I am trying to create a loop with a variable:
var="test 01" "test 02" "test 03"
for elem in $var
do
echo $elem
done
doesn't work but
for elem in "test 01" "test 02" "test 03"
echo $elem
done
works fine
the question is how to write a list-type variable?
thank you for your help