linux recursive unrar

#!/bin/sh
###		 ###
# filename reunrar #
###		 ###
if [ -n "$1" ]; then
find $1 -iname *.rar | while read f
        do
                file=`basename "$f"`
                dir=`dirname "$f"`

                if [[ $file =~ .*part0*1\.rar$ ]]; then

                        echo "$file to $dir"
                        nice -n 19 unrar e -o- -inul "$f" "$dir"

                elif ! [[ $file =~ .*part[0-9]+\.rar$ ]]; then

                        echo "$file to $dir"
                        nice -n 19 unrar e -o- -inul "$f" "$dir"
                fi
        done
else
echo "reunrar [FILES DIR]"
fi

veya

#!/bin/bash

if [ $# -ne 1 ]
then
  echo "U forgot to enter directory where i should work!"
  exit
fi

while 
mesg="\n==============================================\n
  1.. Check .sfv files.\n
  2.. Unrar all files.\n
  3.. Delete rar and sfv files.\n
  4.. Exit
  \n==============================================\n
Select: \c"
do
  echo -e $mesg
  read selection
  case $selection in
  1)
    cd $1
    cfv -r ;;
  2)
    for f in `find $1 -wholename *.r01`
    do
      echo "Unpacking in directory: "`dirname $f`
      rar e -inul $f `dirname $f`
    done ;;
  3)
    for g in `find $1 -wholename *.r01`
    do 
      cd `dirname $g`
      echo "Deleting in directory: "`dirname $g`
      rm *.r?? *.url *.sfv imdb.nfo
      rm -r Sample/
    done ;;
  4) 
    exit;;
  esac
done

kisaca

rar e -r -inul *.rar