Here's what I'm trying to achieve.
I have a directory with over 4200 sub-files/sub-directories, all of which need to be set to a certain timestamp.
This is a problem because many of them have whitespaces and other weird characters.
First thing I tried:
touch $(find .)
Won't work because of the spaces. It will update the timestamps on all files and directories that are space-free, but those that are not, do not receive the new timestamp. In addition, as one might expected, it creates files in the root directory corresponding to the elements of filenames with spaces. So if I have a file somewhere named "One Two Three", 'touch' creates the 3 files, "One", "Two" and "Three" in the root. This by itself can be remedied by using -c with 'touch', but of course it still won't update the file with the spacey name.
The second thing I tried was:
for FILENAME in $(find .); do touch -t 201007162310.00 "$FILENAME"; done
But it's the same story.
I've found a couple of results online, but they're all trying to achieve something differently and so suggest ways that won't work for me.
So now I'm lost. Any ideas?
Is it really not possible to make the 'find' command prepend and append each line with a quotation mark or something?
EDIT: This needs to be done via shell script. Using Perl, PHP or any other environment will not help. I could easily do this with anything else than Unix shell scripting, but it has to be in a Unix shell script, preferably not a big one.