First let's have a broken sequence of files:
➜ touch page-{1,2,5}.jpg
➜ ls
page-1.jpg page-2.jpg page-5.jpg show-missing.sh
"What was I missing again?"
➜ ls *.jpg | ./show-missing.sh
page-3.jpg
page-4.jpg
"But some of my numbers are padded with zeroes!"
➜ mv page-1.jpg page-01.jpg
➜ mv page-5.jpg page-005.jpg
➜ ls *.jpg | ./show-missing.sh
page-3.jpg
page-4.jpg
Divergent patterns confuse us :( Better to admit to a defeat than to be ambiguous.
➜ touch foobar666.jpg
➜ ls *.jpg | ./show-missing.sh
Abort! Divergent naming patterns found: 'foobar#.jpg' vs 'page-#.jpg'
➜ ls page-*.jpg | ./show-missing.sh
page-3.jpg
page-4.jpg
➜ rm foobar666.jpg
"But I want my sequences to start from zero!"
➜ ls page*.jpg | ./show-missing.sh 0
page-0.jpg
page-3.jpg
page-4.jpg
"But I only like sequences of 3 to 7!"
➜ ls page*.jpg | ./show-missing.sh 3 7
page-3.jpg
page-4.jpg
page-6.jpg
page-7.jpg