Greetings, I'm new to bash scripting. I am writing a script to help me in making gif images from a large video. I've written bash code to successfully take an input video, output 2 things: a video at the desired output size with 10 fps, and a png for each frame in that video (let's say, 59000 images) then the script watermarks all of those images.
The images are named, say, test00001.png - test59704.png
Now, seeing as Nautilus chokes and dies a firey death on a folder with that many files, I want to be able to have a command where I move a subset of files to another folder. I see it taking the start frame number, the end frame number, and the folder name, and automatically running a for loop moving them all. I understand how to do that in theory, but in making my for loop, how can I preserve my incrementing number to have 5 digits?
Let's say I input $START $FINISH and $DIR
for ((i=$START;i<=$FINISH;i+=1)); do
mv "test"$i".png" $DIR"/test"$i".png"
I'm not even sure if that would work, but before I can test it, the problem would be if I want to copy frames 9-200, the script would look for "test9.png" instead of "test00009.png" and I don't know how to force 5 digits. I thought about doing some sort of conditional switch testing the range of the value, but that seemed inelegant. Any help is appreciated!