Store a filename in a variable minus the extension
Use bash
parameter expansion:
zip_file="${filename}"
new_name="${zip_file%.*}"
new_name
will contain the nametest
if thezip_file
hastest.zip
If the
zip_file
hastest.foo.zip
,new_name
will havetest.foo
, if you want onlytest
out oftest.foo.zip
use:new_name="${zip_file%%.*}"