bash - Getting name of file inside a rar without unrar -


trying bash script together, i'm stuck @ this. rar splited x files, within rar 1 single file. i'm doing below:

cd $dir rarfile in $(find -iname "*.part1.rar")                         echo "rar file: " $rarfile >> $dir/execute.log                 name = $(unrar lb "$rarfile")                 echo "name of file inside rar container: " $name >> $dir/execute.log                 extension ="${name##*.}"                 echo "extension: " $extension >> $dir/execute.log                 filename = ${name%.*}                 echo "name: " $filename >> $dir/execute.log #               unrar x -y -o- $rarfile $uprar_dir         done 

the excecute.log below:

rar file:  ./file.part1.rar name of file inside rar container: extension: name: 

cant seem $name working. unrar working fine should. pls help.

in bash assign value variable cannot have spaces ie:

name=$(unrar lb "$rarfile") 

instead of:

name = $(unrar lb "$rarfile") 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -