|> As y'all know
|>
|> find $cwd -name aa\* -exec cp '{}' /tmp \;
|>
|> will find all files beginning with aa in the current directory and copy
|> them to /tmp. The find manpage says "A command argument {} is replaced
|> by the current path name." No problem so far.
|>
|> Now to give these files a unique name I try to extend them with a $$
|> (current pid) thus:
|>
|> cd /tmp
|> find $cwd -name aa\* -exec cp '{}' '{}'.$$ \;
|>
|> This time it bombs, as the 2nd occurrence of {} is not replaced by the
|> current pathname. Is there any reason for this? Is there any way to do
|> what I want?
|>
|> This is on an SGI running Irix 4.0.5.
{} are only expanded if they are the only thing in the argument {}.$$
doesn't satisfy that. You need to write a short sh script that does
what you want and exec that.
--
Michael Salmon
#include <standard.disclaimer>
#include <witty.saying>
#include <fancy.pseudo.graphics>
Ericsson Telecom AB
Stockholm