0

I'm trying to write a simple bash alias/function (whichever I get working the quickest), that unrars multi-rar archives. None of my attempts work though.

The plain command invoked in the shell doesn't work either, which I guess is probably the gist of the problem:

find . \( -name *.rar -and -not -name *.part*.rar \) -or -name *.part01.rar -exec unrar x {} \;

The find part of the command seems to do its work fine, although the -exec doesn't seem to be invoked at all.

Thanks!

hillsprig
  • 307
  • 5
  • 12

1 Answers1

1

Does the unrar work individually (I haven't used unrar)? Try using xargs..

find . \( -name *.rar -and -not -name *.part*.rar \) -or -name *.part01.rar | xargs -I {} unrar x {}
Hari Menon
  • 33,649
  • 14
  • 85
  • 108
  • That works, thanks. Think it's peculiar that I can't get it to work with -exec though. I actually tried the same thing but without the -I and {}, so nothing worked :) Thanks! – hillsprig Sep 14 '11 at 21:20