From fd6dea2c1796e19665a3085fa4f6b90d5367031d Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Wed, 22 Jul 2020 12:27:45 -0500 Subject: [PATCH] Simplify extension extraction --- lib/buildFileList.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 70dc7c4d..a1e1ebb4 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -84,9 +84,10 @@ function BuildFileList() { ########################### # Get the files extension # ########################### - # Extract just the file and extension, reverse it, cut off extension, - # reverse it back, substitute to lowercase - FILE_TYPE=$(basename "${FILE}" | rev | cut -f1 -d'.' | rev | awk '{print tolower($0)}') + # Extract just the file extension + FILE_TYPE=${FILE##*.} + # To lowercase + FILE_TYPE=${FILE_TYPE,,} ############## # Print file #