I have a list of lines in a Bash script as follows
if [ ! -z "$clone01" ]; then git clone "$clone01"; fi if [ ! -z "$clone02" ]; then git clone "$clone02"; fi if [ ! -z "$clone03" ]; then git clone "$clone03"; fi # $clone01 .... through to ... $clone60 if [ ! -z "$clone60" ]; then git clone "$clone60"; fi
the leading zero at the end of the variable, when the number is less than 10, is important.
I have tried various substitutions and loops etc. This code is very repetitive, and there are 60 lines of it.
How can I create this code dynamically and make it part of my executed script? What is the optimal approach to this problem?