Simplify extension extraction

This commit is contained in:
Eric Nemchik 2020-07-22 12:27:45 -05:00
parent 6f2c7cace3
commit fd6dea2c17

View file

@ -84,9 +84,10 @@ function BuildFileList() {
########################### ###########################
# Get the files extension # # Get the files extension #
########################### ###########################
# Extract just the file and extension, reverse it, cut off extension, # Extract just the file extension
# reverse it back, substitute to lowercase FILE_TYPE=${FILE##*.}
FILE_TYPE=$(basename "${FILE}" | rev | cut -f1 -d'.' | rev | awk '{print tolower($0)}') # To lowercase
FILE_TYPE=${FILE_TYPE,,}
############## ##############
# Print file # # Print file #