There are at least two separate problems here.
The first problem is apparently missing files.
These apparently missing files are ones whose names are listed in the "DDsince2007" file, but which don't appear in the Desktop/All folder. The script as given is not capable of handling these.
If you actually have files like this, i.e. listed in "DDsince2007" but not present in Desktop/All, then the script will need to be modified to handle this.
First, however, I want to absolutely confirm that the files not being moved are really missing from Desktop/All. Please copy and paste this command into Terminal, then copy and paste the complete output into a post here:
Code:
ls -ld ~/Desktop/All/T1400*
There are at least 4 files named in "DDsince2007" that should match this wildcard pattern.
The second problem is a programming logic bug in the script.
The * wildcard is matching multiple files (this is correct behavior for *, so it's a programmer bug). All matching files are then moved. Here's an example from the Terminal output:
Code:
+ for i in '$fnames'
+ mv '/Users/mvineski/Desktop/All/T18001 RedCal16p.jpg' '/Users/mvineski/Desktop/All/T18002 YellowCal16p.jpg' '/Users/mvineski/Desktop/All/T18003 WhiteCal16p.jpg' '/Users/mvineski/Desktop/All/T18004 BlueCal16p.jpg' '/Users/mvineski/Desktop/All/T18005 GreenCal16p.jpg' '/Users/mvineski/Desktop/All/T18006 PurpleCal16p.jpg' '/Users/mvineski/Desktop/All/T18007 OrangeCal16p.jpg' '/Users/mvineski/Desktop/All/T18008 DeepPinkCal16p.jpg' '/Users/mvineski/Desktop/All/T18009 RainbowPlaid16p.jpg' /Users/mvineski/Desktop/Discontinued/
+ echo 'copying T1800'
We can see from this that the token read from the list-file (DDsince2007) is "T1800" (last line above). We can also see that the expansion of T1800* matches multiple actual files, all of which are moved.
As it turns out, T18001 is the next token from the list-file, but its corresponding real file has already been moved, so that attempt to move fails.
A correct wildcard pattern must match only ONE file. In order to come up with that pattern, I need the answer to this question:
Do all the filenames have a space after the Tnumber, and before the remainder of the filename?