Re: find problem
On 11/11/14 at 04:09pm, B. M. wrote:
> Hi all,
>
> I'm struggling with a find problem.
>
> I want to combine find and par2create recursively in order to get the
> following done:
>
> Foreach file with a certain suffix (e.g. avi) do par2create for that
> file in its directory, so e.g.
>
> I'm in /video
> There are subfolders user1, user2 with videos video1.avi, video2.avi ...
> in them.
>
> The script should do something equivalent to:
> cd /video/user1
> par2create .video1.avi video1.avi
> par2create .video2.avi video2.avi
> cd /video/user2
> par2create .video3.avi video3.avi
> par2create .video4.avi video4.avi
> cd <initial directory>
>
> But I want to achieve this using the find command.
>
> So I'd expect something like
> find * -name "*.avi" -execdir par2create .'{}' '{} \;
> but this doesn't work as expected - it creates the .*.avi files "one
> folder above".
>
> How does it work using the find command?
>
> Thanks a lot!
I did a test with cp:
find config/ -name custom.php -execdir cp '{}' '{}'.pippo \;
files are copied with added suffix.
--
« Nunc est bibendum, nunc pede libero pulsanda tellus »
Reply to: