- To: Some Linux Users Group <slug@xxxxxxxxxxx>
- Subject: Re: [SLUG] find -exec cp {} current-directory.messages
- From: Raoul Golan <raoul.golan@xxxxxxxxxx>
- Date: Wed May 23 11:47:02 2001
- User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7
Jamie Wilkinson <jaq@xxxxxxxxxxxxxx> writes:
> This one time, at band camp, Terry Collins said:
> >Is there a way of telling find to copy a file in the directory where it
> >finds it?
> >
> >I'm trying to run find . -name files.bbs -exec cp {} .messages \;
> >but this just copies each files.bbs into .message in the directory where
> >the command is run, rather than the directories where each files.bbs
> >exists
>
> find . -name 'files.bbs' -exec cp {} `dirname {}`/.messages \;
>
That doesn't work. Try:
find . -exec echo `dirname {}` \;
and you will see why.
--
:%s/[Ll]inux/GNU\/Linux/g