Posted by BrainChildRalph on December 3, 2018, modified on December 3, 2018
Parameter replacement:
${parameter/pattern/string}
File Name and Extension
# file's basename
b=$(basename -- ${filePath})
# Check if extension exists
if [[ $b == *"."* ]] ; then
extension=${b##*.}
name=${b%.*}
fi