I have many images captured from my webcam and their name are:
2021-03-29_06-00 2021-03-29_06-02 2021-03-29_06-04 2021-03-29_06-06 2021-03-29_07-00 2021-03-29_08-00 2021-03-29_09-00 etc.. I want to delete images shooted by night.
I found script to obtain sunrise (and sunset) times, now I have to filter my files and delete.
I start to try with ls command.
If I use:
ls *_{00..06}*.jpg the result is correct.
By if I insert a variable with the time of sunrise, encounter of problems.
SUNRISE="06" ls *_{00..$SUNRISE}*.jpg But the result are:
ls: cannot access '*_{00..06}.jpg': File or directory does not exist
bash, brace expansion is done BEFORE the variable is evaluated. Maybe this answer will help?