In <[EMAIL PROTECTED]>, Angus Leeming <[EMAIL PROTECTED]> typed: > Lars Gullik Bjønnes wrote: > > | The problem is that "for" splits the returned list of files using > > | whitespace... > > > > find foo -name \*.gif -print -exec convert {} `basename {}`.png \; > > then (ha!) > > Thanks. I've just learnt something. > > Don't you have to quote the args passed to convert? Bet you still do.
Depends on the shell. { and } are magic to csh and zsh, and need quoting if you're using those. They aren't magic to sh, so they don't need quoting if you're using that. I don't keep bash installed, so I don't know if you need them with bash. As an ex-csh user, I quote them out of habit. But the basename invocation used by lars is wrong. It needs to be $(basename {} .gif).png (I always use $(...); you have to to nest command substitutions, and I find it a bit more readable). If you leave out the .gif, you get the full filename. > Ain't scripting fun ;) Your scripts work much better if you start them with #!/usr/bin/env python :-). <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.