Based off this: How to zero pad a sequence of integers in bash so that all have the same width?
I need to create new file names to enter into an array representing chromosomes 1-22 with three digits (chromsome001_results_file.txt..chromsome022_results_file.txt)
Prior to using a three digit system (which sorts easier) I was using
for i in {1..22};
do echo chromsome${i}_results_file.txt;
done
I have read about printf and seq but was wondering how they could be put within the middle of a loop surrounded by text to get the 001 to 022 to stick to the text.
Many thanks