Hallo alter Scriptschmiedkollege, Am Fri, 08 Apr 2011, Jan Trippler schrieb:
Am Freitag, 8. April 2011, 17:22:08 schrieb Thomas Moritz:
Am Freitag, 8. April 2011 11:53:56 schrieb Bernhard Walle: [...]
Ungetestet: TZ=GMT find /path/to/root -type f -exec touch -D "1970-01-01 00:00" {} \;
Kleine Ergänzung: Die -exec-Option ist nicht sehr ressourcenschonend, da für jede Datei ein neuer Prozess geforkt wird. Außerdem könnte es Probleme bei Dateien mit Leer- oder Sonderzeichen im Namen geben (bin mir da aber nicht sicher).
'find ... -exec .. {} +' (und auch die Version mit ';') ist "sicher" ggü. Leer- und anderer Sonderzeichen. find übergibt die Dateinamen direkt beim 'exec' in char * argv[]. $ strace -f -eexecve -s 128 find . -type f -exec /bin/ls {} + execve("/usr/bin/find", ["find", ".", "-type", "f", "-exec", "/bin/ls", "{}", "+"], [/* 130 vars */]) = 0 Process 24398 attached Process 24397 suspended [pid 24398] execve("/bin/ls", ["/bin/ls", "./a b", "./a\nb", "./b", "./a"], [/* 130 vars */]) = 0 ./a ./a?b ./a b ./b Process 24397 resumed Process 24398 detached --- SIGCHLD (Child exited) @ 0 (0) --- HTH, -dnh -- God must love the Common Man; He made so many of them. -- BSD fortune file -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org