Answer the question
In order to leave comments, you need to log in
How to generate variables in bash in a loop?
Is variable name generation possible in bash?
Here is an example
for i in 01 02 03 04 05 06 07 08 15 30 45 60
do
d${i}="${i}day"
done
Answer the question
In order to leave comments, you need to log in
days=(01 02 03 04 05 06 07 08 15 30 45 60)
for i in ${days[*]}
do
echo d${i}=\""${i}day\""
done
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question