I am trying to grep the folder name from full tar file. Below is the example.
example:
TEST-5.3.0.0-build1.x86_64.tar.gz
I want to grep the folder name (TEST-5.3.0.0-build1) in shell script
So i tried below command for grep
$ package_folder=$(echo TEST-5.3.0.0-build1.x86_64.tar.gz | sed -e "s/.[0-9]*[a-z]*[0-9]*.tar.gz$//" | sed -e 's/\/$//')
But I am getting below output:
$ echo $package_folder
TEST-5.3.0.0-build1.x86
Could you please anyone correct me where I am doing mistake. I need folder name as TEST-5.3.0.0-build1
Thanks in Advance!!!