![](https://seccdn.libravatar.org/avatar/d99887fb9e1eabc4017936106efec3fe.jpg?s=120&d=mm&r=g)
In <49EDAA4702000029000180A4@mail2.tmf-group.com>, Dominique Leuenberger wrote:
Hi,
I'm busy writing a script that does 'something' with every file found.
It does something like:
for a in $( find /mnt/Data/Todo -type f -exec basename {} \; ); do /usr/bin/stcommand $a /usr/bin/2ndcommand $a done
The problem here is simply: it works only as long as the filename does not contain any whitechars :(
Is there a good way to get around this?
find /mnt/Data/Todo -type f -print0 | xargs -r0 -- /bin/sh -c 'for a in "$@"; do a=$(basename "$a"); /usr/bin/stcommand "$a"; /usr/bin/2ndcommand "$a"; done' That's untested, but I believe it will work. It might have an off-by-one issue though. -- Boyd Stephen Smith Jr. ,= ,-_-. =. bss@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/ \_/