I am trying to make a script in bash that requires the removal of the the file extension from a file name, like the following
original: something.zip
remov
f=file.zip
echo ${f%.zip}
file
The '%' is a parameter modifier, it means, delete from the right side of the value of the variable whatever is after the '%' char, in this case, the string .zip
. You can make this more general to remove any trailing extension, by using a wild card like
echo ${f%.*}
file
IHTH