AppleScript from Terminal unrar command
In the help text of the utility is says...

UNRAR 5.10 beta 4 freeware      Copyright (c) 1993-2014 Alexander Roshal

Usage:     unrar &lt;command&gt; -&lt;switch 1&gt; -&lt;switch N&gt; &lt;archive&gt; &lt;files...&gt;
               &lt;@listfiles...&gt; &lt;path_to_extract&gt;


so you can include the path_to_extract at the end of the command and once inside a loop it's easy. Like this...

cd &lt;path&gt;
for f in `find . -name "*.r*"`; do unrar e -o- $f `dirname $f` &amp;&amp; rm $f; done


HTH