shopt -s globstar
for f in **/*.rar; do
dir=`dirname "$f"`;
unrar e "$f" "$dir" && rm -frv "${f::-2}*";
done
From echoing out testing the rm command, the file is the correct path. I don't receive any errors about an incorrect path or anything. I know there are other methods to use find, but that would be pointless and use extra cpu cycles this should be working from everything I found. Any ideas on how to use the rm command properly?