Shell script to extract rar files in severa directories
Posted on 2016-11-15
I'm working on a bash script to unrar 10 to 20 directories containing rare files, I however want all extracted files to remain in the directory where the rar files reside.
I have the below working ok if the directory name is continuos, however if the folder name is for example /rar files directorie1 where there are spaces in the dir name it fails.
Any help would be appreciated!
1.. Unrar all files.\n
2.. Delete rar and sfv files.\n
echo -e $mesg
case $selection in
for f in `find $1 -wholename *.rar`
echo "Unpacking in directory: "`dirname $f`
unrar e -inul $f `dirname $f`
for g in `find $1 -wholename *.rar`
cd `dirname $g`
echo "Deleting in directory: "`dirname $g`
rm *.r?? *.url *.sfv *.nfo imdb.nfo
rm -r Sample/