I got the first section to create the years, but getting the months and incrementing them is stumping me.
#!/bin/bash
varRan=$(( $RANDOM ))
newdir="testing_"$varRan
#echo $newdir
mkdir $newdir
cd ~/$newdir
for ((i = 2000; i<= 2022 ; i++; )); do
for ((m = 1; m<= 12 ; m++; )) do
touch $i$m".txt"
done
# touch $i$m".txt"
done
printf -v filename '%4d%02d.txt' "$i" "$m"; touch "$filename"
– glenn jackman Jan 12 at 14:05