I am trying to compare the $duration variable to an int, to see how long it is. I need to deturmine how many 0's to append to the file name to maintain clean names e.g.
cap_000001.png
cap_002938.png
My current statement is:
if [ $duration < 1000 ]; then
sudo ./v2u cap_000$duration.png
echo 1000 seconds
fi
if [ $duration < 100 ]; then
sudo ./v2u cap_0000$duration.png
echo 100 seconds
fi
if [ $duration < 10 ]; then
sudo ./v2u cap_00000$duration.png
echo 10 seconds
fi
Thanks for Helping!
If someone has an easier solution for naming the files with a consistent number of digits that would be great too!