folks, need a hand with unpacking a big batch of rars. Don't want to do this one-by-one. I have several directories inside subdirectories of 'dir' with many .rar's in each.
dir
subdir_a
filename with spaces 01.rar
filename with spaces 02.rar
filename with spaces NN.rar
subdir_b
filename with spaces 01.rar
filename with spaces 02.rar
filename with spaces NN.rar
subdir_c
filename with spaces 01.rar
filename with spaces 02.rar
filename with spaces NN.rar
I woud like to extract the rars into the same locaitons where they currently sit in direcories labebed with the .rar's filename. So, after unraring, subdir_a would look like this:
dir
subdir_a
filename with spaces 01
file 1.ext
file N.ext
filename with spaces 01.rar
filename with spaces 02.rar
filename with spaces 02
file 1.ext
file N.ext
filename with spaces NN.rar
filename with spaces NN
file 1.ext
file N.ext
In dir I tried % find . -name '*.rar' -exec sh -c 'echo unrar e \"$1\" \"${1%.*}\" ' _ {} \;, with the echo for testing. It prints the results I'd expect:
unrar e "./subdir_a/filename with spaces 01.rar" ".subdir_a/filename with spaces 01/"
And so on. However, when I remove the "echo", I get ERROR: Unknown option:
Any idea why and/or if there's a better way for me to approach?