If this is what you typed, it assumes that the file is at the root of your hard drive - is it?
You need to specify the full path to the file, which is what the dragging and dropping does.
I’ve done it both ways, I was getting directory problems at first and sorted that out. It won’t do anything at all if it can’t find it. As long as it’s doing something, even if it’s wrong, I know that the directory isn’t the problem.
Part one is finally working. So now I’m trying to get your script working (which is a wonderful thing because it is based on the ACTUAL contents of the file, not the assumed contents, which my long-way-round is, and could screw up) and this is what’s happening so far…
Because I am so incredibly clueless about all this, I didn’t know for sure where to put the rename_files script, I assumed it should be in the same folder as the split files, so that’s where it is.
and my files are indeed named xxdigitdigit, so I also assume your xx* means “all the files starting with xx” teh asterisk being a wildcard.
./ tells it to run a command in the current directory. If you have ‘.’ in your PATH, then it’s unnecessary. However, a lot of UNIX-based systems don’t have ‘.’ in the PATH for security reasons. I have no clue what OS X does.
Actually, I think you’re done. Once you did the chmod 755 and ran it again, it looks like it worked. Do an ‘ls’ and see what the directory looks like now. Once it worked, it gave you an error when you tried it again as all the xx files had been renamed.
I ran the script through some debug tools and the same errors kept coming back. The syntax was ok, but it keeps spitting out the line 8 issue, saying:
“Error reading xx: No such file or directory at ./rename_files.pl line 8.”
I only get the error when I try it with xx standing alone. When I put xx* it does nothing, no error, no changes, nothing. See: (I tried renaming the docs rrdoc and adding the extension… just in case.)
Huh. It looks like it’s running, but it’s not picking up the photo URLs to allow it to determine the new filename. It’s specifically looking for something like:
HREF=“photos/*****.jpg”
(where ***** represents arbitrary text).
If your photo links are different, then it won’t pick up the filename. It seemed to work okay when I tested it with the sample page you posted.