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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -