I need a script to rename files. It needs to work in the mac osx terminal.
There are 100 files in three levels if directory. In each directory there are 2 files:
parent_directory/user-a/avatar/[login to view URL]
parent_directory/user-a/avatar/[login to view URL]
parent_directory/user-b/avatar/xxx XXX [login to view URL]
parent_directory/user-b/avatar/xxx [login to view URL]
the files are irregularly named, some with spaces in the filename, some are JPG some jpg
I want these two examples to be:
new_parent_directory/user-a/avatar/[login to view URL]
new_parent_directory/user-a/avatar/[login to view URL]
new_parent_directory/user-b/[login to view URL]
new_parent_directory/user-b/[login to view URL]
ie. They are in a new parent directory, with the same user directory, with no 'avatar' directory, with one image [login to view URL] and one [login to view URL]