Christian Perle <[email protected]> (Mon Feb 14 15:27:15 2011): > Hallo, > > On Sun, Feb 13, 2011 at 14:22:34 +0100, Heiko Schlittermann wrote: > > > Alternativ sowas wie (in der Bash, bei anderen Shells ist vielleicht > > anderes Quoting notwendig): > > > > find /my/fotos/ -type f \ > > \( -exec cp --parents --verbose {} /mnt/new/ \; -o -exec true \; \) \ > > -exec sleep 10 \; > > Auch in einem Shellskript sind Dateinamen mit Leerzeichen und aehnlichem > Quatsch kein Problem, wenn man sie mit while read ... von stdin liest: > > #!/bin/bash > find /my/fotos/ -type f | while read p > do > cp --parents --verbose "$p" /mnt/new/ > sleep 1 > done
Hehe, nicht so einfach…
$ mkdir test && cd test
$ touch ' a' 'b ' 'c
d'
$ find . -type f | while read p; do echo "<$p>"; done
$ find . -type f | while read; do echo "<$REPLY>"; done
$ find . -type f -print0 | while read -d $'\x00'; do echo "<$REPLY>"; done
--
Heiko :: dresden : linux : SCHLITTERMANN.de
GPG Key 48D0359B : 3061 CFBF 2D88 F034 E8D2 7E92 EE4E AC98 48D0 359B
signature.asc
Description: Digital signature
_______________________________________________ Lug-dd maillist - [email protected] https://ssl.schlittermann.de/mailman/listinfo/lug-dd
